-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Vectorize] Simplify code with MapVector::operator[] (NFC) #115592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Vectorize] Simplify code with MapVector::operator[] (NFC) #115592
Conversation
|
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-vectorizers Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/115592.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 82d85b112397f3..1ebc62f9843905 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6858,8 +6858,8 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
if ((SI = dyn_cast<StoreInst>(&I)) &&
Legal->isInvariantAddressOfReduction(SI->getPointerOperand())) {
ValuesToIgnore.insert(&I);
- auto I = DeadInvariantStoreOps.insert({SI->getPointerOperand(), {}});
- I.first->second.push_back(SI->getValueOperand());
+ DeadInvariantStoreOps[SI->getPointerOperand()].push_back(
+ SI->getValueOperand());
}
if (VecValuesToIgnore.contains(&I) || ValuesToIgnore.contains(&I))
@@ -8084,9 +8084,9 @@ void VPRecipeBuilder::createSwitchEdgeMasks(SwitchInst *SI) {
// ignored - they will get there anyhow.
if (Dst == DefaultDst)
continue;
- auto I = Dst2Compares.insert({Dst, {}});
+ auto &Compares = Dst2Compares[Dst];
VPValue *V = getVPValueOrAddLiveIn(C.getCaseValue());
- I.first->second.push_back(Builder.createICmp(CmpInst::ICMP_EQ, Cond, V));
+ Compares.push_back(Builder.createICmp(CmpInst::ICMP_EQ, Cond, V));
}
// We need to handle 2 separate cases below for all entries in Dst2Compares,
|
nikic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/3604 Here is the relevant piece of the build log for the reference |
No description provided.