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) {
678
678
}
679
679
// Reduce all of the unrolled parts into a single vector.
680
680
Value *ReducedPartRdx = RdxParts[0 ];
681
+ unsigned Op = RdxDesc.getOpcode ();
681
682
if (PhiR->isOrdered ()) {
682
683
ReducedPartRdx = RdxParts[UF - 1 ];
683
684
} else {
@@ -686,12 +687,11 @@ Value *VPInstruction::generate(VPTransformState &State) {
686
687
Builder.setFastMathFlags (RdxDesc.getFastMathFlags ());
687
688
for (unsigned Part = 1 ; Part < UF; ++Part) {
688
689
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" );
691
693
else
692
- ReducedPartRdx =
693
- Builder.CreateBinOp ((Instruction::BinaryOps)RdxDesc.getOpcode (),
694
- RdxPart, ReducedPartRdx, " bin.rdx" );
694
+ ReducedPartRdx = createMinMaxOp (Builder, RK, ReducedPartRdx, RdxPart);
695
695
}
696
696
}
697
697
You can’t perform that action at this time.
0 commit comments