[llvm-commits] [llvm] r66717 - /llvm/branches/Apple/Dib/lib/Transforms/Scalar/LoopRotation.cpp
Bill Wendling
isanbard at gmail.com
Wed Mar 11 15:23:52 PDT 2009
Author: void
Date: Wed Mar 11 17:23:51 2009
New Revision: 66717
URL: http://llvm.org/viewvc/llvm-project?rev=66717&view=rev
Log:
--- Merging (from foreign repository) r66244 into '.':
A test/Transforms/GVN/2009-03-05-dbg.ll
--- Merging (from foreign repository) r66245 into '.':
U lib/Transforms/Scalar/LoopRotation.cpp
--- Merging (from foreign repository) r66490 into '.':
A test/Transforms/GlobalOpt/ctor-list-opt-dbg.ll
Modified:
llvm/branches/Apple/Dib/lib/Transforms/Scalar/LoopRotation.cpp
Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/LoopRotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Transforms/Scalar/LoopRotation.cpp?rev=66717&r1=66716&r2=66717&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Transforms/Scalar/LoopRotation.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Transforms/Scalar/LoopRotation.cpp Wed Mar 11 17:23:51 2009
@@ -14,7 +14,7 @@
#define DEBUG_TYPE "loop-rotate"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Function.h"
-#include "llvm/Instructions.h"
+#include "llvm/IntrinsicInst.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/Dominators.h"
@@ -161,7 +161,19 @@
// Check size of original header and reject
// loop if it is very big.
- if (OrigHeader->size() > MAX_HEADER_SIZE)
+ unsigned Size = 0;
+
+ // FIXME: Use common api to estimate size.
+ for (BasicBlock::const_iterator OI = OrigHeader->begin(),
+ OE = OrigHeader->end(); OI != OE; ++OI) {
+ if (isa<PHINode>(OI))
+ continue; // PHI nodes don't count.
+ if (isa<DbgInfoIntrinsic>(OI))
+ continue; // Debug intrinsics don't count as size.
+ Size++;
+ }
+
+ if (Size > MAX_HEADER_SIZE)
return false;
// Now, this loop is suitable for rotation.
More information about the llvm-commits
mailing list