[InstCombine] add TODO about another min/max fold; NFC

Suggested in post-commit for d0975b7cb0
This commit is contained in:
Sanjay Patel 2021-08-17 13:46:08 -04:00
parent ab8419a68b
commit 50c1138796
1 changed files with 1 additions and 0 deletions

View 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);