[clang] [llvm] [IR][HLSL] Add llvm.structured.gep instruction (PR #176145)

Sebastian Neubauer via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 15 05:51:30 PST 2026


Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/176145 at github.com>


================
@@ -1029,6 +1029,11 @@ def int_call_preallocated_teardown : DefaultAttrsIntrinsic<[], [llvm_token_ty]>;
 def int_callbr_landingpad : Intrinsic<[llvm_any_ty], [LLVMMatchType<0>],
                                       [IntrNoMerge]>;
 
+def int_structured_gep
+    : Intrinsic<[llvm_anyptr_ty],
+                [llvm_any_ty, LLVMMatchType<0>, llvm_vararg_ty],
+                [IntrNoMem, IntrWillReturn]>;
----------------
Flakebi wrote:

Two points:
- Use elementtype instead of the poison dummy argument
- Use DefaultAttrsIntrinsic (which includes WillReturn and a few other useful ones, look out for `IntrinsicProperty<1>` to find all default ones)

```suggestion
def int_structured_gep
    : DefaultAttrsIntrinsic<[llvm_anyptr_ty],
                [LLVMMatchType<0>, llvm_vararg_ty],
                [IntrNoMem]>;
```

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


More information about the cfe-commits mailing list