summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-04-24 22:38:15 +0000
committerJessica Paquette <jpaquette@apple.com>2018-04-24 22:38:15 +0000
commit4f56428de1bdca70d13a95fd951ccc1f7c7bde02 (patch)
tree4ee203ed7d6eed2f48d14ca8b7605262c454e893 /llvm/lib/Target
parentf3cefad255e9ff56bead504ed787379d735760fc (diff)
downloadbcm5719-llvm-4f56428de1bdca70d13a95fd951ccc1f7c7bde02.tar.gz
bcm5719-llvm-4f56428de1bdca70d13a95fd951ccc1f7c7bde02.zip
[MachineOutliner] Check for explicit uses of LR/W30 in MI operands
Before, the outliner would grab ADRPs that used LR/W30. This patch fixes that by checking for explicit uses of those registers before the special-casing for ADRPs. This also adds a test that ensures that those sorts of ADRPs won't be outlined. llvm-svn: 330783
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index 5732dbe7b01..6de4bb2143d 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -5061,6 +5061,11 @@ AArch64InstrInfo::getOutliningType(MachineBasicBlock::iterator &MIT,
if (MOP.isCPI() || MOP.isJTI() || MOP.isCFIIndex() || MOP.isFI() ||
MOP.isTargetIndex())
return MachineOutlinerInstrType::Illegal;
+
+ // If it uses LR or W30 explicitly, then don't touch it.
+ if (MOP.isReg() && !MOP.isImplicit() &&
+ (MOP.getReg() == AArch64::LR || MOP.getReg() == AArch64::W30))
+ return MachineOutlinerInstrType::Illegal;
}
// Special cases for instructions that can always be outlined, but will fail
OpenPOWER on IntegriCloud