[llvm] [llubi] Add support for captures (PR #201170)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 1 10:16:35 PDT 2026


================
@@ -0,0 +1,51 @@
+; NOTE: Assertions have been autogenerated by utils/update_llubi_test_checks.py UTC_ARGS: --version 6
+; RUN: not llubi --verbose < %s 2>&1 | FileCheck %s
+
+target datalayout = "e-p:64:64:64"
+
+define ptr @mix_pointer(ptr %pa, ptr %pb) {
+  %ba = bitcast ptr %pa to <2 x b32>
+  %bb = bitcast ptr %pb to <2 x b32>
+  %bc = shufflevector <2 x b32> %ba, <2 x b32> %bb, <2 x i32> <i32 0, i32 3>
+  %pc = bitcast <2 x b32> %bc to ptr
+  ret ptr %pc
+}
+
+ at g = global ptr null
+
+define void @captured_by_mem(ptr captures(provenance) %a) {
----------------
dtcxzyw wrote:

>From my view, `%a` is captured via the memory without the address component. Even if we don't model address/address_is_null in llubi, we cannot treat `%p1` and `%p2` as identical pointers.


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


More information about the llvm-commits mailing list