Skip to content

Commit b4d0e69

Browse files
committed
code review feedback - update comments and tests
1 parent 6469308 commit b4d0e69

File tree

3 files changed

+42
-35
lines changed

3 files changed

+42
-35
lines changed

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static Value *initializeLocalResourceArray(
207207
llvm::IntegerType *IntTy = CGF.CGM.IntTy;
208208
llvm::Value *Index = StartIndex;
209209
llvm::Value *One = llvm::ConstantInt::get(IntTy, 1);
210-
uint64_t ArraySize = ArrayTy->getSExtSize();
210+
const uint64_t ArraySize = ArrayTy->getSExtSize();
211211
QualType ElemType = ArrayTy->getElementType();
212212
Address TmpArrayAddr = ValueSlot.getAddress();
213213

@@ -216,23 +216,22 @@ static Value *initializeLocalResourceArray(
216216
SmallVector<llvm::Value *> GEPIndices(PrevGEPIndices);
217217
GEPIndices.push_back(llvm::ConstantInt::get(IntTy, 0));
218218

219-
// array of arrays - recursively initialize the sub-arrays
219+
// For array of arrays, recursively initialize the sub-arrays.
220220
if (ElemType->isArrayType()) {
221221
const ConstantArrayType *SubArrayTy = cast<ConstantArrayType>(ElemType);
222222
for (uint64_t I = 0; I < ArraySize; I++) {
223223
if (I > 0) {
224224
Index = CGF.Builder.CreateAdd(Index, One);
225225
GEPIndices.back() = llvm::ConstantInt::get(IntTy, I);
226226
}
227-
// recursively initialize the sub-array
228227
Index = initializeLocalResourceArray(
229228
CGF, ValueSlot, SubArrayTy, CD, Range, Index, ResourceName, RBA,
230229
VkBinding, GEPIndices, ArraySubsExprLoc);
231230
}
232231
return Index;
233232
}
234233

235-
// array of resources - initialize each resource in the array
234+
// For array of resources, initialize each resource in the array.
236235
llvm::Type *Ty = CGF.ConvertTypeForMem(ElemType);
237236
CharUnits ElemSize = CD->getASTContext().getTypeSizeInChars(ElemType);
238237
CharUnits Align =
@@ -901,25 +900,25 @@ std::optional<LValue> CGHLSLRuntime::emitResourceArraySubscriptExpr(
901900
ASE = dyn_cast<ArraySubscriptExpr>(ASE->getBase()->IgnoreParenImpCasts());
902901
}
903902

904-
// find binding info for the resource array (for implicit binding
905-
// an HLSLResourceBindingAttr should have been added by SemaHLSL)
903+
// Find binding info for the resource array. For implicit binding
904+
// an HLSLResourceBindingAttr should have been added by SemaHLSL.
906905
HLSLVkBindingAttr *VkBinding = ArrayDecl->getAttr<HLSLVkBindingAttr>();
907906
HLSLResourceBindingAttr *RBA = ArrayDecl->getAttr<HLSLResourceBindingAttr>();
908907
assert((VkBinding || RBA) && "resource array must have a binding attribute");
909908

910-
// Find the individual resource type
909+
// Find the individual resource type.
911910
QualType ResultTy = ArraySubsExpr->getType();
912911
QualType ResourceTy =
913912
ResultTy->isArrayType() ? AST.getBaseElementType(ResultTy) : ResultTy;
914913

915-
// lookup the resource class constructor based on the resource type and
916-
// binding
914+
// Lookup the resource class constructor based on the resource type and
915+
// binding.
917916
CXXConstructorDecl *CD = findResourceConstructorDecl(
918917
AST, ResourceTy, VkBinding || RBA->hasRegisterSlot());
919918

920-
// create a temporary variable for the result, which is either going
919+
// Create a temporary variable for the result, which is either going
921920
// to be a single resource instance or a local array of resources (we need to
922-
// return an LValue)
921+
// return an LValue).
923922
RawAddress TmpVar = CGF.CreateMemTemp(ResultTy);
924923
if (CGF.EmitLifetimeStart(TmpVar.getPointer()))
925924
CGF.pushFullExprCleanup<CodeGenFunction::CallLifetimeEnd>(
@@ -931,27 +930,28 @@ std::optional<LValue> CGHLSLRuntime::emitResourceArraySubscriptExpr(
931930
AggValueSlot::DoesNotOverlap);
932931
Address TmpVarAddress = ValueSlot.getAddress();
933932

934-
// get total array size (= range size)
933+
// Calculate total array size (= range size).
935934
llvm::Value *Range =
936935
llvm::ConstantInt::get(CGM.IntTy, getTotalArraySize(AST, ResArrayTy));
937936

938-
// if the result of the subscript operation is a single resource - call the
939-
// constructor
937+
// If the result of the subscript operation is a single resource, call the
938+
// constructor.
940939
if (ResultTy == ResourceTy) {
941940
QualType ThisType = CD->getThisType()->getPointeeType();
942941
llvm::Value *ThisPtr = CGF.getAsNaturalPointerTo(TmpVarAddress, ThisType);
943942

944-
// assemble the constructor parameters
943+
// Assemble the constructor parameters.
945944
CallArgList Args;
946945
createResourceCtorArgs(CGM, CD, ThisPtr, Range, Index, ArrayDecl->getName(),
947946
RBA, VkBinding, Args);
948-
// call the constructor
947+
// Call the constructor.
949948
CGF.EmitCXXConstructorCall(CD, Ctor_Complete, false, false, TmpVarAddress,
950949
Args, ValueSlot.mayOverlap(),
951950
ArraySubsExpr->getExprLoc(),
952951
ValueSlot.isSanitizerChecked());
953952
} else {
954-
// result of the subscript operation is a local resource array
953+
// The result of the subscript operation is a local resource array which
954+
// needs to be initialized.
955955
const ConstantArrayType *ArrayTy =
956956
cast<ConstantArrayType>(ResultTy.getTypePtr());
957957
initializeLocalResourceArray(CGF, ValueSlot, ArrayTy, CD, Range, Index,

clang/test/CodeGenHLSL/resources/res-array-global-subarray-many.hlsl

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
RWBuffer<float> A[5][4][3][2] : register(u10, space2);
77
RWStructuredBuffer<float> Out;
88

9+
// CHECK: define {{.*}} float @_Z3fooA3_A2_N4hlsl8RWBufferIfEE(ptr noundef byval([3 x [2 x %"class.hlsl::RWBuffer"]]) align 4 %Arr)
10+
// CHECK-NEXT: entry:
911
float foo(RWBuffer<float> Arr[3][2]) {
12+
// CHECK-NEXT: %[[Arr_1_Ptr:.*]] = getelementptr inbounds [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %Arr, i32 0, i32 1
13+
// CHECK-NEXT: %[[Arr_1_0_Ptr:.*]] = getelementptr inbounds [2 x %"class.hlsl::RWBuffer"], ptr %[[Arr_1_Ptr]], i32 0, i32 0
14+
// CHECK-NEXT: %[[BufPtr:.*]] = call {{.*}} ptr @_ZN4hlsl8RWBufferIfEixEj(ptr {{.*}} %[[Arr_1_0_Ptr]], i32 noundef 0)
15+
// CHECK-NEXT: %[[Value:.*]] = load float, ptr %[[BufPtr]], align 4
16+
// CHECK-NEXT: ret float %[[Value]]
1017
return Arr[1][0][0];
1118
}
1219

@@ -32,17 +39,17 @@ void main(uint GI : SV_GroupThreadID) {
3239
// The resource index for A[4][1][0][0] is 102 = 4 * (4 * 3 * 2) + 1 * (3 * 2)
3340
// (index in the resource array as if it was flattened)
3441
// CHECK-NEXT: %[[Ptr_Tmp0_0_0:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %tmp, i32 0, i32 0, i32 0
35-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_0_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 102, ptr noundef @A.str) #6
42+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_0_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 102, ptr noundef @[[BufA]])
3643
// CHECK-NEXT: %[[Ptr_Tmp0_0_1:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %tmp, i32 0, i32 0, i32 1
37-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_0_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 103, ptr noundef @A.str) #6
44+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_0_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 103, ptr noundef @[[BufA]])
3845
// CHECK-NEXT: %[[Ptr_Tmp0_1_0:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %tmp, i32 0, i32 1, i32 0
39-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_1_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 104, ptr noundef @A.str) #6
46+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_1_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 104, ptr noundef @[[BufA]])
4047
// CHECK-NEXT: %[[Ptr_Tmp0_1_1:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %tmp, i32 0, i32 1, i32 1
41-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_1_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 105, ptr noundef @A.str) #6
48+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_1_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 105, ptr noundef @[[BufA]])
4249
// CHECK-NEXT: %[[Ptr_Tmp0_2_0:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %tmp, i32 0, i32 2, i32 0
43-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_2_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 106, ptr noundef @A.str) #6
50+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_2_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 106, ptr noundef @[[BufA]])
4451
// CHECK-NEXT: %[[Ptr_Tmp0_2_1:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %tmp, i32 0, i32 2, i32 1
45-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_2_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 107, ptr noundef @A.str) #6
52+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_2_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef 107, ptr noundef @[[BufA]])
4653
// After this Tmp0 values are copied to %Sub using the standard array loop initializaion
4754
// (generated from ArrayInitLoopExpr AST node)
4855
RWBuffer<float> Sub[3][2] = A[4][1];
@@ -52,7 +59,7 @@ void main(uint GI : SV_GroupThreadID) {
5259
// CHECK-NEXT: %[[BufPtr:.*]] = call {{.*}} ptr @_ZN4hlsl8RWBufferIfEixEj(ptr {{.*}} %[[Ptr_Sub_2_1]], i32 noundef 0)
5360
// CHECK-NEXT: %[[Sub_2_1_0_Value:.*]] = load float, ptr %[[BufPtr]], align 4
5461
// CHECK-NEXT: store float %[[Sub_2_1_0_Value]], ptr %a, align 4
55-
float a = Sub[2][1][0];
62+
float a = Sub[2][1][0];
5663

5764
// Codegen for "foo(A[2][GI])" - create local array [[Tmp2]] of size 3 x 2 and initialize
5865
// each element by a call to the resource constructor with dynamic index, and then
@@ -66,32 +73,32 @@ float a = Sub[2][1][0];
6673

6774
// A[2][GI][0][0]
6875
// CHECK-NEXT: %[[Ptr_Tmp2_0_0:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %[[Tmp2]], i32 0, i32 0, i32 0
69-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_0_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_0_0]], ptr noundef @A.str)
76+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_0_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_0_0]], ptr noundef @[[BufA]])
7077

