[clang] [HLSL] get inout/out ABI for array parameters working (PR #111047)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 13 15:28:54 PST 2024


================
@@ -5322,6 +5324,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
           IRCallArgs[FirstIRArg] = Val;
           break;
         }
+      } else if (I->getType()->isArrayParameterType()) {
+        // use the tmp created by the HLSLOutArgExpr
+        // instead of creating a new one below and copying the tmp into it.
+        IRCallArgs[FirstIRArg] = I->getKnownRValue().getScalarVal();
+        break;
----------------
llvm-beanz wrote:

I think this might be the wrong solution. If we instead make the parameter ABI `Direct`, it should end up doing effectively what you're accomplishing here.

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


More information about the cfe-commits mailing list