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]>


================
@@ -5521,6 +5545,14 @@ static Address emitAddrOfFieldStorage(CodeGenFunction 
&CGF, Address base,
 
   unsigned idx =
     CGF.CGM.getTypes().getCGRecordLayout(rec).getLLVMFieldNo(field);
+  llvm::Type *StructType =
+      CGF.CGM.getTypes().getCGRecordLayout(rec).getLLVMType();
+
+  if (CGF.getLangOpts().HLSL && CGF.getLangOpts().EmitStructuredGEP)
+    return RawAddress(
+        CGF.Builder.CreateStructuredGEP(StructType, base.emitRawPointer(CGF),
----------------
s-perron wrote:

+1 to @Keenuts reply. For SPIR-V, we need the SGEP essentially all of the time. 
The way some optimizations rewrite GEPs make it impossible to generate valid 
OpAccessChain instructions in the backend. Recognizing when the optimizer may 
be able to transform the code in such a way is not the type of analysis we want 
to the FE to 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