diff options
author | Lang Hames <lhames@gmail.com> | 2013-11-15 23:13:21 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2013-11-15 23:13:21 +0000 |
commit | 8c66df2c7a0e6309eb26d83741f3e121fd3b8550 (patch) | |
tree | 843fbad50956e470f1adc0fe881232270dcd361c | |
parent | 14f41e7e1811b0c504c82865bd6828acfee82527 (diff) | |
download | external_llvm-8c66df2c7a0e6309eb26d83741f3e121fd3b8550.zip external_llvm-8c66df2c7a0e6309eb26d83741f3e121fd3b8550.tar.gz external_llvm-8c66df2c7a0e6309eb26d83741f3e121fd3b8550.tar.bz2 |
During folding for patchpoint/stackmap instructions, defer creation of new MIs
until we know that folding will be successful.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194880 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index 304d922..1a6d5ca 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -4207,10 +4207,6 @@ static MachineInstr* foldPatchpoint(MachineFunction &MF, !MI->getOperand(0).isImplicit(); unsigned StartIdx = hasDef ? 1 : 0; - MachineInstr *NewMI = - MF.CreateMachineInstr(TII.get(MI->getOpcode()), MI->getDebugLoc(), true); - MachineInstrBuilder MIB(MF, NewMI); - switch (MI->getOpcode()) { case TargetOpcode::STACKMAP: StartIdx += 2; // Skip ID, nShadowBytes. @@ -4231,6 +4227,11 @@ static MachineInstr* foldPatchpoint(MachineFunction &MF, if (*I < StartIdx) return 0; } + + MachineInstr *NewMI = + MF.CreateMachineInstr(TII.get(MI->getOpcode()), MI->getDebugLoc(), true); + MachineInstrBuilder MIB(MF, NewMI); + // No need to fold return, the meta data, and function arguments for (unsigned i = 0; i < StartIdx; ++i) MIB.addOperand(MI->getOperand(i)); |