mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Commute the internal flag on MachineOperands.
When commuting a thumb instruction in the size reduction pass, thumb instructions are represented as a bundle and so some operands may be marked as internal. The internal flag has to move with the operand when commuting. This test is sensitive to register allocation so can't specifically check that this error was happening, but so long as it continues to pass with -verify then hopefully its still ok. rdar://problem/20752113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236282 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -144,6 +144,8 @@ MachineInstr *TargetInstrInfo::commuteInstruction(MachineInstr *MI,
|
||||
bool Reg2IsKill = MI->getOperand(Idx2).isKill();
|
||||
bool Reg1IsUndef = MI->getOperand(Idx1).isUndef();
|
||||
bool Reg2IsUndef = MI->getOperand(Idx2).isUndef();
|
||||
bool Reg1IsInternal = MI->getOperand(Idx1).isInternalRead();
|
||||
bool Reg2IsInternal = MI->getOperand(Idx2).isInternalRead();
|
||||
// If destination is tied to either of the commuted source register, then
|
||||
// it must be updated.
|
||||
if (HasDef && Reg0 == Reg1 &&
|
||||
@ -176,6 +178,8 @@ MachineInstr *TargetInstrInfo::commuteInstruction(MachineInstr *MI,
|
||||
MI->getOperand(Idx1).setIsKill(Reg2IsKill);
|
||||
MI->getOperand(Idx2).setIsUndef(Reg1IsUndef);
|
||||
MI->getOperand(Idx1).setIsUndef(Reg2IsUndef);
|
||||
MI->getOperand(Idx2).setIsInternalRead(Reg1IsInternal);
|
||||
MI->getOperand(Idx1).setIsInternalRead(Reg2IsInternal);
|
||||
return MI;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user