File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -6415,18 +6415,6 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) {
6415
6415
return true ;
6416
6416
}
6417
6417
6418
- static bool isBroadcastShuffle (ShuffleVectorInst *SVI) {
6419
- ArrayRef<int > Mask (SVI->getShuffleMask ());
6420
- int SplatElem = -1 ;
6421
- for (unsigned i = 0 ; i < Mask.size (); ++i) {
6422
- if (SplatElem != -1 && Mask[i] != -1 && Mask[i] != SplatElem)
6423
- return false ;
6424
- SplatElem = Mask[i];
6425
- }
6426
-
6427
- return true ;
6428
- }
6429
-
6430
6418
// / Some targets have expensive vector shifts if the lanes aren't all the same
6431
6419
// / (e.g. x86 only introduced "vpsllvd" and friends with AVX2). In these cases
6432
6420
// / it's often worth sinking a shufflevector splat down to its use so that
@@ -6440,7 +6428,7 @@ bool CodeGenPrepare::optimizeShuffleVectorInst(ShuffleVectorInst *SVI) {
6440
6428
6441
6429
// We only expect better codegen by sinking a shuffle if we can recognise a
6442
6430
// constant splat.
6443
- if (! isBroadcastShuffle (SVI) )
6431
+ if (getSplatIndex (SVI-> getShuffleMask ()) < 0 )
6444
6432
return false ;
6445
6433
6446
6434
// InsertedShuffles - Only insert a shuffle in each block once.
You can’t perform that action at this time.
0 commit comments