mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-26 22:34:39 +00:00
Proper fix for PR1037: to determine is a VR is a modref, check 1) whether it is
tied to another oeprand, 2) whether is is being tied to by another operand. So the destination operand of a two-address MI can be correctly identified. llvm-svn: 32354
This commit is contained in:
parent
79bcfb0e11
commit
6f02378443
@ -97,7 +97,9 @@ void VirtRegMap::virtFolded(unsigned VirtReg, MachineInstr *OldMI,
|
||||
}
|
||||
|
||||
ModRef MRInfo;
|
||||
if (TII.getOperandConstraint(OldMI->getOpcode(), OpNo, TOI::TIED_TO)) {
|
||||
const TargetInstrDescriptor *TID = OldMI->getInstrDescriptor();
|
||||
if (TID->getOperandConstraint(OpNo, TOI::TIED_TO) != -1 ||
|
||||
TII.findTiedToSrcOperand(TID, OpNo) != -1) {
|
||||
// Folded a two-address operand.
|
||||
MRInfo = isModRef;
|
||||
} else if (OldMI->getOperand(OpNo).isDef()) {
|
||||
@ -849,7 +851,7 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) {
|
||||
// If this def is part of a two-address operand, make sure to execute
|
||||
// the store from the correct physical register.
|
||||
unsigned PhysReg;
|
||||
int TiedOp = TII->findTiedToSrcOperand(MI.getOpcode(), i);
|
||||
int TiedOp = TII->findTiedToSrcOperand(MI.getInstrDescriptor(), i);
|
||||
if (TiedOp != -1)
|
||||
PhysReg = MI.getOperand(TiedOp).getReg();
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user