[llvm] [Analysis][NFC] Address review comments from PR #213013 (PR #225800)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 07:52:11 PDT 2026
https://github.com/david-arm created https://github.com/llvm/llvm-project/pull/225800
None
>From 9f894eaa8dcfa9d887c69cb5d579754a2fe3ca6b Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Wed, 23 Sep 2026 14:48:51 +0000
Subject: [PATCH] [Analysis][NFC] Address comments from PR #213013
---
llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h | 3 +++
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h b/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
index 4470de17518db..48bdd0c5a1e00 100644
--- a/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
+++ b/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
@@ -79,6 +79,9 @@ class SCEVExpander : public SCEVUseVisitor<SCEVExpander, Value *> {
InsertedExpressions;
// InsertedOverflowChecks caches Values for reuse, so must track RAUW.
+ // The key is a tuple containing the trip count for the loop, the absolute
+ // value of the recurrence step, and the insert point. The stored pair values
+ // are the multiply result and a boolean value indicating overflow.
DenseMap<std::tuple<Value *, Value *, Instruction *>,
std::pair<TrackingVH<Value>, TrackingVH<Value>>>
InsertedOverflowChecks;
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
index 87109a5d9ffb1..7ce2542551fff 100644
--- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
@@ -2371,7 +2371,7 @@ Value *SCEVExpander::generateOverflowCheck(const SCEVAddRecExpr *AR,
OfMul = Builder.CreateExtractValue(Mul, 1, "mul.overflow");
// The type Ty is already encoded in AbsStep.
- InsertedOverflowChecks[Key] = std::pair<Value *, Value *>(MulV, OfMul);
+ InsertedOverflowChecks[Key] = {MulV, OfMul};
}
Value *Add = nullptr, *Sub = nullptr;
More information about the llvm-commits
mailing list