From e08d34bbb4e68cd2c14e8e94ca3933ce5407d65b Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Wed, 28 Nov 2018 15:30:10 +0000 Subject: Comments only --- compiler/codeGen/StgCmmCon.hs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'compiler/codeGen/StgCmmCon.hs') 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 -- cgit v1.2.1