Skip to content

Commit

Permalink
Remove redundant ternary operator in conditional check
Browse files Browse the repository at this point in the history
The ternary operator in the second `if` statement was redundant because `IsOrdered` is already checked to be `false` in the outer `if` statement. Simplified the code by directly using `UnorderedOp`.
  • Loading branch information
abhishek-kaushik22 authored Aug 22, 2024
1 parent c79d1fa commit f428628
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8755,7 +8755,7 @@ SDValue TargetLowering::expandIS_FPCLASS(EVT ResultVT, SDValue Op,
ISD::CondCode OrderedOp = IsInverted ? ISD::SETUGE : ISD::SETOLT;
ISD::CondCode UnorderedOp = IsInverted ? ISD::SETOGE : ISD::SETULT;

if (isCondCodeLegalOrCustom(IsOrdered ? OrderedOp : UnorderedOp,
if (isCondCodeLegalOrCustom(UnorderedOp,
OperandVT.getScalarType().getSimpleVT())) {
// (issubnormal(x) || iszero(x)) --> fabs(x) < smallest_normal

Expand Down

0 comments on commit f428628

Please sign in to comment.