summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-01-10 18:49:57 +0000
committerJessica Paquette <jpaquette@apple.com>2018-01-10 18:49:57 +0000
commitc191f1097c52b7b89120dd33d5d3a687e195d633 (patch)
tree08539ffd8e72fe17d0ef98af5f3965f0295fb267 /llvm/lib
parentd04026ea432578a390e11585a4cc94db4bad8af5 (diff)
downloadbcm5719-llvm-c191f1097c52b7b89120dd33d5d3a687e195d633.tar.gz
bcm5719-llvm-c191f1097c52b7b89120dd33d5d3a687e195d633.zip
[MachineOutliner] Outline ADRPs
ADRP instructions weren't being outlined because they're PC-relative and thus fail the LR checks. This patch adds a special case for ADRPs to getOutliningType to make sure that ADRPs can be outlined and updates the MIR test. llvm-svn: 322207
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index ef0a785abfc..8be6b24a92e 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -4841,6 +4841,12 @@ AArch64InstrInfo::getOutliningType(MachineBasicBlock::iterator &MIT,
return MachineOutlinerInstrType::Illegal;
}
+ // Special cases for instructions that can always be outlined, but will fail
+ // the later tests. e.g, ADRPs, which are PC-relative use LR, but can always
+ // be outlined because they don't require a *specific* value to be in LR.
+ if (MI.getOpcode() == AArch64::ADRP)
+ return MachineOutlinerInstrType::Legal;
+
// Outline calls without stack parameters or aggregate parameters.
if (MI.isCall()) {
const Module *M = MF->getFunction().getParent();
OpenPOWER on IntegriCloud