[llvm] [GlobalISel][IRTranslator] Lower ptr/non-ptr bitcasts via G_INTTOPTR/G_PTRTOINT (PR #203335)

Petar Avramovic via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 03:15:47 PDT 2026


================
@@ -646,6 +646,90 @@ define ptr @bitcast_b64_to_p0(b64 %b) {
   ret ptr %r
 }
 
+; <2 x b32> is not an LLVM integer type, so lowering uses G_BITCAST to s64 then
+; G_INTTOPTR (case 2).
+define ptr @irtranslator_bitcast_v2b32_to_ptr(<2 x b32> %v) {
+  ; AARCH64-LABEL: name: irtranslator_bitcast_v2b32_to_ptr
+  ; AARCH64: bb.1 (%ir-block.0):
+  ; AARCH64-NEXT:   liveins: $d0
+  ; AARCH64-NEXT: {{  $}}
+  ; AARCH64-NEXT:   [[V:%[0-9]+]]:_(<2 x i32>) = COPY $d0
+  ; AARCH64-NEXT:   [[I:%[0-9]+]]:_(s64) = G_BITCAST [[V]](<2 x i32>)
----------------
petar-avramovic wrote:

I assume we want i64 here

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


More information about the llvm-commits mailing list