summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-03-23 19:39:37 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-03-23 19:39:37 +0000
commit6f503b96fb75f271b5081d6535941ae96a19b112 (patch)
tree6c729740455a1422269c8ec8a7b9fa100204a4d0 /llvm/lib/Target
parentfaa9b438ceb84578d546575e6bb2fe5de1839fc4 (diff)
downloadbcm5719-llvm-6f503b96fb75f271b5081d6535941ae96a19b112.tar.gz
bcm5719-llvm-6f503b96fb75f271b5081d6535941ae96a19b112.zip
[Hexagon] Incorrectly removing dead flag and adding kill flag
The HexagonExpandCondsets pass is incorrectly removing the dead flag on a definition that is really dead, and adding a kill flag to a use that is tied to a definition. This causes an assert later during the machine scheduler when querying the live interval information. Patch by Brendon Cahoon. llvm-svn: 328357
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp b/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp
index c2feaf5737b..f46f6105c17 100644
--- a/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp
@@ -316,8 +316,10 @@ void HexagonExpandCondsets::updateKillFlags(unsigned Reg) {
auto KillAt = [this,Reg] (SlotIndex K, LaneBitmask LM) -> void {
// Set the <kill> flag on a use of Reg whose lane mask is contained in LM.
MachineInstr *MI = LIS->getInstructionFromIndex(K);
- for (auto &Op : MI->operands()) {
- if (!Op.isReg() || !Op.isUse() || Op.getReg() != Reg)
+ for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
+ MachineOperand &Op = MI->getOperand(i);
+ if (!Op.isReg() || !Op.isUse() || Op.getReg() != Reg ||
+ MI->isRegTiedToDefOperand(i))
continue;
LaneBitmask SLM = getLaneMask(Reg, Op.getSubReg());
if ((SLM & LM) == SLM) {
@@ -1324,7 +1326,6 @@ bool HexagonExpandCondsets::runOnMachineFunction(MachineFunction &MF) {
//===----------------------------------------------------------------------===//
// Public Constructor Functions
//===----------------------------------------------------------------------===//
-
FunctionPass *llvm::createHexagonExpandCondsets() {
return new HexagonExpandCondsets();
}
OpenPOWER on IntegriCloud