Copy what cannotBeOrderedLessThanZeroImpl checks for fdiv.
Details
Diff Detail
Event Timeline
llvm/include/llvm/Analysis/ValueTracking.h | ||
---|---|---|
354–356 | ||
llvm/lib/Analysis/ValueTracking.cpp | ||
4594 | WantInfNan || WantNegative is true, else we would have bailed out | |
4611–4613 | This may be true but it seems weirdly specific, and the comment doesn't really say what it does. I think it generalises to: if (KnownLHS.isKnownNot(fcNegative) && KnownRHS.isKnownNot(fcNegative)) Known.knownNot(fcNegative); ... plus three other cases for the other combinations of LHS/RHS known not positive/negative. This is basically saying that ignoring nans, the sign of the result is the xor of the signs of the arguments, which is also true for FMul. |
LGTM with comment nit.
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
4611 | Comment should say +ve / +ve is +ve. |
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
4611 | ve? |
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
4611 | "+ve" is short for "positive". I just mean the comment should describe what the code is doing, instead of just mentioning a true but largely irrelevant fact. |