Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>,
Nathan =?utf-8?q?Gauër?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -1395,9 +1396,18 @@ std::optional<LValue> 
CGHLSLRuntime::emitBufferArraySubscriptExpr(
   Indices.push_back(Idx);
   Indices.push_back(llvm::ConstantInt::get(CGF.Int32Ty, 0));
 
-  llvm::Value *GEP = CGF.Builder.CreateGEP(LayoutTy, Addr.emitRawPointer(CGF),
-                                           Indices, "cbufferidx");
-  Addr = Address(GEP, Addr.getElementType(), RowAlignedSize, KnownNonNull);
+  if (CGF.getLangOpts().EmitStructuredGEP) {
+    if (auto *AT = dyn_cast<llvm::ArrayType>(Addr.getElementType()))
+      LayoutTy = llvm::ArrayType::get(LayoutTy, AT->getNumElements());
----------------
s-perron wrote:

In what situation is this not an array type? How do we know it will make sense 
to index into the layout type when it is not an array type?

https://github.com/llvm/llvm-project/pull/177332
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to