X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fcmm%2FCmmUtils.hs;h=a04935b279e0da9b423b275e7192711ff4c2a2e3;hb=14a5c62a2d27830ea8b3716bb32a04f23678b355;hp=b2a107c1cc39b2eba058debd88b6df80a8b15eb5;hpb=423d477bfecd490de1449c59325c8776f91d7aac;p=ghc-hetmet.git diff --git a/ghc/compiler/cmm/CmmUtils.hs b/ghc/compiler/cmm/CmmUtils.hs index b2a107c..a04935b 100644 --- a/ghc/compiler/cmm/CmmUtils.hs +++ b/ghc/compiler/cmm/CmmUtils.hs @@ -10,7 +10,7 @@ module CmmUtils( CmmStmts, noStmts, oneStmt, mkStmts, plusStmts, stmtList, isNopStmt, - isTrivialCmmExpr, + isTrivialCmmExpr, hasNoGlobalRegs, cmmRegOff, cmmLabelOff, cmmOffset, cmmOffsetLit, cmmIndex, cmmOffsetExpr, cmmIndexExpr, cmmLoadIndex, @@ -90,6 +90,14 @@ isTrivialCmmExpr (CmmLit _) = True isTrivialCmmExpr (CmmReg _) = True isTrivialCmmExpr (CmmRegOff _ _) = True +hasNoGlobalRegs :: CmmExpr -> Bool +hasNoGlobalRegs (CmmLoad e _) = hasNoGlobalRegs e +hasNoGlobalRegs (CmmMachOp _ es) = all hasNoGlobalRegs es +hasNoGlobalRegs (CmmLit _) = True +hasNoGlobalRegs (CmmReg (CmmLocal _)) = True +hasNoGlobalRegs (CmmRegOff (CmmLocal _) _) = True +hasNoGlobalRegs _ = False + --------------------------------------------------- -- -- Expr Construction helpers