[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 11:17:50 PST 2026


Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
Nathan =?utf-8?q?Gauër?= <brioche at google.com>,
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>


================
@@ -4507,6 +4518,9 @@ static llvm::Value *emitArraySubscriptGEP(CodeGenFunction &CGF,
                                           bool signedIndices,
                                           SourceLocation loc,
                                     const llvm::Twine &name = "arrayidx") {
+  if (CGF.getLangOpts().EmitStructuredGEP)
+    return CGF.Builder.CreateStructuredGEP(elemType, ptr, indices);
+
   if (inbounds) {
     return CGF.EmitCheckedInBoundsGEP(elemType, ptr, indices, signedIndices,
----------------
Flakebi wrote:

clang is outside my area, but is it fine to emit structured.gep if inbounds is false? (except for it being an experimental flag)

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


More information about the cfe-commits mailing list