[llvm] 38fca7b - [Vectorize] Simplify code with DenseMap::operator[] (NFC) (#113246)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 21 21:35:42 PDT 2024
Author: Kazu Hirata
Date: 2024-10-21T21:35:38-07:00
New Revision: 38fca7b7db2ba1647c87679d6750fc4a4bfe72e1
URL: https://github.com/llvm/llvm-project/commit/38fca7b7db2ba1647c87679d6750fc4a4bfe72e1
DIFF: https://github.com/llvm/llvm-project/commit/38fca7b7db2ba1647c87679d6750fc4a4bfe72e1.diff
LOG: [Vectorize] Simplify code with DenseMap::operator[] (NFC) (#113246)
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.h
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 0ea73229f1eceb..6a192bdf01c4ff 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -292,8 +292,7 @@ struct VPTransformState {
/// Set the generated scalar \p V for \p Def and the given \p Lane.
void set(VPValue *Def, Value *V, const VPLane &Lane) {
- auto Iter = Data.VPV2Scalars.insert({Def, {}});
- auto &Scalars = Iter.first->second;
+ auto &Scalars = Data.VPV2Scalars[Def];
unsigned CacheIdx = Lane.mapToCacheIndex(VF);
if (Scalars.size() <= CacheIdx)
Scalars.resize(CacheIdx + 1);
More information about the llvm-commits
mailing list