Skip to content

Commit 5cf434b

Browse files
committed
!fixup pass IsSingleScalar to constructor.
1 parent 1384252 commit 5cf434b

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
@@ -8130,9 +8130,9 @@ VPRecipeBuilder::handleReplication(Instruction *I, ArrayRef<VPValue *> Operands,
81308130
(Range.Start.isScalable() && isa<IntrinsicInst>(I))) &&
81318131
"Should not predicate a uniform recipe");
81328132
if (IsUniform && Instruction::isCast(I->getOpcode())) {
8133-
auto *Recipe = new VPInstructionWithType(I->getOpcode(), Operands,
8134-
I->getType(), VPIRFlags(*I),
8135-
I->getDebugLoc(), I->getName());
8133+
auto *Recipe = new VPInstructionWithType(
8134+
I->getOpcode(), Operands, I->getType(), VPIRFlags(*I), I->getDebugLoc(),
8135+
/*IsSingleScalar=*/true, I->getName());
81368136
Recipe->setUnderlyingValue(I);
81378137
return Recipe;
81388138
}

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ class VPInstructionWithType : public VPInstruction {
10701070
public:
10711071
VPInstructionWithType(unsigned Opcode, ArrayRef<VPValue *> Operands,
10721072
Type *ResultTy, const VPIRFlags &Flags, DebugLoc DL,
1073-
const Twine &Name = "")
1073+
bool SingleScalar = false, const Twine &Name = "")
10741074
: VPInstruction(Opcode, Operands, Flags, DL, Name, true),
10751075
ResultTy(ResultTy) {}
10761076

@@ -1099,7 +1099,7 @@ class VPInstructionWithType : public VPInstruction {
10991099
SmallVector<VPValue *, 2> Operands(operands());
11001100
auto *New =
11011101
new VPInstructionWithType(getOpcode(), Operands, getResultType(), *this,
1102-
getDebugLoc(), getName());
1102+
getDebugLoc(), isSingleScalar(), getName());
11031103
New->setUnderlyingValue(getUnderlyingValue());
11041104
return New;
11051105
}

0 commit comments

Comments
 (0)