Skip to content

Commit 3cbc21b

Browse files
committed
Address review comments
1 parent 4671915 commit 3cbc21b

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4568,23 +4568,6 @@ getFalkorUnrollingPreferences(Loop *L, ScalarEvolution &SE,
45684568
}
45694569
}
45704570

4571-
static bool shouldUnrollLoopWithInstruction(Instruction &I,
4572-
AArch64TTIImpl &TTI) {
4573-
// Don't unroll vectorised loop.
4574-
if (I.getType()->isVectorTy())
4575-
return false;
4576-
4577-
if (isa<CallBase>(I)) {
4578-
if (isa<CallInst>(I) || isa<InvokeInst>(I))
4579-
if (const Function *F = cast<CallBase>(I).getCalledFunction())
4580-
if (!TTI.isLoweredToCall(F))
4581-
return true;
4582-
return false;
4583-
}
4584-
4585-
return true;
4586-
}
4587-
45884571
// This function returns true if the loop:
45894572
// 1. Has a valid cost, and
45904573
// 2. Has a cost within the supplied budget.
@@ -4791,8 +4774,17 @@ void AArch64TTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
47914774
// unrolling.
47924775
for (auto *BB : L->getBlocks()) {
47934776
for (auto &I : *BB) {
4794-
if (!shouldUnrollLoopWithInstruction(I, *this))
4777+
// Don't unroll vectorised loop.
4778+
if (I.getType()->isVectorTy())
47954779
return;
4780+
4781+
if (isa<CallBase>(I)) {
4782+
if (isa<CallInst>(I) || isa<InvokeInst>(I))
4783+
if (const Function *F = cast<CallBase>(I).getCalledFunction())
4784+
if (!isLoweredToCall(F))
4785+
continue;
4786+
return;
4787+
}
47964788
}
47974789
}
47984790

0 commit comments

Comments
 (0)