|
16 | 16 | #include "llvm/ADT/ArrayRef.h"
|
17 | 17 | #include "llvm/ADT/DenseMap.h"
|
18 | 18 | #include "llvm/ADT/STLExtras.h"
|
| 19 | +#include "llvm/ADT/SmallBitVector.h" |
19 | 20 | #include "llvm/ADT/SmallVector.h"
|
20 | 21 | #include "llvm/Analysis/InstructionSimplify.h"
|
21 | 22 | #include "llvm/Analysis/VectorUtils.h"
|
@@ -771,7 +772,7 @@ static Instruction *foldInsSequenceIntoSplat(InsertElementInst &InsElt) {
|
771 | 772 |
|
772 | 773 | Value *SplatVal = InsElt.getOperand(1);
|
773 | 774 | InsertElementInst *CurrIE = &InsElt;
|
774 |
| - SmallVector<bool, 16> ElementPresent(NumElements, false); |
| 775 | + SmallBitVector ElementPresent(NumElements, false); |
775 | 776 | InsertElementInst *FirstIE = nullptr;
|
776 | 777 |
|
777 | 778 | // Walk the chain backwards, keeping track of which indices we inserted into,
|
@@ -803,7 +804,7 @@ static Instruction *foldInsSequenceIntoSplat(InsertElementInst &InsElt) {
|
803 | 804 | // TODO: If the base vector is not undef, it might be better to create a splat
|
804 | 805 | // and then a select-shuffle (blend) with the base vector.
|
805 | 806 | if (!isa<UndefValue>(FirstIE->getOperand(0)))
|
806 |
| - if (any_of(ElementPresent, [](bool Present) { return !Present; })) |
| 807 | + if (!ElementPresent.all()) |
807 | 808 | return nullptr;
|
808 | 809 |
|
809 | 810 | // Create the insert + shuffle.
|
|
0 commit comments