Skip to content

Commit 8f8fc16

Browse files
eternastudentoigcbot
authored andcommitted
Set r coordinate correctly for predication of a typed atomic
All 3 coordinates u, v and r need to be set to corresponding atomic variables when generating a destination buffer load for a typed atomic.
1 parent ee5bffc commit 8f8fc16

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

IGC/Compiler/CustomSafeOptPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7207,7 +7207,7 @@ void InsertBranchOpt::atomicSplitOpt(Function& F, int mode)
72077207
ld_FunctionArgList[ 0 ] = inst->getOperand( 0 );
72087208
ld_FunctionArgList[ 1 ] = inst->getOperand( 1 );
72097209
ld_FunctionArgList[ 2 ] = inst->getOperand( 2 );
7210-
ld_FunctionArgList[ 3 ] = zero;
7210+
ld_FunctionArgList[ 3 ] = inst->getOperand( 3 );
72117211
ld_FunctionArgList[ 4 ] = zero;
72127212
NewInst = builder.CreateCall( pLdIntrinsic, ld_FunctionArgList );
72137213
}

IGC/Compiler/tests/InsertBranchOpt/atomic-split-typed-pointers.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ define void @test_atomic_split(i32* %src1) {
2121
; CHECK: [[TMP3:%.*]] = call i32 @llvm.genx.GenISA.intatomictyped.i32.p0i32(i32* [[SRC1]], i32 1, i32 2, i32 3, i32 [[TMP1]], i32 1)
2222
; CHECK: br label %[[ATOMIC_IF_END:.*]]
2323
; CHECK: [[ATOMIC_IF_FALSE]]:
24-
; CHECK: [[TMP4:%.*]] = call <4 x float> @llvm.genx.GenISA.typedread.p0i32(i32* [[SRC1]], i32 1, i32 2, i32 0, i32 0)
24+
; CHECK: [[TMP4:%.*]] = call <4 x float> @llvm.genx.GenISA.typedread.p0i32(i32* [[SRC1]], i32 1, i32 2, i32 3, i32 0)
2525
; CHECK: [[TMP5:%.*]] = extractelement <4 x float> [[TMP4]], i64 0
2626
; CHECK: [[TMP6:%.*]] = bitcast float [[TMP5]] to i32
2727
; CHECK: br label %[[ATOMIC_IF_END]]

IGC/Compiler/tests/InsertBranchOpt/atomic-split.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ define void @test_atomic_split(ptr %src1) {
2121
; CHECK: [[TMP3:%.*]] = call i32 @llvm.genx.GenISA.intatomictyped.i32.p0(ptr [[SRC1]], i32 1, i32 2, i32 3, i32 [[TMP1]], i32 1)
2222
; CHECK: br label %[[ATOMIC_IF_END:.*]]
2323
; CHECK: [[ATOMIC_IF_FALSE]]:
24-
; CHECK: [[TMP4:%.*]] = call <4 x float> @llvm.genx.GenISA.typedread.p0(ptr [[SRC1]], i32 1, i32 2, i32 0, i32 0)
24+
; CHECK: [[TMP4:%.*]] = call <4 x float> @llvm.genx.GenISA.typedread.p0(ptr [[SRC1]], i32 1, i32 2, i32 3, i32 0)
2525
; CHECK: [[TMP5:%.*]] = extractelement <4 x float> [[TMP4]], i64 0
2626
; CHECK: [[TMP6:%.*]] = bitcast float [[TMP5]] to i32
2727
; CHECK: br label %[[ATOMIC_IF_END]]

IGC/Compiler/tests/InsertBranchOpt/atomic_branch_mode1-typed-pointers.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ define i32 @atomicIadd0Typed(i32 %mem, i32 %val) {
5050
; CHECK-NEXT: [[ATOMIC:%.*]] = call i32 @llvm.genx.GenISA.intatomictyped.i32.p131073v4f32(<4 x float> addrspace(131073)* null, i32 [[U]], i32 [[LOCALID_Z]], i32 [[ADDBEFORE]], i32 [[SOMEUNKNOWN]], i32 0)
5151
; CHECK-NEXT: br label [[ATOMIC_IF_END:%.*]]
5252
; CHECK: atomic.if.false:
53-
; CHECK-NEXT: [[TMP3:%.*]] = call <4 x float> @llvm.genx.GenISA.typedread.p131073v4f32(<4 x float> addrspace(131073)* null, i32 [[U]], i32 [[LOCALID_Z]], i32 0, i32 0)
53+
; CHECK-NEXT: [[TMP3:%.*]] = call <4 x float> @llvm.genx.GenISA.typedread.p131073v4f32(<4 x float> addrspace(131073)* null, i32 [[U]], i32 [[LOCALID_Z]], i32 [[ADDBEFORE]], i32 0)
5454
; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x float> [[TMP3]], i64 0
5555
; CHECK-NEXT: [[TMP5:%.*]] = bitcast float [[TMP4]] to i32
5656
; CHECK-NEXT: br label [[ATOMIC_IF_END]]

IGC/Compiler/tests/InsertBranchOpt/atomic_branch_mode1.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ define i32 @atomicIadd0Typed(i32 %mem, i32 %val) {
5050
; CHECK-NEXT: [[ATOMIC:%.*]] = call i32 @llvm.genx.GenISA.intatomictyped.i32.p131073(ptr addrspace(131073) null, i32 [[U]], i32 [[LOCALID_Z]], i32 [[ADDBEFORE]], i32 [[SOMEUNKNOWN]], i32 0)
5151
; CHECK-NEXT: br label [[ATOMIC_IF_END:%.*]]
5252
; CHECK: atomic.if.false:
53-
; CHECK-NEXT: [[TMP3:%.*]] = call <4 x float> @llvm.genx.GenISA.typedread.p131073(ptr addrspace(131073) null, i32 [[U]], i32 [[LOCALID_Z]], i32 0, i32 0)
53+
; CHECK-NEXT: [[TMP3:%.*]] = call <4 x float> @llvm.genx.GenISA.typedread.p131073(ptr addrspace(131073) null, i32 [[U]], i32 [[LOCALID_Z]], i32 [[ADDBEFORE]], i32 0)
5454
; CHECK-NEXT: [[TMP4:%.*]] = extractelement <4 x float> [[TMP3]], i64 0
5555
; CHECK-NEXT: [[TMP5:%.*]] = bitcast float [[TMP4]] to i32
5656
; CHECK-NEXT: br label [[ATOMIC_IF_END]]

0 commit comments

Comments
 (0)