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) {
30603060 unsigned SrcElemsPerTgtElem = TgtElemBitWidth / SrcElemBitWidth;
30613061 assert (SrcElemsPerTgtElem);
30623062 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,
30713067 SVI.getName () + " .extract" );
30723068 // The shufflevector isn't being replaced: the bitcast that used it
30733069 // is. InstCombine will visit the newly-created instructions.
You can’t perform that action at this time.
0 commit comments