Skip to content

Commit 70bf139

Browse files
authored
[Legalizer] Check full condition for UMIN and UMAX just like the code below does for SMIN and SMAX (llvm#87932)
1 parent 1d3329c commit 70bf139

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3972,7 +3972,7 @@ LegalizerHelper::lower(MachineInstr &MI, unsigned TypeIdx, LLT LowerHintTy) {
39723972
// target can override this with custom lowering and calling the
39733973
// implementation functions.
39743974
LLT Ty = MRI.getType(MI.getOperand(0).getReg());
3975-
if (LI.isLegalOrCustom({G_UMIN, Ty}))
3975+
if (LI.isLegalOrCustom({G_UMIN, Ty}) && LI.isLegalOrCustom({G_UMAX, Ty}))
39763976
return lowerAddSubSatToMinMax(MI);
39773977
return lowerAddSubSatToAddoSubo(MI);
39783978
}

0 commit comments

Comments
 (0)