[clang] [CIR][ABI] Add restrict, nonnull, and ReturnsNonNull attributes (PR #188281)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 25 15:46:45 PDT 2026


================
@@ -85,11 +85,11 @@ void library_builtins() {
 
 // CIR: cir.func{{.*}} @_Z16library_builtinsv()
 // CIR: %[[NULL:.+]] = cir.const #cir.ptr<null> : !cir.ptr<!s8i>
-// CIR: cir.call @printf(%[[NULL]]) nothrow : (!cir.ptr<!s8i> {llvm.noundef}) -> !s32i
+// CIR: cir.call @printf(%[[NULL]]) nothrow : (!cir.ptr<!s8i> {llvm.noalias, llvm.noundef}) -> !s32i
 // CIR: cir.call @abort() nothrow {noreturn} : () -> ()
 
 // LLVM: define{{.*}} void @_Z16library_builtinsv()
-// LLVM: call i32 (ptr, ...) @printf(ptr noundef null)
+// LLVM: call i32 (ptr, ...) @printf(ptr noalias noundef null)
----------------
andykaylor wrote:

OGCG doesn't set noalias on this parameter.

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


More information about the cfe-commits mailing list