diff options
Diffstat (limited to 'compiler/codeGen')
-rw-r--r-- | compiler/codeGen/StgCmmEnv.hs | 8 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmMonad.hs | 2 | ||||
-rw-r--r-- | compiler/codeGen/StgCmmPrim.hs | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/compiler/codeGen/StgCmmEnv.hs b/compiler/codeGen/StgCmmEnv.hs index 8dbb646cdc..a6dc5cb27f 100644 --- a/compiler/codeGen/StgCmmEnv.hs +++ b/compiler/codeGen/StgCmmEnv.hs @@ -45,6 +45,8 @@ import Name import StgSyn import Outputable +import Data.Foldable ( foldl' ) + ------------------------------------- -- Non-void types ------------------------------------- @@ -130,9 +132,9 @@ addBindC stuff_to_bind = do addBindsC :: [CgIdInfo] -> FCode () addBindsC new_bindings = do binds <- getBinds - let new_binds = foldl (\ binds info -> extendVarEnv binds (cg_id info) info) - binds - new_bindings + let new_binds = foldl' (\ binds info -> extendVarEnv binds (cg_id info) info) + binds + new_bindings setBinds new_binds getCgIdInfo :: Id -> FCode CgIdInfo diff --git a/compiler/codeGen/StgCmmMonad.hs b/compiler/codeGen/StgCmmMonad.hs index 2742acdcdb..2bac864244 100644 --- a/compiler/codeGen/StgCmmMonad.hs +++ b/compiler/codeGen/StgCmmMonad.hs @@ -662,7 +662,7 @@ forkAlts branch_fcodes , cgs_hp_usg = cgs_hp_usg state } (_us, results) = mapAccumL compile us branch_fcodes (branch_results, branch_out_states) = unzip results - ; setState $ foldl stateIncUsage state branch_out_states + ; setState $ foldl' stateIncUsage state branch_out_states -- NB foldl. state is the *left* argument to stateIncUsage ; return branch_results } diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs index 84f263cc3c..138041b7e7 100644 --- a/compiler/codeGen/StgCmmPrim.hs +++ b/compiler/codeGen/StgCmmPrim.hs @@ -1030,7 +1030,7 @@ genericWordMul2Op [res_h, res_l] [arg_x, arg_y] toTopHalf x = CmmMachOp (MO_Shl (wordWidth dflags)) [x, hww] bottomHalf x = CmmMachOp (MO_And (wordWidth dflags)) [x, hwm] add x y = CmmMachOp (MO_Add (wordWidth dflags)) [x, y] - sum = foldl1 add + sum = foldl1' add mul x y = CmmMachOp (MO_Mul (wordWidth dflags)) [x, y] or x y = CmmMachOp (MO_Or (wordWidth dflags)) [x, y] hww = CmmLit (CmmInt (fromIntegral (widthInBits (halfWordWidth dflags))) |