File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -678,7 +678,6 @@ Value *VPInstruction::generate(VPTransformState &State) {
678678 }
679679 // Reduce all of the unrolled parts into a single vector.
680680 Value *ReducedPartRdx = RdxParts[0 ];
681- unsigned Op = RdxDesc.getOpcode ();
682681 if (PhiR->isOrdered ()) {
683682 ReducedPartRdx = RdxParts[UF - 1 ];
684683 } else {
@@ -687,11 +686,12 @@ Value *VPInstruction::generate(VPTransformState &State) {
687686 Builder.setFastMathFlags (RdxDesc.getFastMathFlags ());
688687 for (unsigned Part = 1 ; Part < UF; ++Part) {
689688 Value *RdxPart = RdxParts[Part];
690- if (Op != Instruction::ICmp && Op != Instruction::FCmp)
691- ReducedPartRdx = Builder.CreateBinOp (
692- (Instruction::BinaryOps)Op, RdxPart, ReducedPartRdx, " bin.rdx" );
693- else
689+ if (RecurrenceDescriptor::isMinMaxRecurrenceKind (RK))
694690 ReducedPartRdx = createMinMaxOp (Builder, RK, ReducedPartRdx, RdxPart);
691+ else
692+ ReducedPartRdx =
693+ Builder.CreateBinOp ((Instruction::BinaryOps)RdxDesc.getOpcode (),
694+ RdxPart, ReducedPartRdx, " bin.rdx" );
695695 }
696696 }
697697
You can’t perform that action at this time.
0 commit comments