summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/VirtRegRewriter.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-02 22:47:25 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-02 22:47:25 +0000
commita8ad97743d6cd999833da0abc1ac1b6fd2a13fcf (patch)
tree1427dc0f9bd05953a05fa5dc3470de7b523ed4f8 /llvm/lib/CodeGen/VirtRegRewriter.cpp
parent9cb0274182e4f52ffeb586252627e5b6899fe837 (diff)
downloadbcm5719-llvm-a8ad97743d6cd999833da0abc1ac1b6fd2a13fcf.tar.gz
bcm5719-llvm-a8ad97743d6cd999833da0abc1ac1b6fd2a13fcf.zip
Slightly change the meaning of the reMaterialize target hook when the original
instruction defines subregisters. Any existing subreg indices on the original instruction are preserved or composed with the new subreg index. Also substitute multiple operands mentioning the original register by using the new MachineInstr::substituteRegister() function. This is necessary because there will soon be <imp-def> operands added to non read-modify-write partial definitions. This instruction: %reg1234:foo = FLAP %reg1234<imp-def> will reMaterialize(%reg3333, bar) like this: %reg3333:bar-foo = FLAP %reg333:bar<imp-def> Finally, replace the TargetRegisterInfo pointer argument with a reference to indicate that it cannot be NULL. llvm-svn: 105358
Diffstat (limited to 'llvm/lib/CodeGen/VirtRegRewriter.cpp')
-rw-r--r--llvm/lib/CodeGen/VirtRegRewriter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/VirtRegRewriter.cpp b/llvm/lib/CodeGen/VirtRegRewriter.cpp
index 871d83628ac..361d35e8a89 100644
--- a/llvm/lib/CodeGen/VirtRegRewriter.cpp
+++ b/llvm/lib/CodeGen/VirtRegRewriter.cpp
@@ -667,8 +667,7 @@ static void ReMaterialize(MachineBasicBlock &MBB,
assert(TID.getNumDefs() == 1 &&
"Don't know how to remat instructions that define > 1 values!");
#endif
- TII->reMaterialize(MBB, MII, DestReg,
- ReMatDefMI->getOperand(0).getSubReg(), ReMatDefMI, TRI);
+ TII->reMaterialize(MBB, MII, DestReg, 0, ReMatDefMI, *TRI);
MachineInstr *NewMI = prior(MII);
for (unsigned i = 0, e = NewMI->getNumOperands(); i != e; ++i) {
MachineOperand &MO = NewMI->getOperand(i);
OpenPOWER on IntegriCloud