summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmCon.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-11-28 15:30:10 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2018-11-28 15:35:28 +0000
commite08d34bbb4e68cd2c14e8e94ca3933ce5407d65b (patch)
tree0536022207b1bf0e633021c48638bb62afe724e4 /compiler/codeGen/StgCmmCon.hs
parent4c8bf63b78f2fea56a184ef2a40e616f4b8bc59b (diff)
downloadhaskell-e08d34bbb4e68cd2c14e8e94ca3933ce5407d65b.tar.gz
Comments only
Diffstat (limited to 'compiler/codeGen/StgCmmCon.hs')
-rw-r--r--compiler/codeGen/StgCmmCon.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/compiler/codeGen/StgCmmCon.hs b/compiler/codeGen/StgCmmCon.hs
index 2ddeceb825..258896ff1a 100644
--- a/compiler/codeGen/StgCmmCon.hs
+++ b/compiler/codeGen/StgCmmCon.hs
@@ -272,14 +272,12 @@ bindConArgs (DataAlt con) base args
-- when accessing the constructor field.
bind_arg :: (NonVoid Id, ByteOff) -> FCode (Maybe LocalReg)
bind_arg (arg@(NonVoid b), offset)
- | isDeadBinder b =
- -- Do not load unused fields from objects to local variables.
- -- (CmmSink can optimize this, but it's cheap and common enough
- -- to handle here)
- return Nothing
- | otherwise = do
- emit $ mkTaggedObjectLoad dflags (idToReg dflags arg) base offset tag
- Just <$> bindArgToReg arg
+ | isDeadBinder b -- See Note [Dead-binder optimisation] in StgCmmExpr
+ = return Nothing
+ | otherwise
+ = do { emit $ mkTaggedObjectLoad dflags (idToReg dflags arg)
+ base offset tag
+ ; Just <$> bindArgToReg arg }
mapMaybeM bind_arg args_w_offsets