================
@@ -958,6 +958,9 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned 
BuiltinID,
 
     llvm::Value *ScopeMD = emitScopeMD(*this, ScopeExpr->getZExtValue(), AO);
     llvm::Function *F = CGM.getIntrinsic(IID, {LoadTy});
+    // Flat pointers are not in AS 0 on SPIR-V.
+    Addr = Builder.CreateAddrSpaceCast(Addr,
----------------
efriedma-quic wrote:

Are you sure the AST is correct here?  You usually shouldn't need to insert 
casts in CodeGen like this; the AST should explicitly represent any casts that 
need to happen.

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

Reply via email to