7178
// A[2][GI][0][1]
7279
// CHECK-NEXT: %[[Index_A_2_GI_0_1:.*]] = add i32 %[[Index_A_2_GI_0_0]], 1
7380
// CHECK-NEXT: %[[Ptr_Tmp2_0_1:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %[[Tmp2]], i32 0, i32 0, i32 1
74-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_0_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_0_1]], ptr noundef @A.str)
81+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_0_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_0_1]], ptr noundef @[[BufA]])
7582

7683
// A[2][GI][1][0]
7784
// CHECK-NEXT: %[[Index_A_2_GI_1_0:.*]] = add i32 %[[Index_A_2_GI_0_1]], 1
7885
// CHECK-NEXT: %[[Ptr_Tmp2_1_0:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %[[Tmp2]], i32 0, i32 1, i32 0
79-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_1_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_1_0]], ptr noundef @A.str)
86+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_1_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_1_0]], ptr noundef @[[BufA]])
8087

8188
// A[2][GI][1][1]
8289
// CHECK-NEXT: %[[Index_A_2_GI_1_1:.*]] = add i32 %[[Index_A_2_GI_1_0]], 1
8390
// CHECK-NEXT: %[[Ptr_Tmp2_1_1:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %[[Tmp2]], i32 0, i32 1, i32 1
84-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_1_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_1_1]], ptr noundef @A.str)
91+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_1_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_1_1]], ptr noundef @[[BufA]])
8592

