aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-03-08 23:49:12 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-03-08 23:49:12 +0000
commitc9e8621268cc818bdde073e7fbbf25e78dc7cdb1 (patch)
tree56485e831a4e63c8e6e3ae446cf5f32f61765002 /llvm/lib/CodeGen/MachineCSE.cpp
parent8590544ea88ec219c3e9ed3f19122c0e8257565f (diff)
downloadllvm-c9e8621268cc818bdde073e7fbbf25e78dc7cdb1.zip
llvm-c9e8621268cc818bdde073e7fbbf25e78dc7cdb1.tar.gz
llvm-c9e8621268cc818bdde073e7fbbf25e78dc7cdb1.tar.bz2
Don't waste time trying to CSE labels, phis, inline asm. Definitely avoid cse implicit-def for obvious performance reason.
llvm-svn: 98009
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCSE.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index ce8ebbc..a0023fe 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -171,6 +171,10 @@ bool MachineCSE::hasLivePhysRegDefUse(MachineInstr *MI, MachineBasicBlock *MBB){
}
bool MachineCSE::isCSECandidate(MachineInstr *MI) {
+ if (MI->isLabel() || MI->isPHI() || MI->isImplicitDef() ||
+ MI->isKill() || MI->isInlineAsm())
+ return false;
+
// Ignore copies or instructions that read / write physical registers
// (except for dead defs of physical registers).
unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;