================
@@ -181,6 +182,16 @@ RValue 
CodeGenFunction::EmitAMDGPUDevicePrintfCallExpr(const CallExpr *E) {
     Args.push_back(Arg);
   }
 
+  // The expansion reads the format from the initializer of the global it 
points
+  // to, which may not be emitted yet for a deferred constant array. Pass a 
copy
+  // of the evaluated format instead.
+  StringRef FmtStr;
+  if (!llvm::getConstantStringInfo(Args[0], FmtStr))
+    if (std::optional<std::string> Fmt =
+            E->getArg(0)->tryEvaluateString(getContext()))
----------------
steffenlarsen wrote:

https://github.com/llvm/llvm-project/pull/238287 creates the limitation. There 
is a request on there to let this go in first.

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

Reply via email to