[llvm-commits] [llvm] r61752 - in /llvm/trunk: lib/Transforms/Scalar/CodeGenPrepare.cpp test/CodeGen/X86/remat-mov0.ll
Evan Cheng
evan.cheng at apple.com
Mon Jan 5 13:17:27 PST 2009
Author: evancheng
Date: Mon Jan 5 15:17:27 2009
New Revision: 61752
URL: http://llvm.org/viewvc/llvm-project?rev=61752&view=rev
Log:
Find loop back edges only after empty blocks are eliminated.
Modified:
llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
llvm/trunk/test/CodeGen/X86/remat-mov0.ll
Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=61752&r1=61751&r2=61752&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Mon Jan 5 15:17:27 2009
@@ -125,12 +125,13 @@
bool CodeGenPrepare::runOnFunction(Function &F) {
bool EverMadeChange = false;
- findLoopBackEdges(F);
-
// First pass, eliminate blocks that contain only PHI nodes and an
// unconditional branch.
EverMadeChange |= EliminateMostlyEmptyBlocks(F);
+ // Now find loop back edges.
+ findLoopBackEdges(F);
+
bool MadeChange = true;
while (MadeChange) {
MadeChange = false;
Modified: llvm/trunk/test/CodeGen/X86/remat-mov0.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/remat-mov0.ll?rev=61752&r1=61751&r2=61752&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/remat-mov0.ll (original)
+++ llvm/trunk/test/CodeGen/X86/remat-mov0.ll Mon Jan 5 15:17:27 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 | grep xor | count 1
+; RUN: llvm-as < %s | llc -march=x86 | grep xor | count 2
%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
%struct.ImgT = type { i8, i8*, i8*, %struct.FILE*, i32, i32, i32, i32, i8*, double*, float*, float*, float*, i32*, double, double, i32*, double*, i32*, i32* }
More information about the llvm-commits
mailing list