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,6 +678,7 @@ 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 ();
681682 if (PhiR->isOrdered ()) {
682683 ReducedPartRdx = RdxParts[UF - 1 ];
683684 } else {
@@ -686,12 +687,11 @@ Value *VPInstruction::generate(VPTransformState &State) {
686687 Builder.setFastMathFlags (RdxDesc.getFastMathFlags ());
687688 for (unsigned Part = 1 ; Part < UF; ++Part) {
688689 Value *RdxPart = RdxParts[Part];
689- if (RecurrenceDescriptor::isMinMaxRecurrenceKind (RK))
690- ReducedPartRdx = createMinMaxOp (Builder, RK, ReducedPartRdx, RdxPart);
690+ if (Op != Instruction::ICmp && Op != Instruction::FCmp)
691+ ReducedPartRdx = Builder.CreateBinOp (
692+ (Instruction::BinaryOps)Op, RdxPart, ReducedPartRdx, " bin.rdx" );
691693 else
692- ReducedPartRdx =
693- Builder.CreateBinOp ((Instruction::BinaryOps)RdxDesc.getOpcode (),
694- RdxPart, ReducedPartRdx, " bin.rdx" );
694+ ReducedPartRdx = createMinMaxOp (Builder, RK, ReducedPartRdx, RdxPart);
695695 }
696696 }
697697
You can’t perform that action at this time.
0 commit comments