[clang] [CIR] Upstream handling of integral-to-pointer casts (PR #161653)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 2 09:11:26 PDT 2025
================
@@ -131,3 +131,25 @@ void bitcast() {
// LLVM: %[[D_VEC:.*]] = load <2 x double>, ptr {{.*}}, align 16
// LLVM: %[[I_VEC:.*]] = bitcast <2 x double> %[[D_VEC]] to <4 x i32>
+
+void f(long int start) {
+ void *p = (void*)start;
+}
+// CIR: %[[L:.*]] = cir.load {{.*}} : !cir.ptr<!s64i>, !s64i
+// CIR: %[[MID:.*]] = cir.cast integral %[[L]] : !s64i -> !u64i
+// CIR: cir.cast int_to_ptr %[[MID]] : !u64i -> !cir.ptr<!void>
----------------
andykaylor wrote:
Can you add LLVM checks here?
https://github.com/llvm/llvm-project/pull/161653
More information about the cfe-commits
mailing list