diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2010-06-07 23:48:46 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2010-06-07 23:48:46 +0000 |
| commit | 7149cfcda313f14048cc1931586f691905960d59 (patch) | |
| tree | 32bf5952699295d557001c397a73ecb562b40c66 /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | |
| parent | 24e52992c030a7dd30455bea773b3b402c37df37 (diff) | |
| download | bcm5719-llvm-7149cfcda313f14048cc1931586f691905960d59.tar.gz bcm5719-llvm-7149cfcda313f14048cc1931586f691905960d59.zip | |
Fix a mistake in my previous change r105437: don't access operand 2 and assume
that it is an immediate before checking that the instruction is an
EXTRACT_SUBREG.
llvm-svn: 105585
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index 14c05feec39..16588bf3a7a 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -1178,17 +1178,16 @@ TwoAddressInstructionPass::CoalesceExtSubRegs(SmallVector<unsigned,4> &Srcs, UI = MRI->use_nodbg_begin(SrcReg), UE = MRI->use_nodbg_end(); UI != UE; ++UI) { MachineInstr *UseMI = &*UI; - unsigned SubRegIdx = UseMI->getOperand(2).getImm(); // FIXME: For now require that the destination subregs match the subregs // being extracted. if (!UseMI->isExtractSubreg() || UseMI->getOperand(0).getReg() != DstReg || - UseMI->getOperand(0).getSubReg() != SubRegIdx || + UseMI->getOperand(0).getSubReg() != UseMI->getOperand(2).getImm() || UseMI->getOperand(1).getSubReg() != 0) { CanCoalesce = false; break; } - SubIndices.push_back(SubRegIdx); + SubIndices.push_back(UseMI->getOperand(2).getImm()); } if (!CanCoalesce || SubIndices.size() < 2) |

