diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-12-08 08:02:34 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-12-08 08:02:34 +0000 |
commit | bb4e6d4d1204b1cd2f6e99863ffa7a657a575148 (patch) | |
tree | 428d5c249a749b15c392e49e85268f2e99452628 /llvm/lib/CodeGen/VirtRegMap.cpp | |
parent | 4539418a7b5329beee7d962bdd6170050106bc35 (diff) | |
download | bcm5719-llvm-bb4e6d4d1204b1cd2f6e99863ffa7a657a575148.tar.gz bcm5719-llvm-bb4e6d4d1204b1cd2f6e99863ffa7a657a575148.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegMap.cpp')
-rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index 8184075113d..83543dc29da 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -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 { |