[polly] [polly] Use DenseMap::insert_range (NFC) (PR #133657)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 30 13:26:14 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/133657
None
>From 716bcfbabcbb358efad717ce36b85e437049c1da Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 30 Mar 2025 13:17:28 -0700
Subject: [PATCH] [polly] Use DenseMap::insert_range (NFC)
---
polly/include/polly/CodeGen/IRBuilder.h | 2 +-
polly/lib/CodeGen/BlockGenerators.cpp | 8 ++++----
polly/lib/CodeGen/IslNodeBuilder.cpp | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/polly/include/polly/CodeGen/IRBuilder.h b/polly/include/polly/CodeGen/IRBuilder.h
index 6641ac9a0c068..5a111e9a2cb7c 100644
--- a/polly/include/polly/CodeGen/IRBuilder.h
+++ b/polly/include/polly/CodeGen/IRBuilder.h
@@ -79,7 +79,7 @@ class ScopAnnotator {
void addAlternativeAliasBases(
llvm::DenseMap<llvm::AssertingVH<llvm::Value>,
llvm::AssertingVH<llvm::Value>> &NewMap) {
- AlternativeAliasBases.insert(NewMap.begin(), NewMap.end());
+ AlternativeAliasBases.insert_range(NewMap);
}
/// Delete the set of alternative alias bases
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index b2e3b5d32fbe2..cf2cc65e0f042 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -76,8 +76,8 @@ Value *BlockGenerator::trySynthesizeNewValue(ScopStmt &Stmt, Value *Old,
return nullptr;
ValueMapT VTV;
- VTV.insert(BBMap.begin(), BBMap.end());
- VTV.insert(GlobalMap.begin(), GlobalMap.end());
+ VTV.insert_range(BBMap);
+ VTV.insert_range(GlobalMap);
Scop &S = *Stmt.getParent();
const DataLayout &DL = S.getFunction().getDataLayout();
@@ -1131,7 +1131,7 @@ void RegionGenerator::copyStmt(ScopStmt &Stmt, LoopToScevMapT <S,
// Remember value in case it is visible after this subregion.
if (isDominatingSubregionExit(DT, R, BB))
- ValueMap.insert(RegionMap.begin(), RegionMap.end());
+ ValueMap.insert_range(RegionMap);
}
// Now create a new dedicated region exit block and add it to the region map.
@@ -1164,7 +1164,7 @@ void RegionGenerator::copyStmt(ScopStmt &Stmt, LoopToScevMapT <S,
Instruction *BICopy = BBCopyEnd->getTerminator();
ValueMapT &RegionMap = RegionMaps[BBCopyStart];
- RegionMap.insert(StartBlockMap.begin(), StartBlockMap.end());
+ RegionMap.insert_range(StartBlockMap);
Builder.SetInsertPoint(BICopy);
copyInstScalar(Stmt, TI, RegionMap, LTS);
diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp
index ca497927e2976..e818dab4f9c0c 100644
--- a/polly/lib/CodeGen/IslNodeBuilder.cpp
+++ b/polly/lib/CodeGen/IslNodeBuilder.cpp
@@ -895,7 +895,7 @@ void IslNodeBuilder::createUser(__isl_take isl_ast_node *User) {
Id = isl_ast_expr_get_id(StmtExpr);
isl_ast_expr_free(StmtExpr);
- LTS.insert(OutsideLoopIterations.begin(), OutsideLoopIterations.end());
+ LTS.insert_range(OutsideLoopIterations);
Stmt = (ScopStmt *)isl_id_get_user(Id);
auto *NewAccesses = createNewAccesses(Stmt, User);
More information about the llvm-commits
mailing list