Skip to content

Commit 50c1138

Browse files
committed
[InstCombine] add TODO about another min/max fold; NFC
Suggested in post-commit for d0975b7
1 parent ab8419a commit 50c1138

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,7 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
10671067
if (IID == Intrinsic::smax || IID == Intrinsic::smin) {
10681068
// smax (neg nsw X), (neg nsw Y) --> neg nsw (smin X, Y)
10691069
// smin (neg nsw X), (neg nsw Y) --> neg nsw (smax X, Y)
1070+
// TODO: Canonicalize neg after min/max if I1 is constant.
10701071
if (match(I0, m_NSWNeg(m_Value(X))) && match(I1, m_NSWNeg(m_Value(Y))) &&
10711072
(I0->hasOneUse() || I1->hasOneUse())) {
10721073
Intrinsic::ID InvID = getInverseMinMaxIntrinsic(IID);

0 commit comments

Comments
 (0)