File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,7 @@ void SPIRVToOCL20::visitCallSPIRVMemoryBarrier(CallInst *CI) {
111
111
M, CI,
112
112
[=](CallInst *, std::vector<Value *> &Args) {
113
113
Value *MemScope =
114
- getInt32 (M, rmap<OCLScopeKind>(static_cast <Scope>(
115
- cast<ConstantInt>(Args[0 ])->getZExtValue ())));
114
+ SPIRV::transSPIRVMemoryScopeIntoOCLMemoryScope (Args[0 ], CI);
116
115
Value *MemFenceFlags =
117
116
SPIRV::transSPIRVMemorySemanticsIntoOCLMemFenceFlags (Args[1 ], CI);
118
117
Value *MemOrder =
Original file line number Diff line number Diff line change 6
6
3 MemoryModel 1 2
7
7
3 Source 3 102000
8
8
4 Name 5 "test"
9
- 3 Name 6 "val "
9
+ 3 Name 6 "val1 "
10
10
4 Name 7 "entry"
11
+ 3 Name 9 "val2"
11
12
6 Decorate 5 LinkageAttributes "test" Export
12
13
4 TypeInt 3 32 0
13
14
4 Constant 3 8 2
14
15
2 TypeVoid 2
15
- 4 TypeFunction 4 2 3
16
+ 5 TypeFunction 4 2 3 3
16
17
17
18
5 Function 2 5 0 4
18
19
3 FunctionParameter 3 6
20
+ 3 FunctionParameter 3 9
19
21
20
22
2 Label 7
21
23
3 MemoryBarrier 8 6
24
+ 3 MemoryBarrier 9 6
22
25
1 Return
23
26
24
27
1 FunctionEnd
30
33
; RUN: llvm-spirv -r %t.spv --spirv-target-env=CL2.0 -o %t.bc
31
34
; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefixes CHECK,CHECK-20
32
35
33
- ; CHECK: define spir_func void @test(i32 %val )
34
- ; CHECK: %call = call spir_func i32 @__translate_spirv_memory_fence(i32 %val )
36
+ ; CHECK: define spir_func void @test(i32 %[[VAL1:[a-zA-Z0-9]+]], i32 %[[VAL2:[a-zA-Z0-9]+]] )
37
+ ; CHECK: %call = call spir_func i32 @__translate_spirv_memory_fence(i32 %[[VAL1]] )
35
38
; CHECK-12: call spir_func void @_Z9mem_fencej(i32 %call)
36
- ; CHECK-20: %call1 = call spir_func i32 @__translate_spirv_memory_order(i32 %val)
39
+ ; CHECK-12: %call1 = call spir_func i32 @__translate_spirv_memory_fence(i32 %[[VAL1]])
40
+ ; CHECK-12: call spir_func void @_Z9mem_fencej(i32 %call1)
41
+ ; CHECK-20: %call1 = call spir_func i32 @__translate_spirv_memory_order(i32 %[[VAL1]])
37
42
; CHECK-20: call spir_func void @_Z22atomic_work_item_fencej12memory_order12memory_scope(i32 %call, i32 %call1
43
+ ; CHECK-20: %call2 = call spir_func i32 @__translate_spirv_memory_scope(i32 %[[VAL2]])
44
+ ; CHECK-20: %call3 = call spir_func i32 @__translate_spirv_memory_fence(i32 %[[VAL1]])
45
+ ; CHECK-20: %call4 = call spir_func i32 @__translate_spirv_memory_order(i32 %[[VAL1]])
46
+ ; CHECK-20: call spir_func void @_Z22atomic_work_item_fencej12memory_order12memory_scope(i32 %call3, i32 %call4, i32 %call2)
38
47
; CHECK: define private spir_func i32 @__translate_spirv_memory_fence(i32 %key)
39
48
; CHECK: entry:
40
49
; CHECK: %key.masked = and i32 2816, %key
You can’t perform that action at this time.
0 commit comments