[llvm-commits] [llvm] r45791 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Owen Anderson
resistor at mac.com
Wed Jan 9 16:01:41 PST 2008
Author: resistor
Date: Wed Jan 9 18:01:41 2008
New Revision: 45791
URL: http://llvm.org/viewvc/llvm-project?rev=45791&view=rev
Log:
Copies need to be inserted before the first terminator, not at the end of the block.
Modified:
llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=45791&r1=45790&r2=45791&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Wed Jan 9 18:01:41 2008
@@ -613,7 +613,7 @@
}
// Insert copy from map[curr.first] to curr.second
- TII->copyRegToReg(*MBB, MBB->end(), curr.second,
+ TII->copyRegToReg(*MBB, MBB->getFirstTerminator(), curr.second,
map[curr.first], RC, RC);
map[curr.first] = curr.second;
@@ -642,7 +642,7 @@
// Insert a copy from dest to a new temporary t at the end of b
unsigned t = MF->getRegInfo().createVirtualRegister(RC);
- TII->copyRegToReg(*MBB, MBB->end(), t,
+ TII->copyRegToReg(*MBB, MBB->getFirstTerminator(), t,
curr.second, RC, RC);
map[curr.second] = t;
More information about the llvm-commits
mailing list