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 | 24e3954700852962b153a340a611961b6e403815 (patch) | |
| tree | bd2344e0905f83721cfdb145fd251f3bfa1bce79 /llvm/lib | |
| parent | 25bc7198b2f52eac431280ad85dbe91e766ceac1 (diff) | |
| download | bcm5719-llvm-24e3954700852962b153a340a611961b6e403815.tar.gz bcm5719-llvm-24e3954700852962b153a340a611961b6e403815.zip | |
During folding for patchpoint/stackmap instructions, defer creation of new MIs
until we know that folding will be successful.
No functional change.
llvm-svn: 194880
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 304d9226146..1a6d5ca829d 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/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)); |

