Skip to content

Commit 61cea52

Browse files
committed
Ordering function names. Applying formatting. Updating test
1 parent b7a6883 commit 61cea52

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

flang/include/flang/Optimizer/Builder/IntrinsicCall.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,9 @@ struct IntrinsicLibrary {
393393
void genSignalSubroutine(llvm::ArrayRef<fir::ExtendedValue>);
394394
void genSleep(llvm::ArrayRef<fir::ExtendedValue>);
395395
void genSyncThreads(llvm::ArrayRef<fir::ExtendedValue>);
396-
mlir::Value genSyncThreadsAnd(mlir::Type,llvm::ArrayRef<mlir::Value>);
397-
mlir::Value genSyncThreadsCount(mlir::Type,llvm::ArrayRef<mlir::Value>);
398-
mlir::Value genSyncThreadsOr(mlir::Type,llvm::ArrayRef<mlir::Value>);
396+
mlir::Value genSyncThreadsAnd(mlir::Type, llvm::ArrayRef<mlir::Value>);
397+
mlir::Value genSyncThreadsCount(mlir::Type, llvm::ArrayRef<mlir::Value>);
398+
mlir::Value genSyncThreadsOr(mlir::Type, llvm::ArrayRef<mlir::Value>);
399399
fir::ExtendedValue genSystem(std::optional<mlir::Type>,
400400
mlir::ArrayRef<fir::ExtendedValue> args);
401401
void genSystemClock(llvm::ArrayRef<fir::ExtendedValue>);

flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,9 @@ static constexpr IntrinsicHandler handlers[]{
655655
{{{"count", asAddr}, {"count_rate", asAddr}, {"count_max", asAddr}}},
656656
/*isElemental=*/false},
657657
{"tand", &I::genTand},
658+
{"threadfence", &I::genThreadFence, {}, /*isElemental=*/false},
659+
{"threadfence_block", &I::genThreadFenceBlock, {}, /*isElemental=*/false},
660+
{"threadfence_system", &I::genThreadFenceSystem, {}, /*isElemental=*/false},
658661
{"trailz", &I::genTrailz},
659662
{"transfer",
660663
&I::genTransfer,
@@ -664,9 +667,6 @@ static constexpr IntrinsicHandler handlers[]{
664667
&I::genTranspose,
665668
{{{"matrix", asAddr}}},
666669
/*isElemental=*/false},
667-
{"threadfence", &I::genThreadFence, {}, /*isElemental=*/false},
668-
{"threadfence_block", &I::genThreadFenceBlock, {}, /*isElemental=*/false},
669-
{"threadfence_system", &I::genThreadFenceSystem, {}, /*isElemental=*/false},
670670
{"trim", &I::genTrim, {{{"string", asAddr}}}, /*isElemental=*/false},
671671
{"ubound",
672672
&I::genUbound,

flang/test/Lower/CUDA/cuda-device-proc.cuf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ end
1919
! CHECK-LABEL: func.func @_QPdevsub() attributes {cuf.proc_attr = #cuf.cuda_proc<global>}
2020
! CHECK: fir.call @llvm.nvvm.barrier0() fastmath<contract> : () -> ()
2121
! CHECK: fir.call @__syncwarp(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (!fir.ref<i32>) -> ()
22-
! CHECK: fir.call @__threadfence()
23-
! CHECK: fir.call @__threadfence_block()
24-
! CHECK: fir.call @__threadfence_system()
22+
! CHECK: fir.call @llvm.nvvm.membar.gl() fastmath<contract> : () -> ()
23+
! CHECK: fir.call @llvm.nvvm.membar.cta() fastmath<contract> : () -> ()
24+
! CHECK: fir.call @llvm.nvvm.membar.sys() fastmath<contract> : () -> ()
2525
! CHECK: %{{.*}} = fir.call @llvm.nvvm.barrier0.and(%c1_i32_0) fastmath<contract> : (i32) -> i32
2626
! CHECK: %{{.*}} = fir.call @llvm.nvvm.barrier0.popc(%c1_i32_1) fastmath<contract> : (i32) -> i32
2727
! CHECK: %{{.*}} = fir.call @llvm.nvvm.barrier0.or(%c1_i32_2) fastmath<contract> : (i32) -> i32
2828

29-
! CHECK: func.func private @__syncthreads() attributes {cuf.proc_attr = #cuf.cuda_proc<device>, fir.bindc_name = "__syncthreads", fir.proc_attrs = #fir.proc_attrs<bind_c>}
29+
! CHECK: func.func private @llvm.nvvm.barrier0()
3030
! CHECK: func.func private @__syncwarp(!fir.ref<i32> {cuf.data_attr = #cuf.cuda<device>}) attributes {cuf.proc_attr = #cuf.cuda_proc<device>, fir.bindc_name = "__syncwarp", fir.proc_attrs = #fir.proc_attrs<bind_c>}
31-
! CHECK: func.func private @__threadfence() attributes {cuf.proc_attr = #cuf.cuda_proc<device>, fir.bindc_name = "__threadfence", fir.proc_attrs = #fir.proc_attrs<bind_c>}
32-
! CHECK: func.func private @__threadfence_block() attributes {cuf.proc_attr = #cuf.cuda_proc<device>, fir.bindc_name = "__threadfence_block", fir.proc_attrs = #fir.proc_attrs<bind_c>}
33-
! CHECK: func.func private @__threadfence_system() attributes {cuf.proc_attr = #cuf.cuda_proc<device>, fir.bindc_name = "__threadfence_system", fir.proc_attrs = #fir.proc_attrs<bind_c>}
34-
! CHECK: func.func private @__syncthreads_and(!fir.ref<i32> {cuf.data_attr = #cuf.cuda<device>}) -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc<device>, fir.bindc_name = "__syncthreads_and", fir.proc_attrs = #fir.proc_attrs<bind_c>}
35-
! CHECK: func.func private @__syncthreads_count(!fir.ref<i32> {cuf.data_attr = #cuf.cuda<device>}) -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc<device>, fir.bindc_name = "__syncthreads_count", fir.proc_attrs = #fir.proc_attrs<bind_c>}
36-
! CHECK: func.func private @__syncthreads_or(!fir.ref<i32> {cuf.data_attr = #cuf.cuda<device>}) -> i32 attributes {cuf.proc_attr = #cuf.cuda_proc<device>, fir.bindc_name = "__syncthreads_or", fir.proc_attrs = #fir.proc_attrs<bind_c>}
31+
! CHECK: func.func private @llvm.nvvm.membar.gl()
32+
! CHECK: func.func private @llvm.nvvm.membar.cta()
33+
! CHECK: func.func private @llvm.nvvm.membar.sys()
34+
! CHECK: func.func private @llvm.nvvm.barrier0.and(i32) -> i32
35+
! CHECK: func.func private @llvm.nvvm.barrier0.popc(i32) -> i32
36+
! CHECK: func.func private @llvm.nvvm.barrier0.or(i32) -> i32

0 commit comments

Comments
 (0)