[InstCombine] add TODO about another min/max fold; NFC
authorSanjay Patel <spatel@rotateright.com>
Tue, 17 Aug 2021 17:46:08 +0000 (13:46 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 17 Aug 2021 18:14:25 +0000 (14:14 -0400)
Suggested in post-commit for d0975b7cb0e1

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

index 579a4bb..9e4dd75 100644 (file)
@@ -1067,6 +1067,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
     if (IID == Intrinsic::smax || IID == Intrinsic::smin) {
       // smax (neg nsw X), (neg nsw Y) --> neg nsw (smin X, Y)
       // smin (neg nsw X), (neg nsw Y) --> neg nsw (smax X, Y)
+      // TODO: Canonicalize neg after min/max if I1 is constant.
       if (match(I0, m_NSWNeg(m_Value(X))) && match(I1, m_NSWNeg(m_Value(Y))) &&
           (I0->hasOneUse() || I1->hasOneUse())) {
         Intrinsic::ID InvID = getInverseMinMaxIntrinsic(IID);