aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2024-10-17 16:20:43 +0100
committerGitHub <noreply@github.com>2024-10-17 16:20:43 +0100
commit85c17e40926132575d1b98ca1a36b8394fe511cd (patch)
tree58d38f4833043d35f09edfcc412b278cfd5ad56a /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
parent8c7f80f77505b7ff275d67a49f4f2dd07d604403 (diff)
downloadllvm-85c17e40926132575d1b98ca1a36b8394fe511cd.zip
llvm-85c17e40926132575d1b98ca1a36b8394fe511cd.tar.gz
llvm-85c17e40926132575d1b98ca1a36b8394fe511cd.tar.bz2
[LLVM] Make more use of IRBuilder::CreateIntrinsic. NFC. (#112706)
Convert many instances of: Fn = Intrinsic::getOrInsertDeclaration(...); CreateCall(Fn, ...) to the equivalent CreateIntrinsic call.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
index bc619e5..c412d03 100644
--- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
@@ -2139,10 +2139,9 @@ Value *SCEVExpander::generateOverflowCheck(const SCEVAddRecExpr *AR,
MulV = TruncTripCount;
OfMul = ConstantInt::getFalse(MulV->getContext());
} else {
- auto *MulF = Intrinsic::getOrInsertDeclaration(
- Loc->getModule(), Intrinsic::umul_with_overflow, Ty);
- CallInst *Mul =
- Builder.CreateCall(MulF, {AbsStep, TruncTripCount}, "mul");
+ CallInst *Mul = Builder.CreateIntrinsic(Intrinsic::umul_with_overflow, Ty,
+ {AbsStep, TruncTripCount},
+ /*FMFSource=*/nullptr, "mul");
MulV = Builder.CreateExtractValue(Mul, 0, "mul.result");
OfMul = Builder.CreateExtractValue(Mul, 1, "mul.overflow");
}