projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
77b99dc
)
Eliminate more dead reg->reg moves in linear allocator
author
Ben.Lippmeier@anu.edu.au
<unknown>
Thu, 23 Aug 2007 13:26:14 +0000
(13:26 +0000)
committer
Ben.Lippmeier@anu.edu.au
<unknown>
Thu, 23 Aug 2007 13:26:14 +0000
(13:26 +0000)
compiler/nativeGen/RegAllocLinear.hs
patch
|
blob
|
history
diff --git
a/compiler/nativeGen/RegAllocLinear.hs
b/compiler/nativeGen/RegAllocLinear.hs
index
d9ff121
..
d761bae
100644
(file)
--- a/
compiler/nativeGen/RegAllocLinear.hs
+++ b/
compiler/nativeGen/RegAllocLinear.hs
@@
-498,7
+498,15
@@
genRaInsn block_live new_instrs instr r_dying w_dying =
-- (j) free up stack slots for dead spilled regs
-- TODO (can't be bothered right now)
-- (j) free up stack slots for dead spilled regs
-- TODO (can't be bothered right now)
- return (patched_instr : w_spills ++ reverse r_spills
+ -- erase reg->reg moves where the source and destination are the same.
+ -- If the src temp didn't die in this instr but happened to be allocated
+ -- to the same real reg as the destination, then we can erase the move anyway.
+ squashed_instr = case isRegRegMove patched_instr of
+ Just (src, dst)
+ | src == dst -> []
+ _ -> [patched_instr]
+
+ return (squashed_instr ++ w_spills ++ reverse r_spills
++ clobber_saves ++ new_instrs,
fixup_blocks)
}}
++ clobber_saves ++ new_instrs,
fixup_blocks)
}}