================
@@ -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:

Bleh... I spent some time today looking at this, and I think I've convinced 
myself that this is probably the simplest approach.

Without this you get a redundant copy because the cast that produces the 
ArrayParameterType. I have one small request to change the comment above.

https://github.com/llvm/llvm-project/pull/111047
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to