@@ -531,8 +531,7 @@ bool VectorCombine::isExtractExtractCheap(ExtractElementInst *Ext0,
531
531
// / Create a shuffle that translates (shifts) 1 element from the input vector
532
532
// / to a new element location.
533
533
static Value *createShiftShuffle (Value *Vec, unsigned OldIndex,
534
- unsigned NewIndex,
535
- IRBuilder<InstSimplifyFolder> &Builder) {
534
+ unsigned NewIndex, IRBuilderBase &Builder) {
536
535
// The shuffle mask is poison except for 1 lane that is being translated
537
536
// to the new element index. Example for OldIndex == 2 and NewIndex == 0:
538
537
// ShufMask = { 2, poison, poison, poison }
@@ -546,9 +545,9 @@ static Value *createShiftShuffle(Value *Vec, unsigned OldIndex,
546
545
// / the source vector (shift the scalar element) to a NewIndex for extraction.
547
546
// / Return null if the input can be constant folded, so that we are not creating
548
547
// / unnecessary instructions.
549
- static ExtractElementInst *
550
- translateExtract (ExtractElementInst *ExtElt, unsigned NewIndex,
551
- IRBuilder<InstSimplifyFolder> &Builder) {
548
+ static ExtractElementInst *translateExtract (ExtractElementInst *ExtElt,
549
+ unsigned NewIndex,
550
+ IRBuilderBase &Builder) {
552
551
// Shufflevectors can only be created for fixed-width vectors.
553
552
Value *X = ExtElt->getVectorOperand ();
554
553
if (!isa<FixedVectorType>(X->getType ()))
@@ -1462,10 +1461,12 @@ bool VectorCombine::foldBinopOfReductions(Instruction &I) {
1462
1461
LLVM_DEBUG (dbgs () << " Found two mergeable reductions: " << I
1463
1462
<< " \n OldCost: " << OldCost << " vs NewCost: " << NewCost
1464
1463
<< " \n " );
1465
- Value *VectorBO = Builder.CreateBinOp (BinOpOpc, V0, V1);
1466
- if (auto *PDInst = dyn_cast<PossiblyDisjointInst>(&I))
1467
- if (auto *PDVectorBO = dyn_cast<PossiblyDisjointInst>(VectorBO))
1468
- PDVectorBO->setIsDisjoint (PDInst->isDisjoint ());
1464
+ Value *VectorBO;
1465
+ if (BinOpOpc == Instruction::Or)
1466
+ VectorBO = Builder.CreateOr (V0, V1, " " ,
1467
+ cast<PossiblyDisjointInst>(I).isDisjoint ());
1468
+ else
1469
+ VectorBO = Builder.CreateBinOp (BinOpOpc, V0, V1);
1469
1470
1470
1471
Instruction *Rdx = Builder.CreateIntrinsic (ReductionIID, {VTy}, {VectorBO});
1471
1472
replaceValue (I, *Rdx);
@@ -1522,7 +1523,7 @@ class ScalarizationResult {
1522
1523
}
1523
1524
1524
1525
// / Freeze the ToFreeze and update the use in \p User to use it.
1525
- void freeze (IRBuilder<InstSimplifyFolder> &Builder, Instruction &UserI) {
1526
+ void freeze (IRBuilderBase &Builder, Instruction &UserI) {
1526
1527
assert (isSafeWithFreeze () &&
1527
1528
" should only be used when freezing is required" );
1528
1529
assert (is_contained (ToFreeze->users (), &UserI) &&
@@ -2620,7 +2621,7 @@ static Value *generateNewInstTree(ArrayRef<InstLane> Item, FixedVectorType *Ty,
2620
2621
const SmallPtrSet<Use *, 4 > &IdentityLeafs,
2621
2622
const SmallPtrSet<Use *, 4 > &SplatLeafs,
2622
2623
const SmallPtrSet<Use *, 4 > &ConcatLeafs,
2623
- IRBuilder<InstSimplifyFolder> &Builder,
2624
+ IRBuilderBase &Builder,
2624
2625
const TargetTransformInfo *TTI) {
2625
2626
auto [FrontU, FrontLane] = Item.front ();
2626
2627
0 commit comments