diff options
| author | Dan Gohman <dan433584@gmail.com> | 2015-12-10 00:37:51 +0000 |
|---|---|---|
| committer | Dan Gohman <dan433584@gmail.com> | 2015-12-10 00:37:51 +0000 |
| commit | dab313e0edc5ae10196d18dd5feafa6cf0ea5760 (patch) | |
| tree | e17f2ac23c57a6b678e34912592a259891293073 /llvm/lib/CodeGen | |
| parent | a8483755d37acf9468ec54ae66d4e720907cd264 (diff) | |
| download | bcm5719-llvm-dab313e0edc5ae10196d18dd5feafa6cf0ea5760.tar.gz bcm5719-llvm-dab313e0edc5ae10196d18dd5feafa6cf0ea5760.zip | |
PeepholeOptimizer: Ignore dead implicit defs
Target-specific instructions may have uninteresting physreg clobbers,
for target-specific reasons. The peephole pass doesn't need to concern
itself with such defs, as long as they're implicit and marked as dead.
llvm-svn: 255182
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/PeepholeOptimizer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp index 0fabc40b64e..f861edf7da2 100644 --- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp +++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp @@ -1343,6 +1343,9 @@ bool PeepholeOptimizer::foldImmediate(MachineInstr *MI, MachineBasicBlock *MBB, MachineOperand &MO = MI->getOperand(i); if (!MO.isReg() || MO.isDef()) continue; + // Ignore dead implicit defs. + if (MO.isImplicit() && MO.isDead()) + continue; unsigned Reg = MO.getReg(); if (!TargetRegisterInfo::isVirtualRegister(Reg)) continue; @@ -1703,6 +1706,9 @@ ValueTrackerResult ValueTracker::getNextSourceFromBitcast() { const MachineOperand &MO = Def->getOperand(OpIdx); if (!MO.isReg() || !MO.getReg()) continue; + // Ignore dead implicit defs. + if (MO.isImplicit() && MO.isDead()) + continue; assert(!MO.isDef() && "We should have skipped all the definitions by now"); if (SrcIdx != EndOpIdx) // Multiple sources? |

