OSDN Git Service

[MachineOutliner] Add RegState::Define to LDRXpost in insertOutlinedCall
authorJessica Paquette <jpaquette@apple.com>
Thu, 10 Aug 2017 23:11:24 +0000 (23:11 +0000)
committerJessica Paquette <jpaquette@apple.com>
Thu, 10 Aug 2017 23:11:24 +0000 (23:11 +0000)
This fixes a MachineVerifier failure in machine-outliner.mir. Not explicitly
adding RegState::Define to the LR argument makes it unhappy because an explicit
definition is marked as a use.

Build failure:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/7496/testReport/junit/LLVM/CodeGen_AArch64/machine_outliner_mir/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310671 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AArch64/AArch64InstrInfo.cpp

index 4a68dff..e5324c6 100644 (file)
@@ -4626,7 +4626,7 @@ MachineBasicBlock::iterator AArch64InstrInfo::insertOutlinedCall(
   // Restore the link register.
   MachineInstr *LDRXpost = BuildMI(MF, DebugLoc(), get(AArch64::LDRXpost))
                                .addReg(AArch64::SP, RegState::Define)
-                               .addReg(AArch64::LR)
+                               .addReg(AArch64::LR, RegState::Define)
                                .addReg(AArch64::SP)
                                .addImm(16);
   It = MBB.insert(It, LDRXpost);