Commit 530e25a6 authored by tibbe's avatar tibbe Committed by dterei

codeGen: Make emitCopyByteArray less pessimistic

Assigning the arguments to temporaries was only needed in the case of
emitCopyArray, where the arguments are alive across the call.  That is
not the case in emitCopyByteArray.
Signed-off-by: dterei's avatarDavid Terei <davidterei@gmail.com>
parent caff8eab
......@@ -680,18 +680,9 @@ emitCopyByteArray :: (CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr
-> CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr
-> StgLiveVars
-> Code
emitCopyByteArray copy src0 src_off0 dst0 dst_off0 n0 live = do
-- Assign the arguments to temporaries so the code generator can
-- calculate liveness for us.
src <- assignTemp_ src0
src_off <- assignTemp_ src_off0
dst <- assignTemp_ dst0
dst_off <- assignTemp_ dst_off0
n <- assignTemp_ n0
emitCopyByteArray copy src src_off dst dst_off n live = do
dst_p <- assignTemp $ cmmOffsetExpr (cmmOffsetB dst arrWordsHdrSize) dst_off
src_p <- assignTemp $ cmmOffsetExpr (cmmOffsetB src arrWordsHdrSize) src_off
copy src dst dst_p src_p n live
-- ----------------------------------------------------------------------------
......
......@@ -747,17 +747,9 @@ emitCopyByteArray :: (CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr
-> FCode ())
-> CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr
-> FCode ()
emitCopyByteArray copy src0 src_off0 dst0 dst_off0 n0 = do
-- Passed as arguments (be careful)
src <- assignTempE src0
src_off <- assignTempE src_off0
dst <- assignTempE dst0
dst_off <- assignTempE dst_off0
n <- assignTempE n0
emitCopyByteArray copy src src_off dst dst_off n = do
dst_p <- assignTempE $ cmmOffsetExpr (cmmOffsetB dst arrWordsHdrSize) dst_off
src_p <- assignTempE $ cmmOffsetExpr (cmmOffsetB src arrWordsHdrSize) src_off
copy src dst dst_p src_p n
-- ----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment