|
From: <sv...@va...> - 2014-10-02 16:13:27
|
Author: sewardj
Date: Thu Oct 2 17:13:20 2014
New Revision: 2964
Log:
Add folding rules for: Sar64(x,0) and Sar32(x,0). Immediate
shifts by zero seem to have a surprisingly large perf hit on
Intels, possibly due to the bizarre eflags/rflags semantics
involved.
Modified:
trunk/priv/ir_opt.c
Modified: trunk/priv/ir_opt.c
==============================================================================
--- trunk/priv/ir_opt.c (original)
+++ trunk/priv/ir_opt.c Thu Oct 2 17:13:20 2014
@@ -2075,7 +2075,8 @@
case Iop_Shl32:
case Iop_Shl64:
case Iop_Shr64:
- /* Shl32/Shl64/Shr64(x,0) ==> x */
+ case Iop_Sar64:
+ /* Shl32/Shl64/Shr64/Sar64(x,0) ==> x */
if (isZeroU(e->Iex.Binop.arg2)) {
e2 = e->Iex.Binop.arg1;
break;
@@ -2087,8 +2088,9 @@
}
break;
+ case Iop_Sar32:
case Iop_Shr32:
- /* Shr32(x,0) ==> x */
+ /* Shr32/Sar32(x,0) ==> x */
if (isZeroU(e->Iex.Binop.arg2)) {
e2 = e->Iex.Binop.arg1;
break;
|