aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-02-25 09:30:28 +0100
committerNikita Popov <npopov@redhat.com>2022-02-25 09:32:22 +0100
commit2d0fc3e46ff386a05fa388874b8456bf61c4ce7a (patch)
tree6b36386797246f02b173910e50feda22beed9b41 /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
parent51fdd802c794faf6e5b57cccd6ea181c7f8a83e9 (diff)
downloadllvm-2d0fc3e46ff386a05fa388874b8456bf61c4ce7a.zip
llvm-2d0fc3e46ff386a05fa388874b8456bf61c4ce7a.tar.gz
llvm-2d0fc3e46ff386a05fa388874b8456bf61c4ce7a.tar.bz2
[SCEV] Return ArrayRef from getSCEVValues() (NFC)
Return a read-only view on this set. For the one internal use, directly access ExprValueMap.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
index 00c5b50..327d15d 100644
--- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
@@ -1872,17 +1872,17 @@ Value *SCEVExpander::expandCodeForImpl(const SCEV *SH, Type *Ty, bool Root) {
Value *SCEVExpander::FindValueInExprValueMap(const SCEV *S,
const Instruction *InsertPt) {
- auto *Set = SE.getSCEVValues(S);
+ ArrayRef<Value *> Set = SE.getSCEVValues(S);
// If the expansion is not in CanonicalMode, and the SCEV contains any
// sub scAddRecExpr type SCEV, it is required to expand the SCEV literally.
if (CanonicalMode || !SE.containsAddRecurrence(S)) {
// If S is scConstant, it may be worse to reuse an existing Value.
- if (S->getSCEVType() != scConstant && Set) {
+ if (S->getSCEVType() != scConstant) {
// Choose a Value from the set which dominates the InsertPt.
// InsertPt should be inside the Value's parent loop so as not to break
// the LCSSA form.
- for (Value *V : *Set) {
- Instruction *EntInst = dyn_cast_or_null<Instruction>(V);
+ for (Value *V : Set) {
+ Instruction *EntInst = dyn_cast<Instruction>(V);
if (!EntInst)
continue;