================
@@ -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());
----------------
Keenuts wrote:

Don't have one yet. Changed this to `cast` to fail if we do.

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