diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-11-13 12:34:54 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-11-28 15:49:46 -0500 |
commit | 048a91380cbbc18d1704bb7c328247a1660b5596 (patch) | |
tree | 4030bc33eff0bc45e14c59696146af7bda9c9e6a /compiler/nativeGen/PPC | |
parent | 17e71c14fee6bc068cf081abfc1abd0470e84c66 (diff) | |
download | haskell-048a91380cbbc18d1704bb7c328247a1660b5596.tar.gz |
cmm: Use LocalBlockLabel instead of AsmTempLabel to represent blocks
blockLbl was originally changed in 8b007abbeb3045900a11529d907a835080129176 to
use mkTempAsmLabel to fix an inconsistency resulting in #14221. However, this
breaks the C code generator, which doesn't support AsmTempLabels (#14454).
Instead let's try going the other direction: use a new CLabel variety,
LocalBlockLabel. Then we can teach the C code generator to deal with
these as well.
Diffstat (limited to 'compiler/nativeGen/PPC')
-rw-r--r-- | compiler/nativeGen/PPC/Ppr.hs | 4 | ||||
-rw-r--r-- | compiler/nativeGen/PPC/RegInfo.hs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index 101628e3a3..2f64d82ee5 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -603,7 +603,7 @@ pprInstr (BCC cond blockid prediction) = hcat [ char '\t', ppr lbl ] - where lbl = mkAsmTempLabel (getUnique blockid) + where lbl = mkLocalBlockLabel (getUnique blockid) pprPrediction p = case p of Nothing -> empty Just True -> char '+' @@ -621,7 +621,7 @@ pprInstr (BCCFAR cond blockid prediction) = vcat [ ppr lbl ] ] - where lbl = mkAsmTempLabel (getUnique blockid) + where lbl = mkLocalBlockLabel (getUnique blockid) neg_prediction = case prediction of Nothing -> empty Just True -> char '-' diff --git a/compiler/nativeGen/PPC/RegInfo.hs b/compiler/nativeGen/PPC/RegInfo.hs index bf894fd42f..1015ed661d 100644 --- a/compiler/nativeGen/PPC/RegInfo.hs +++ b/compiler/nativeGen/PPC/RegInfo.hs @@ -51,8 +51,8 @@ shortcutStatics fn (Statics lbl statics) shortcutLabel :: (BlockId -> Maybe JumpDest) -> CLabel -> CLabel shortcutLabel fn lab - | Just uq <- maybeAsmTemp lab = shortBlockId fn (mkBlockId uq) - | otherwise = lab + | Just blkId <- maybeLocalBlockLabel lab = shortBlockId fn blkId + | otherwise = lab shortcutStatic :: (BlockId -> Maybe JumpDest) -> CmmStatic -> CmmStatic shortcutStatic fn (CmmStaticLit (CmmLabel lab)) @@ -71,6 +71,6 @@ shortBlockId shortBlockId fn blockid = case fn blockid of - Nothing -> mkAsmTempLabel uq + Nothing -> mkLocalBlockLabel uq Just (DestBlockId blockid') -> shortBlockId fn blockid' where uq = getUnique blockid |