Skip to content

Commit 6c4a6b0

Browse files
committed
Remove partial.reduce.sub support
1 parent abe57fb commit 6c4a6b0

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
368368
InstructionCost Invalid = InstructionCost::getInvalid();
369369
InstructionCost Cost(TTI::TCC_Basic);
370370

371-
if (Opcode != Instruction::Add && Opcode != Instruction::Sub)
371+
if (Opcode != Instruction::Add)
372372
return Invalid;
373373

374374
if (InputTypeA != InputTypeB)

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -317,22 +317,13 @@ void VPPartialReductionRecipe::execute(VPTransformState &State) {
317317
State.setDebugLocFrom(getDebugLoc());
318318
auto &Builder = State.Builder;
319319

320+
assert(getOpcode() == Instruction::Add &&
321+
"Unhandled partial reduction opcode");
322+
320323
Value *BinOpVal = State.get(getOperand(0));
321324
Value *PhiVal = State.get(getOperand(1));
322325
assert(PhiVal && BinOpVal && "Phi and Mul must be set");
323326

324-
auto Opcode = getOpcode();
325-
326-
// Currently we don't have a partial_reduce_sub intrinsic,
327-
// so mimic the behaviour by negating the second operand
328-
if (Opcode == Instruction::Sub) {
329-
BinOpVal = Builder.CreateSub(Constant::getNullValue(BinOpVal->getType()),
330-
BinOpVal);
331-
Opcode = Instruction::Add;
332-
}
333-
334-
assert(Opcode == Instruction::Add && "Unhandled partial reduction opcode");
335-
336327
Type *RetTy = PhiVal->getType();
337328

338329
CallInst *V = Builder.CreateIntrinsic(

0 commit comments

Comments
 (0)