mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Do not count debugger intrinsics in size estimation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18110 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8db93f18cc
commit
b9df9b4c88
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user