Defaults to "yes".
Add VexControl::iropt_fold_expr and observe it in fold_Expr_WRK.
This flag will be used shortly in the iropt-test program.
Users are not expected to use it which is why I'm not announcing
it in NEWS.
__attribute__((noinline))
static IRExpr* fold_Expr_WRK ( IRExpr** env, IRExpr* e )
{
+ if (UNLIKELY(vex_control.iropt_fold_expr == False)) return e;
+
Int shift;
IRExpr* e2 = e; /* e2 is the result of folding e, if possible */
Int vex_traceflags = 0;
/* Max # guest insns per bb */
-VexControl vex_control = { 0,0,VexRegUpd_INVALID,0,0,False,0 };
+VexControl vex_control = { 0,0,VexRegUpd_INVALID,0,0,False,0,False };
vcon->guest_max_insns = 60;
vcon->guest_chase = True;
vcon->regalloc_version = 3;
+ vcon->iropt_fold_expr = True;
}
void LibVEX_set_VexControl ( VexControl vcon )
- '3': current, faster implementation; perhaps producing slightly worse
spilling decisions. */
UInt regalloc_version;
+ /* When false constant folding and algebric simplification is disabled.
+ This is used in the iropt tester. */
+ Bool iropt_fold_expr;
}
VexControl;
" --vex-iropt-verbosity=<0..9> [0]\n"
" --vex-iropt-level=<0..2> [2]\n"
" --vex-iropt-unroll-thresh=<0..400> [120]\n"
+" --vex-iropt-fold-expr=no|yes [yes]\n"
" --vex-guest-max-insns=<1..100> [50]\n"
" --vex-guest-chase=no|yes [yes]\n"
" Precise exception control. Possible values for 'mode' are as follows\n"
VG_(clo_vex_control).iropt_level, 0, 2) {}
else if VG_BINT_CLO(arg, "--vex-regalloc-version",
VG_(clo_vex_control).regalloc_version, 2, 3) {}
+ else if VG_BOOL_CLOM(cloPD, arg, "--vex-iropt-fold-expr",
+ VG_(clo_vex_control).iropt_fold_expr) {}
else if (VG_STRINDEX_CLO(arg, "--vex-iropt-register-updates",
pxStrings, ix)