Skip to content

Commit 83f27e9

Browse files
committed
!fixup pass IsSingleScalar to constructor.
1 parent a65c9c3 commit 83f27e9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ class VPBuilder {
175175
std::initializer_list<VPValue *> Operands,
176176
Type *ResultTy, const VPIRFlags &Flags = {},
177177
DebugLoc DL = {}, const Twine &Name = "") {
178-
return tryInsertInstruction(
179-
new VPInstructionWithType(Opcode, Operands, ResultTy, Flags, DL, Name));
178+
return tryInsertInstruction(new VPInstructionWithType(
179+
Opcode, Operands, ResultTy, Flags, DL, /*IsSingleScalar=*/false, Name));
180180
}
181181

182182
VPInstruction *createOverflowingOp(unsigned Opcode,
@@ -264,8 +264,8 @@ class VPBuilder {
264264

265265
VPInstruction *createScalarCast(Instruction::CastOps Opcode, VPValue *Op,
266266
Type *ResultTy, DebugLoc DL) {
267-
return tryInsertInstruction(
268-
new VPInstructionWithType(Opcode, Op, ResultTy, {}, DL));
267+
return tryInsertInstruction(new VPInstructionWithType(
268+
Opcode, Op, ResultTy, {}, DL, /*IsSingleScalar=*/true));
269269
}
270270

271271
VPWidenCastRecipe *createWidenCast(Instruction::CastOps Opcode, VPValue *Op,

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8402,9 +8402,9 @@ VPRecipeBuilder::handleReplication(Instruction *I, ArrayRef<VPValue *> Operands,
84028402
(Range.Start.isScalable() && isa<IntrinsicInst>(I))) &&
84038403
"Should not predicate a uniform recipe");
84048404
if (IsUniform && Instruction::isCast(I->getOpcode())) {
8405-
auto *Recipe = new VPInstructionWithType(I->getOpcode(), Operands,
8406-
I->getType(), VPIRFlags(*I),
8407-
I->getDebugLoc(), I->getName());
8405+
auto *Recipe = new VPInstructionWithType(
8406+
I->getOpcode(), Operands, I->getType(), VPIRFlags(*I), I->getDebugLoc(),
8407+
/*IsSingleScalar=*/true, I->getName());
84088408
Recipe->setUnderlyingValue(I);
84098409
return Recipe;
84108410
}

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ class VPInstructionWithType : public VPInstruction {
10561056
public:
10571057
VPInstructionWithType(unsigned Opcode, ArrayRef<VPValue *> Operands,
10581058
Type *ResultTy, const VPIRFlags &Flags, DebugLoc DL,
1059-
const Twine &Name = "")
1059+
bool SingleScalar = false, const Twine &Name = "")
10601060
: VPInstruction(Opcode, Operands, Flags, DL, Name, true),
10611061
ResultTy(ResultTy) {}
10621062

@@ -1085,7 +1085,7 @@ class VPInstructionWithType : public VPInstruction {
10851085
SmallVector<VPValue *, 2> Operands(operands());
10861086
auto *New =
10871087
new VPInstructionWithType(getOpcode(), Operands, getResultType(), *this,
1088-
getDebugLoc(), getName());
1088+
getDebugLoc(), isSingleScalar(), getName());
10891089
New->setUnderlyingValue(getUnderlyingValue());
10901090
return New;
10911091
}

0 commit comments

Comments
 (0)