summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-04-30 19:38:47 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-04-30 19:38:47 +0000
commit1cf329c9339d460bce6e76632f0265c5003dde42 (patch)
tree5e9e73492f6728ebf0715958548041404f75c272 /llvm/lib
parent6c0665e22174d474050e85ca367424f6e02476be (diff)
downloadbcm5719-llvm-1cf329c9339d460bce6e76632f0265c5003dde42.tar.gz
bcm5719-llvm-1cf329c9339d460bce6e76632f0265c5003dde42.zip
[LivePhysRegs] Remove registers clobbered by regmasks from the live set
Dead defs were being removed from the live set (in stepForward), but registers clobbered by regmasks weren't (more specifically, they were actually removed by removeRegsInMask, but then they were added back in). llvm-svn: 331219
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LivePhysRegs.cpp6
-rw-r--r--llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp5
2 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LivePhysRegs.cpp b/llvm/lib/CodeGen/LivePhysRegs.cpp
index 9c637cf0ed5..b0cc62d5099 100644
--- a/llvm/lib/CodeGen/LivePhysRegs.cpp
+++ b/llvm/lib/CodeGen/LivePhysRegs.cpp
@@ -106,9 +106,13 @@ void LivePhysRegs::stepForward(const MachineInstr &MI,
// Add defs to the set.
for (auto Reg : Clobbers) {
- // Skip dead defs. They shouldn't be added to the set.
+ // Skip dead defs and registers clobbered by regmasks. They shouldn't
+ // be added to the set.
if (Reg.second->isReg() && Reg.second->isDead())
continue;
+ if (Reg.second->isRegMask() &&
+ MachineOperand::clobbersPhysReg(Reg.second->getRegMask(), Reg.first))
+ continue;
addReg(Reg.first);
}
}
diff --git a/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp b/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
index f2f4598ba09..4b3e11ed3fd 100644
--- a/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
@@ -1706,11 +1706,6 @@ bool HexagonFrameLowering::expandStoreVec2(MachineBasicBlock &B,
for (auto R = B.begin(); R != It; ++R) {
Clobbers.clear();
LPR.stepForward(*R, Clobbers);
- // Dead defs are recorded in Clobbers, but are not automatically removed
- // from the live set.
- for (auto &C : Clobbers)
- if (C.second->isReg() && C.second->isDead())
- LPR.removeReg(C.first);
}
DebugLoc DL = MI->getDebugLoc();
OpenPOWER on IntegriCloud