[llvm] [InstCombine] Compare `icmp inttoptr, inttoptr` values directly (PR #107012)
Marina Taylor via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 6 04:15:11 PDT 2024
================
@@ -71,8 +63,7 @@ define i1 @inttoptr_size_mismatch(i200 %x, i9 %y) {
define <2 x i1> @inttoptr_vector_constant_size_mismatch(<2 x i200> %x) {
; CHECK-LABEL: @inttoptr_vector_constant_size_mismatch(
; CHECK-NEXT: [[TMP1:%.*]] = trunc <2 x i200> [[X:%.*]] to <2 x i64>
-; CHECK-NEXT: [[XPTR:%.*]] = inttoptr <2 x i64> [[TMP1]] to <2 x ptr>
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x ptr> [[XPTR]], <ptr inttoptr (i9 42 to ptr), ptr inttoptr (i9 123 to ptr)>
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i64> [[TMP1]], <i64 42, i64 123>
----------------
citymarina wrote:
I had to change to `max-iterations=2` because this test case goes through an intermediate stage:
```
<ptr inttoptr (i9 42 to ptr), ptr inttoptr (i9 123 to ptr)>
-->
<i64 ptrtoint (ptr inttoptr (i9 42 to ptr) to i64), i64 ptrtoint (ptr inttoptr (i9 123 to ptr) to i64)>
-->
<i64 42, i64 123>
```
Is that ok?
https://github.com/llvm/llvm-project/pull/107012
More information about the llvm-commits
mailing list