mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-28 04:29:44 +00:00
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
This commit is contained in:
parent
14f41e7e18
commit
8c66df2c7a
@ -4207,10 +4207,6 @@ static MachineInstr* foldPatchpoint(MachineFunction &MF,
|
|||||||
!MI->getOperand(0).isImplicit();
|
!MI->getOperand(0).isImplicit();
|
||||||
unsigned StartIdx = hasDef ? 1 : 0;
|
unsigned StartIdx = hasDef ? 1 : 0;
|
||||||
|
|
||||||
MachineInstr *NewMI =
|
|
||||||
MF.CreateMachineInstr(TII.get(MI->getOpcode()), MI->getDebugLoc(), true);
|
|
||||||
MachineInstrBuilder MIB(MF, NewMI);
|
|
||||||
|
|
||||||
switch (MI->getOpcode()) {
|
switch (MI->getOpcode()) {
|
||||||
case TargetOpcode::STACKMAP:
|
case TargetOpcode::STACKMAP:
|
||||||
StartIdx += 2; // Skip ID, nShadowBytes.
|
StartIdx += 2; // Skip ID, nShadowBytes.
|
||||||
@ -4231,6 +4227,11 @@ static MachineInstr* foldPatchpoint(MachineFunction &MF,
|
|||||||
if (*I < StartIdx)
|
if (*I < StartIdx)
|
||||||
return 0;
|
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
|
// No need to fold return, the meta data, and function arguments
|
||||||
for (unsigned i = 0; i < StartIdx; ++i)
|
for (unsigned i = 0; i < StartIdx; ++i)
|
||||||
MIB.addOperand(MI->getOperand(i));
|
MIB.addOperand(MI->getOperand(i));
|
||||||
|
Loading…
Reference in New Issue
Block a user