File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
llvm/lib/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -3060,14 +3060,10 @@ Instruction *InstCombinerImpl::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
3060
3060
unsigned SrcElemsPerTgtElem = TgtElemBitWidth / SrcElemBitWidth;
3061
3061
assert (SrcElemsPerTgtElem);
3062
3062
BegIdx /= SrcElemsPerTgtElem;
3063
- bool BCAlreadyExists = NewBCs.contains (CastSrcTy);
3064
- auto *NewBC =
3065
- BCAlreadyExists
3066
- ? NewBCs[CastSrcTy]
3067
- : Builder.CreateBitCast (V, CastSrcTy, SVI.getName () + " .bc" );
3068
- if (!BCAlreadyExists)
3069
- NewBCs[CastSrcTy] = NewBC;
3070
- auto *Ext = Builder.CreateExtractElement (NewBC, BegIdx,
3063
+ auto [It, Inserted] = NewBCs.try_emplace (CastSrcTy);
3064
+ if (Inserted)
3065
+ It->second = Builder.CreateBitCast (V, CastSrcTy, SVI.getName () + " .bc" );
3066
+ auto *Ext = Builder.CreateExtractElement (It->second , BegIdx,
3071
3067
SVI.getName () + " .extract" );
3072
3068
// The shufflevector isn't being replaced: the bitcast that used it
3073
3069
// is. InstCombine will visit the newly-created instructions.
You can’t perform that action at this time.
0 commit comments