File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -3709,18 +3709,16 @@ class VPlan {
3709
3709
// / yet) for \p V.
3710
3710
VPValue *getOrAddLiveIn (Value *V) {
3711
3711
assert (V && " Trying to get or add the VPValue of a null Value" );
3712
- if (!Value2VPValue.count (V)) {
3712
+ auto [It, Inserted] = Value2VPValue.try_emplace (V);
3713
+ if (Inserted) {
3713
3714
VPValue *VPV = new VPValue (V);
3714
3715
VPLiveInsToFree.push_back (VPV);
3715
3716
assert (VPV->isLiveIn () && " VPV must be a live-in." );
3716
- assert (!Value2VPValue.count (V) && " Value already exists in VPlan" );
3717
- Value2VPValue[V] = VPV;
3717
+ It->second = VPV;
3718
3718
}
3719
3719
3720
- assert (Value2VPValue.count (V) && " Value does not exist in VPlan" );
3721
- assert (Value2VPValue[V]->isLiveIn () &&
3722
- " Only live-ins should be in mapping" );
3723
- return Value2VPValue[V];
3720
+ assert (It->second ->isLiveIn () && " Only live-ins should be in mapping" );
3721
+ return It->second ;
3724
3722
}
3725
3723
3726
3724
// / Return the live-in VPValue for \p V, if there is one or nullptr otherwise.
You can’t perform that action at this time.
0 commit comments