8693
// A[2][GI][2][0]
8794
// CHECK-NEXT: %[[Index_A_2_GI_2_0:.*]] = add i32 %[[Index_A_2_GI_1_1]], 1
8895
// CHECK-NEXT: %[[Ptr_Tmp2_2_0:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %[[Tmp2]], i32 0, i32 2, i32 0
89-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_2_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_2_0]], ptr noundef @A.str)
96+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_2_0]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_2_0]], ptr noundef @[[BufA]])
9097

9198
// A[2][GI][2][1]
9299
// CHECK-NEXT: %[[Index_A_2_GI_2_1:.*]] = add i32 %[[Index_A_2_GI_2_0]], 1
93100
// CHECK-NEXT: %[[Ptr_Tmp2_2_1:.*]] = getelementptr [3 x [2 x %"class.hlsl::RWBuffer"]], ptr %[[Tmp2]], i32 0, i32 2, i32 1
94-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_2_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_2_1]], ptr noundef @A.str)
101+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_2_1]], i32 noundef 10, i32 noundef 2, i32 noundef 120, i32 noundef %[[Index_A_2_GI_2_1]], ptr noundef @[[BufA]])
95102

96103
// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 %[[Tmp1]], ptr align 4 %[[Tmp2]], i32 24, i1 false)
97104
// CHECK-NEXT: %[[FooReturned:.*]] = call {{.*}} float @_Z3fooA3_A2_N4hlsl8RWBufferIfEE(ptr noundef byval([3 x [2 x %"class.hlsl::RWBuffer"]]) align 4 %[[Tmp1]])

