diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2015-04-30 23:14:14 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2015-04-30 23:14:14 +0000 |
| commit | 451755d370a14a507df79760b078087da7f60c9c (patch) | |
| tree | 0a928e0933708866d984499b027dbb0a59153518 /llvm/lib/CodeGen | |
| parent | d1ffdda41830d90d8bcc4e94f3688c78b558c6c8 (diff) | |
| download | bcm5719-llvm-451755d370a14a507df79760b078087da7f60c9c.tar.gz bcm5719-llvm-451755d370a14a507df79760b078087da7f60c9c.zip | |
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
llvm-svn: 236282
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/TargetInstrInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp index 165df0696ef..8f1553b13a9 100644 --- a/llvm/lib/CodeGen/TargetInstrInfo.cpp +++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp @@ -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; } |

