diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-06-17 13:59:43 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-06-17 13:59:43 +0000 |
commit | e0304d1df9316c0fadb60a4d4f7a2604d1f54831 (patch) | |
tree | fa9a193e8aacf94441fb8abee1dddd2636cd4fa9 /llvm/lib/CodeGen | |
parent | afdfed3d47db94637b63bcdf615ff9b3f2b202a1 (diff) | |
download | bcm5719-llvm-e0304d1df9316c0fadb60a4d4f7a2604d1f54831.tar.gz bcm5719-llvm-e0304d1df9316c0fadb60a4d4f7a2604d1f54831.zip |
Two fixes relating to debug value:
* We should change the generated code because of a debug use.
* Avoid creating debug uses of undef, as they become a kill.
Test to follow.
llvm-svn: 133255
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/TailDuplication.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp index 90cb72f3b67..c27e0d4ed6b 100644 --- a/llvm/lib/CodeGen/TailDuplication.cpp +++ b/llvm/lib/CodeGen/TailDuplication.cpp @@ -242,6 +242,14 @@ bool TailDuplicatePass::TailDuplicateBlocks(MachineFunction &MF) { MachineOperand &UseMO = UI.getOperand(); MachineInstr *UseMI = &*UI; ++UI; + if (UseMI->isDebugValue()) { + // SSAUpdate can replace the use with an undef. That creates + // a debug instruction that is a kill. + // FIXME: Should it SSAUpdate job to delete debug instructions + // instead of replacing the use with undef? + UseMI->eraseFromParent(); + continue; + } if (UseMI->getParent() == DefBB && !UseMI->isPHI()) continue; SSAUpdate.RewriteUse(UseMO); @@ -283,6 +291,8 @@ static bool isDefLiveOut(unsigned Reg, MachineBasicBlock *BB, for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(Reg), UE = MRI->use_end(); UI != UE; ++UI) { MachineInstr *UseMI = &*UI; + if (UseMI->isDebugValue()) + continue; if (UseMI->getParent() != BB) return true; } |