[llvm-commits] CVS: llvm/lib/Transforms/Scalar/TailDuplication.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Nov 22 09:24:10 PST 2004
Changes in directory llvm/lib/Transforms/Scalar:
TailDuplication.cpp updated: 1.26 -> 1.27
---
Log message:
Do not count debugger intrinsics in size estimation.
---
Diffs of the changes: (+6 -2)
Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp
diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.26 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.27
--- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.26 Mon Nov 1 01:05:07 2004
+++ llvm/lib/Transforms/Scalar/TailDuplication.cpp Mon Nov 22 11:23:57 2004
@@ -22,6 +22,7 @@
#include "llvm/Constant.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
+#include "llvm/IntrinsicInst.h"
#include "llvm/Pass.h"
#include "llvm/Type.h"
#include "llvm/Support/CFG.h"
@@ -107,8 +108,11 @@
BasicBlock::iterator I = Dest->begin();
while (isa<PHINode>(*I)) ++I;
- for (unsigned Size = 0; I != Dest->end(); ++Size, ++I)
- if (Size == Threshold) return false; // The block is too large...
+ for (unsigned Size = 0; I != Dest->end(); ++I) {
+ if (Size == Threshold) return false; // The block is too large.
+ // Only count instructions that are not debugger intrinsics.
+ if (!isa<DbgInfoIntrinsic>(I)) ++Size;
+ }
// Do not tail duplicate a block that has thousands of successors into a block
// with a single successor if the block has many other predecessors. This can
More information about the llvm-commits
mailing list