diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-22 17:23:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-22 17:23:57 +0000 |
commit | 540e5f92b4950d0ad7fa38b39970e44e335d6508 (patch) | |
tree | cd9d00a114dbc4fb19194b65c06f63c92c21c9f7 /llvm/lib/Transforms | |
parent | 79e87e39eb498803fc05c9540f7b69ffade412bf (diff) | |
download | bcm5719-llvm-540e5f92b4950d0ad7fa38b39970e44e335d6508.tar.gz bcm5719-llvm-540e5f92b4950d0ad7fa38b39970e44e335d6508.zip |
Do not count debugger intrinsics in size estimation.
llvm-svn: 18110
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/TailDuplication.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp index 545068b6dfb..0a05d0f9e72 100644 --- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp +++ b/llvm/lib/Transforms/Scalar/TailDuplication.cpp @@ -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 @@ bool TailDup::shouldEliminateUnconditionalBranch(TerminatorInst *TI) { 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 |