[InstCombine] Fix InstCombinerImpl::foldICmpMulConstant for nsw and nuw mul with...
authorCraig Topper <craig.topper@sifive.com>
Wed, 15 Feb 2023 07:43:17 +0000 (23:43 -0800)
committerCraig Topper <craig.topper@sifive.com>
Wed, 15 Feb 2023 07:43:17 +0000 (23:43 -0800)
commit2872987e5e91cbda423a3b2be061756a116902b6
tree6aa35e5fc067a40875ff4d46f769bd07d9accd64
parent41628d050a1724b1a634b420ea099bf15793c8d0
[InstCombine] Fix InstCombinerImpl::foldICmpMulConstant for nsw and nuw mul with unsigned compare.

If we have both an nsw and nuw flag, we would see the nsw flag
first and only handle signed comparisons.

This patch ignores the nsw flag if the comparison isn't signed.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D143766
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-mul.ll