We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab8419a commit 50c1138Copy full SHA for 50c1138
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -1067,6 +1067,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
1067
if (IID == Intrinsic::smax || IID == Intrinsic::smin) {
1068
// smax (neg nsw X), (neg nsw Y) --> neg nsw (smin X, Y)
1069
// smin (neg nsw X), (neg nsw Y) --> neg nsw (smax X, Y)
1070
+ // TODO: Canonicalize neg after min/max if I1 is constant.
1071
if (match(I0, m_NSWNeg(m_Value(X))) && match(I1, m_NSWNeg(m_Value(Y))) &&
1072
(I0->hasOneUse() || I1->hasOneUse())) {
1073
Intrinsic::ID InvID = getInverseMinMaxIntrinsic(IID);
0 commit comments