parent
724a68f372
commit
0d05177337
|
@ -2601,7 +2601,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) {
|
||||||
// unconditionally. We denote all involved instructions except the condition
|
// unconditionally. We denote all involved instructions except the condition
|
||||||
// as "bonus instructions", and only allow this transformation when the
|
// as "bonus instructions", and only allow this transformation when the
|
||||||
// number of the bonus instructions we'll need to create when cloning into
|
// number of the bonus instructions we'll need to create when cloning into
|
||||||
// each predecessor does not exceed a certain threshold.
|
// each predecessor does not exceed a certain threshold.
|
||||||
unsigned NumBonusInsts = 0;
|
unsigned NumBonusInsts = 0;
|
||||||
for (auto I = BB->begin(); Cond != &*I; ++I) {
|
for (auto I = BB->begin(); Cond != &*I; ++I) {
|
||||||
// Ignore dbg intrinsics.
|
// Ignore dbg intrinsics.
|
||||||
|
@ -2618,7 +2618,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) {
|
||||||
// and Cond.
|
// and Cond.
|
||||||
|
|
||||||
// Account for the cost of duplicating this instruction into each
|
// Account for the cost of duplicating this instruction into each
|
||||||
// predecessor.
|
// predecessor.
|
||||||
NumBonusInsts += PredCount;
|
NumBonusInsts += PredCount;
|
||||||
// Early exits once we reach the limit.
|
// Early exits once we reach the limit.
|
||||||
if (NumBonusInsts > BonusInstThreshold)
|
if (NumBonusInsts > BonusInstThreshold)
|
||||||
|
|
Loading…
Reference in New Issue