Commit 3513b073 authored by Edward Z. Yang's avatar Edward Z. Yang

Skip constant folding in nativegen if new codegen used.

Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@mit.edu>
parent b8e0ce7b
......@@ -891,8 +891,14 @@ cmmStmtConFold stmt
-> return other
cmmExprConFold :: ReferenceKind -> CmmExpr -> CmmOptM CmmExpr
-- ToDo: Allow for a flag to turn off invocation of cmmExprCon -- EZY
cmmExprConFold referenceKind expr = cmmExprNative referenceKind (cmmExprCon expr)
cmmExprConFold referenceKind expr = do
dflags <- getDynFlagsCmmOpt
-- Skip constant folding if new code generator is running
-- (this optimization is done in Hoopl)
let expr' = if dopt Opt_TryNewCodeGen dflags
then expr
else cmmExprCon expr
cmmExprNative referenceKind expr'
cmmExprCon :: CmmExpr -> CmmExpr
cmmExprCon (CmmLoad addr rep) = CmmLoad (cmmExprCon addr) rep
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment