summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-12-16 23:55:43 +0000
committerMatthias Braun <matze@braunis.de>2016-12-16 23:55:43 +0000
commit76bb4139dc67e205f139f536c10fd98582367f83 (patch)
tree62d0543f7d8ce2164321276ae81ec850de50efe2 /llvm/lib
parent181983055f7a543a83ad424bc24b3962af50274a (diff)
downloadbcm5719-llvm-76bb4139dc67e205f139f536c10fd98582367f83.tar.gz
bcm5719-llvm-76bb4139dc67e205f139f536c10fd98582367f83.zip
AArch64: Enable post-ra liveness updates
Differential Revision: https://reviews.llvm.org/D27559 llvm-svn: 290014
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp7
-rw-r--r--llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp3
-rw-r--r--llvm/lib/Target/AArch64/AArch64RegisterInfo.h4
3 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp b/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
index 94b208a8e7d..fe1c0beee0e 100644
--- a/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
@@ -897,9 +897,14 @@ bool AArch64ExpandPseudo::expandMI(MachineBasicBlock &MBB,
case AArch64::MOVi64imm:
return expandMOVImm(MBB, MBBI, 64);
case AArch64::RET_ReallyLR: {
+ // Hiding the LR use with RET_ReallyLR may lead to extra kills in the
+ // function and missing live-ins. We are fine in practice because callee
+ // saved register handling ensures the register value is restored before
+ // RET, but we need the undef flag here to appease the MachineVerifier
+ // liveness checks.
MachineInstrBuilder MIB =
BuildMI(MBB, MBBI, MI.getDebugLoc(), TII->get(AArch64::RET))
- .addReg(AArch64::LR);
+ .addReg(AArch64::LR, RegState::Undef);
transferImpOps(MI, MIB, MIB);
MI.eraseFromParent();
return true;
diff --git a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
index 6e157638184..dcb05601e5f 100644
--- a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
@@ -767,6 +767,7 @@ AArch64LoadStoreOpt::promoteLoadFromStore(MachineBasicBlock::iterator LoadI,
// Remove the load, if the destination register of the loads is the same
// register for stored value.
if (StRt == LdRt && LoadSize == 8) {
+ StoreI->clearRegisterKills(StRt, TRI);
DEBUG(dbgs() << "Remove load instruction:\n ");
DEBUG(LoadI->print(dbgs()));
DEBUG(dbgs() << "\n");
@@ -831,6 +832,8 @@ AArch64LoadStoreOpt::promoteLoadFromStore(MachineBasicBlock::iterator LoadI,
.addImm(Imms);
}
}
+ StoreI->clearRegisterKills(StRt, TRI);
+
(void)BitExtMI;
DEBUG(dbgs() << "Promoting load by replacing :\n ");
diff --git a/llvm/lib/Target/AArch64/AArch64RegisterInfo.h b/llvm/lib/Target/AArch64/AArch64RegisterInfo.h
index 098657fe883..8ce893516fe 100644
--- a/llvm/lib/Target/AArch64/AArch64RegisterInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64RegisterInfo.h
@@ -95,6 +95,10 @@ public:
unsigned getRegPressureLimit(const TargetRegisterClass *RC,
MachineFunction &MF) const override;
+
+ bool trackLivenessAfterRegAlloc(const MachineFunction&) const override {
+ return true;
+ }
};
} // end namespace llvm
OpenPOWER on IntegriCloud