clang/test/CodeGenHLSL/resources/res-array-global-subarray-one.hlsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ void main(uint GI : SV_GroupThreadID) {
3030
// Codegen for "A[2]" - create local array [[Tmp0]] of size 2 and initialize
3131
// each element by a call to the resource constructor
3232
// CHECK-NEXT: %[[Ptr_Tmp0_0:.*]] = getelementptr [2 x %"class.hlsl::RWBuffer"], ptr %[[Tmp0]], i32 0, i32 0
33-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_0]], i32 noundef 10, i32 noundef 2, i32 noundef 8, i32 noundef 6, ptr noundef @A.str)
33+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_0]], i32 noundef 10, i32 noundef 2, i32 noundef 8, i32 noundef 6, ptr noundef @[[BufA]])
3434
// CHECK-NEXT: %[[Ptr_Tmp0_1:.*]] = getelementptr [2 x %"class.hlsl::RWBuffer"], ptr %[[Tmp0]], i32 0, i32 1
35-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_1]], i32 noundef 10, i32 noundef 2, i32 noundef 8, i32 noundef 7, ptr noundef @A.str)
35+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp0_1]], i32 noundef 10, i32 noundef 2, i32 noundef 8, i32 noundef 7, ptr noundef @[[BufA]])
3636
// After this Tmp0 values are copied to %Sub using the standard array loop initializaion
3737
// (generated from ArrayInitLoopExpr AST node)
3838
RWBuffer<float> Sub[2] = A[3];
@@ -41,18 +41,18 @@ void main(uint GI : SV_GroupThreadID) {
4141
// CHECK-NEXT: %[[BufPtr:.*]] = call {{.*}} ptr @_ZN4hlsl8RWBufferIfEixEj(ptr {{.*}} %[[Ptr_Sub_1]], i32 noundef 0)
4242
// CHECK-NEXT: %[[Sub_1_0_Value:.*]] = load float, ptr %[[BufPtr]], align 4
4343
// CHECK-NEXT: store float %[[Sub_1_0_Value]], ptr %a, align 4
44-
float a = Sub[1][0];
44+
float a = Sub[1][0];
4545

4646
// Codegen for "foo(A[GI])" - create local array [[Tmp2]] of size 2 and initialize
4747
// each element by a call to the resource constructor with dynamic index, and then
4848
// copy-in the array as an argument of "foo"
4949
// CHECK: %[[GI:.*]] = load i32, ptr %[[GI_alloca]], align 4
5050
// CHECK-NEXT: %[[Index_A_GI_0:.*]] = mul i32 %[[GI]], 2
5151
// CHECK-NEXT: %[[Ptr_Tmp2_GI_0:.*]] = getelementptr [2 x %"class.hlsl::RWBuffer"], ptr %[[Tmp2]], i32 0, i32 0
52-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_GI_0]], i32 noundef 10, i32 noundef 2, i32 noundef 8, i32 noundef %[[Index_A_GI_0]], ptr noundef @A.str)
52+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_GI_0]], i32 noundef 10, i32 noundef 2, i32 noundef 8, i32 noundef %[[Index_A_GI_0]], ptr noundef @[[BufA]])
5353
// CHECK-NEXT: %[[Index_A_GI_1:.*]] = add i32 %[[Index_A_GI_0]], 1
5454
// CHECK-NEXT: %[[Ptr_Tmp2_GI_1:.*]] = getelementptr [2 x %"class.hlsl::RWBuffer"], ptr %[[Tmp2]], i32 0, i32 1
55-
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_GI_1]], i32 noundef 10, i32 noundef 2, i32 noundef 8, i32 noundef %[[Index_A_GI_1]], ptr noundef @A.str)
55+
// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIfEC1EjjijPKc(ptr {{.*}} %[[Ptr_Tmp2_GI_1]], i32 noundef 10, i32 noundef 2, i32 noundef 8, i32 noundef %[[Index_A_GI_1]], ptr noundef @[[BufA]])
5656
// CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 %[[Tmp1]], ptr align 4 %[[Tmp2]], i32 8, i1 false)
5757
// CHECK-NEXT: %[[FooReturned:.*]] = call {{.*}} float @_Z3fooA2_N4hlsl8RWBufferIfEE(ptr noundef byval([2 x %"class.hlsl::RWBuffer"]) align 4 %[[Tmp1]])
5858
// CHECK-NEXT: store float %[[FooReturned]], ptr %b, align 4

0 commit comments

Comments
 (0)