aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-03-13 07:56:58 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-03-13 07:56:58 +0000
commit0099ae2468c6c7c1e73f4df539d6e3e1ccdfafaa (patch)
treea2610f0e419f953c8ca018ba67918fe0a54f96c2 /lib/CodeGen
parentd99464d647e188ef5cb5abb07a6136ee88b3636c (diff)
downloadexternal_llvm-0099ae2468c6c7c1e73f4df539d6e3e1ccdfafaa.zip
external_llvm-0099ae2468c6c7c1e73f4df539d6e3e1ccdfafaa.tar.gz
external_llvm-0099ae2468c6c7c1e73f4df539d6e3e1ccdfafaa.tar.bz2
Don't try to sink 3-address instruction if convertToThreeAddress created more than one instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index 7380327..30727a6 100644
--- a/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -291,7 +291,12 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
if (MachineInstr *New=TII->convertToThreeAddress(mbbi, mi, *LV)) {
DOUT << "2addr: CONVERTING 2-ADDR: " << *mi;
DOUT << "2addr: TO 3-ADDR: " << *New;
- bool Sunk = Sink3AddrInstruction(mbbi, New, regB, mi);
+ bool Sunk = false;
+ if (New->findRegisterUseOperand(regB, New, TRI))
+ // FIXME: Temporary workaround. If the new instruction doesn't
+ // uses regB, convertToThreeAddress must have created more
+ // then one instruction.
+ Sunk = Sink3AddrInstruction(mbbi, New, regB, mi);
mbbi->erase(mi); // Nuke the old inst.
if (!Sunk) mi = New;
++NumConvertedTo3Addr;