[llvm] [AMDGPU] Fix hidden kernarg preload count inconsistency (PR #116759)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 20:28:56 PST 2024


================
@@ -2999,6 +2999,14 @@ SDValue SITargetLowering::LowerFormalArguments(
           NewArg = DAG.getMergeValues({NewArg, Chain}, DL);
         }
       } else {
+#ifndef NDEBUG
+        if (Arg.isOrigArg()) {
+          Argument *OrigArg = Fn.getArg(Arg.getOrigArgIndex());
+          assert(!OrigArg->hasAttribute("amdgpu-hidden-argument") &&
+                 "Hidden arguments should be preloaded");
----------------
arsenm wrote:

No error on valid IR can be an assert. This should report a proper error (via DiagnosticInfo) 

https://github.com/llvm/llvm-project/pull/116759


More information about the llvm-commits mailing list