[llvm] [InstCombine] Remove over-generalization from computeKnownBitsFromCmp() (PR #72637)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 02:50:04 PST 2023


================
@@ -4016,9 +4016,10 @@ define i32 @abs_preserve(i32 %x) {
 declare void @llvm.assume(i1)
 define i1 @PR35794(ptr %a) {
 ; CHECK-LABEL: @PR35794(
-; CHECK-NEXT:    [[MASKCOND:%.*]] = icmp eq ptr [[A:%.*]], null
+; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt ptr [[A:%.*]], inttoptr (i64 -1 to ptr)
+; CHECK-NEXT:    [[MASKCOND:%.*]] = icmp eq ptr [[A]], null
----------------
nikic wrote:

This is no longer handled just because `m_APInt()` doesn't match pointers. I could add a special case just for this and retain the behavior.

https://github.com/llvm/llvm-project/pull/72637


More information about the llvm-commits mailing list