summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2016-05-10 17:57:27 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2016-05-10 17:57:27 +0000
commite5a2f116d675a2288533c147e2092f76069679e8 (patch)
tree4d67ec9f52b5767a31b5fa24321159f3ab891e56 /llvm/lib/CodeGen/MachineInstr.cpp
parent4d41cb6cc6903978377c871449b6344e80197823 (diff)
downloadbcm5719-llvm-e5a2f116d675a2288533c147e2092f76069679e8.tar.gz
bcm5719-llvm-e5a2f116d675a2288533c147e2092f76069679e8.zip
Fix PR26655: Bail out if all regs of an inst BUNDLE have the correct kill flag
Summary: While setting kill flags on instructions inside a BUNDLE, we bail out as soon as we set kill flag on a register. But we are missing a check when all the registers already have the correct kill flag set. We need to bail out in that case as well. This patch refactors the old code and simply makes use of the addRegisterKilled function in MachineInstr.cpp in order to determine whether to set/remove kill on an instruction. Reviewers: apazos, t.p.northover, pete, MatzeB Subscribers: MatzeB, davide, llvm-commits Differential Revision: http://reviews.llvm.org/D17356 llvm-svn: 269092
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 6b46cb356c2..8e8af1b37b3 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1952,6 +1952,13 @@ bool MachineInstr::addRegisterKilled(unsigned IncomingReg,
MachineOperand &MO = getOperand(i);
if (!MO.isReg() || !MO.isUse() || MO.isUndef())
continue;
+
+ // DEBUG_VALUE nodes do not contribute to code generation and should
+ // always be ignored. Failure to do so may result in trying to modify
+ // KILL flags on DEBUG_VALUE nodes.
+ if (MO.isDebug())
+ continue;
+
unsigned Reg = MO.getReg();
if (!Reg)
continue;
OpenPOWER on IntegriCloud