From 4f56428de1bdca70d13a95fd951ccc1f7c7bde02 Mon Sep 17 00:00:00 2001 From: Jessica Paquette Date: Tue, 24 Apr 2018 22:38:15 +0000 Subject: [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 --- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Target') 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 -- cgit v1.2.3