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

2024-12-03 Thread Sarah Spall via cfe-commits
https://github.com/spall closed 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

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

2024-12-03 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111047 >From 119def060924f13bd1fe07f6d73ce27a1b52ea12 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 17 Sep 2024 20:25:46 + Subject: [PATCH 1/8] theoretically fix issue --- clang/lib/Sema/SemaType.cpp | 4 ++

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

2024-12-03 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111047 >From 119def060924f13bd1fe07f6d73ce27a1b52ea12 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 17 Sep 2024 20:25:46 + Subject: [PATCH 1/8] theoretically fix issue --- clang/lib/Sema/SemaType.cpp | 4 ++

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

2024-12-03 Thread Chris B via cfe-commits
@@ -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 +/

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

2024-12-03 Thread Chris B via cfe-commits
@@ -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 +/

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

2024-12-03 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. 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

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

2024-11-13 Thread Chris B via cfe-commits
@@ -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 +/

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

2024-11-08 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111047 >From 119def060924f13bd1fe07f6d73ce27a1b52ea12 Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 17 Sep 2024 20:25:46 + Subject: [PATCH 1/7] theoretically fix issue --- clang/lib/Sema/SemaType.cpp | 4 ++

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

2024-11-04 Thread Chris B via cfe-commits
@@ -0,0 +1,134 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -disable-llvm-passes -emit-llvm -finclude-default-header -o - %s | FileCheck %s + +// CHECK-LABEL: increment +void increment(inout int Arr[2]) { + for (int I = 0; I < 2; I++) +Arr[0] += 2; +} + +//

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

2024-10-31 Thread Sarah Spall via cfe-commits
@@ -4690,8 +4690,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, return emitWritebackArg(*this, args, CRE); } - assert(type->isReferenceType() == E->isGLValue() && - "reference binding to unmaterialized r-value!"); + assert(type->isArr

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

2024-10-30 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111047 >From 0797f19cad4ca9cf605725de1ac838cccacda1fc Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 17 Sep 2024 20:25:46 + Subject: [PATCH 1/6] theoretically fix issue --- clang/lib/Sema/SemaType.cpp | 4 ++

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

2024-10-30 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111047 >From 0797f19cad4ca9cf605725de1ac838cccacda1fc Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 17 Sep 2024 20:25:46 + Subject: [PATCH 1/6] theoretically fix issue --- clang/lib/Sema/SemaType.cpp | 4 ++

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

2024-10-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic edited 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

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

2024-10-22 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: I'd like to see a testcase for passing an array parameter to another function which takes an array parameter. https://github.com/llvm/llvm-project/pull/111047 ___ cfe-commits mailing list cfe-commits@lists.l

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

2024-10-22 Thread Eli Friedman via cfe-commits
@@ -4690,8 +4690,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, return emitWritebackArg(*this, args, CRE); } - assert(type->isReferenceType() == E->isGLValue() && - "reference binding to unmaterialized r-value!"); + assert(type->isArr

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

2024-10-22 Thread Eli Friedman via cfe-commits
@@ -5811,9 +5811,12 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { // This function implements trivial copy assignment for HLSL's // assignable constant arrays. LValue CodeGenFunction::EmitHLSLArrayAssignLValue(const BinaryOperator *E) { - LVal

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

2024-10-22 Thread Sarah Spall via cfe-commits
@@ -4690,8 +4690,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, return emitWritebackArg(*this, args, CRE); } - assert(type->isReferenceType() == E->isGLValue() && - "reference binding to unmaterialized r-value!"); + assert(type->isArr

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

2024-10-10 Thread Greg Roth via cfe-commits
@@ -0,0 +1,48 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -disable-llvm-passes -emit-llvm -finclude-default-header -o - %s | FileCheck %s + +// CHECK-LABEL: increment +void increment(inout int Arr[2]) { + for (int I = 0; I < 2; I++) +Arr[0] += 2; +} + +// C

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

2024-10-10 Thread Greg Roth via cfe-commits
@@ -0,0 +1,48 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -disable-llvm-passes -emit-llvm -finclude-default-header -o - %s | FileCheck %s + +// CHECK-LABEL: increment +void increment(inout int Arr[2]) { + for (int I = 0; I < 2; I++) +Arr[0] += 2; +} + +// C

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

2024-10-10 Thread Greg Roth via cfe-commits
https://github.com/pow2clk commented: Just a drive by review with one additional note while searching for changes that will be disrupted by the mangling shift. https://github.com/llvm/llvm-project/pull/111047 ___ cfe-commits mailing list cfe-commits@l

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

2024-10-10 Thread Greg Roth via cfe-commits
https://github.com/pow2clk edited 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

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

2024-10-07 Thread Chris B via cfe-commits
@@ -2249,6 +2235,25 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType, SCS.setAllToTypes(ToType); return true; + } else if (argIsLValue && !FromType->canDecayToPointerType() && + S.Context.getCanonicalType(FromType) != S.Context.Ove

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

2024-10-07 Thread Chris B via cfe-commits
@@ -5811,9 +5811,12 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { // This function implements trivial copy assignment for HLSL's // assignable constant arrays. LValue CodeGenFunction::EmitHLSLArrayAssignLValue(const BinaryOperator *E) { - LVal

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

2024-10-07 Thread Chris B via cfe-commits
@@ -4690,8 +4690,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, return emitWritebackArg(*this, args, CRE); } - assert(type->isReferenceType() == E->isGLValue() && - "reference binding to unmaterialized r-value!"); + assert(type->isArr

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

2024-10-07 Thread Chris B via cfe-commits
@@ -3830,6 +3830,16 @@ QualType ASTContext::getDecayedType(QualType T) const { return getDecayedType(T, Decayed); } +QualType ASTContext::getConstantArrayFromArrayParameterType(QualType Ty) const { + if (Ty->isConstantArrayType() && !Ty->isArrayParameterType()) +return

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

2024-10-03 Thread Sarah Spall via cfe-commits
https://github.com/spall updated https://github.com/llvm/llvm-project/pull/111047 >From c73ce3707e59242b8ccbb6757a290938c2d39e5e Mon Sep 17 00:00:00 2001 From: Sarah Spall Date: Tue, 17 Sep 2024 20:25:46 + Subject: [PATCH 1/5] theoretically fix issue --- clang/lib/Sema/SemaType.cpp | 4 ++

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

2024-10-03 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 32ffc9fdc2cd422c88c926b862adb3de726e3888 ba56fbdc3c17b973dd4dd5757cf860447ba076d3 --e

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

2024-10-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Sarah Spall (spall) Changes Get inout/out parameters working for HLSL Arrays. Utilizes the fix from #109323, and corrects the assignment behavior slightly to allow for Non-LValues on the RHS. Closes #106917 --- Patch is 21.41 KiB, trunc

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

2024-10-03 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Sarah Spall (spall) Changes Get inout/out parameters working for HLSL Arrays. Utilizes the fix from #109323, and corrects the assignment behavior slightly to allow for Non-LValues on the RHS. Closes #106917 --- Patch is 21.41 K

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

2024-10-03 Thread Sarah Spall via cfe-commits
https://github.com/spall created https://github.com/llvm/llvm-project/pull/111047 Get inout/out parameters working for HLSL Arrays. Utilizes the fix from #109323, and corrects the assignment behavior slightly to allow for Non-LValues on the RHS. Closes #106917 >From c73ce3707e59242b8ccbb6757