diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-07-11 10:53:33 -0400 |
---|---|---|
committer | Moritz Angermann <moritz.angermann@gmail.com> | 2020-07-14 02:12:23 -0400 |
commit | 6c2f69c68956be6b956d589ad838be3c1d986f49 (patch) | |
tree | 61a9b095a1edb092571f3b8fe19aaae8581b3951 | |
parent | c3ac87ece2716b83ad886e81c20f4161e8ec0efd (diff) | |
download | haskell-wip/use-CmmRegOff-smart-ctor.tar.gz |
StgToCmm: Use CmmRegOff smart constructorwip/use-CmmRegOff-smart-ctor
Previously we would generate expressions of the form
`CmmRegOff BaseReg 0`. This should do no harm (and really should be
handled by the NCG anyways) but it's better to just generate a plain
`CmmReg`.
-rw-r--r-- | compiler/GHC/StgToCmm/CgUtils.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/StgToCmm/CgUtils.hs b/compiler/GHC/StgToCmm/CgUtils.hs index 1ed7f2384f..25cd5e04c1 100644 --- a/compiler/GHC/StgToCmm/CgUtils.hs +++ b/compiler/GHC/StgToCmm/CgUtils.hs @@ -121,7 +121,7 @@ regTableOffset dflags n = get_Regtable_addr_from_offset :: DynFlags -> Int -> CmmExpr get_Regtable_addr_from_offset dflags offset = if haveRegBase (targetPlatform dflags) - then CmmRegOff baseReg offset + then cmmRegOff baseReg offset else regTableOffset dflags offset -- | Fixup global registers so that they assign to locations within the |