summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-04-02 02:21:24 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-04-02 02:21:24 +0000
commit604bc162daa21fca33fb2c71b4af52e35a29f60f (patch)
treed7968bacf81644ee20e215d273a8a464fd7f99f5 /llvm/lib/CodeGen/MachineCSE.cpp
parent4a70ae54b4b86cc97bb07e20c9e1d71439fb88b6 (diff)
downloadbcm5719-llvm-604bc162daa21fca33fb2c71b4af52e35a29f60f.tar.gz
bcm5719-llvm-604bc162daa21fca33fb2c71b4af52e35a29f60f.zip
After trivial coalescing, the MI being visited may have become a copy. Avoid adding it to CSE hash table since copies aren't being considered for CSE and they may be deleted.
rdar://7819990 llvm-svn: 100170
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCSE.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index fc9dea8e827..597d51d4f37 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -294,8 +294,12 @@ bool MachineCSE::ProcessBlock(MachineDomTreeNode *Node) {
bool FoundCSE = VNT.count(MI);
if (!FoundCSE) {
// Look for trivial copy coalescing opportunities.
- if (PerformTrivialCoalescing(MI, MBB))
+ if (PerformTrivialCoalescing(MI, MBB)) {
+ // After coalescing MI itself may become a copy.
+ if (isCopy(MI, TII))
+ continue;
FoundCSE = VNT.count(MI);
+ }
}
// FIXME: commute commutable instructions?
OpenPOWER on IntegriCloud