Skip to content

Commit 77cb30e

Browse files
committed
Revert "[OpenMP][DeviceRTL] Fix the issue that multiple calls to omp_get_wtime is optimized out by mistake"
This reverts commit ad34f1d.
1 parent 5a44539 commit 77cb30e

File tree

4 files changed

+3
-80
lines changed

4 files changed

+3
-80
lines changed

llvm/include/llvm/Frontend/OpenMP/OMPKinds.def

+1-2
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ __OMP_RTL_ATTRS(omp_get_partition_num_places, GetterAttrs, AttributeSet(),
681681
ParamAttrs())
682682
__OMP_RTL_ATTRS(omp_get_partition_place_nums, GetterAttrs, AttributeSet(),
683683
ParamAttrs())
684-
__OMP_RTL_ATTRS(omp_get_wtime, GetterAttrs, AttributeSet(), ParamAttrs())
685684

686685
__OMP_RTL_ATTRS(omp_set_num_threads, SetterAttrs, AttributeSet(), ParamAttrs())
687686
__OMP_RTL_ATTRS(omp_set_dynamic, SetterAttrs, AttributeSet(), ParamAttrs())
@@ -920,7 +919,7 @@ __OMP_RTL_ATTRS(__kmpc_doacross_fini, BarrierAttrs, AttributeSet(),
920919

921920
__OMP_RTL_ATTRS(__kmpc_alloc_shared, AttributeSet(
922921
EnumAttr(NoUnwind),
923-
EnumAttr(NoSync),
922+
EnumAttr(NoSync),
924923
AllocSizeAttr(0, None)), ReturnPtrAttrs, ParamAttrs())
925924
__OMP_RTL_ATTRS(__kmpc_free_shared, DeviceAllocAttrs, AttributeSet(),
926925
ParamAttrs(NoCaptureAttrs))

openmp/libomptarget/DeviceRTL/src/Misc.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ double getWTick() {
5252

5353
double getWTime() {
5454
unsigned long long nsecs;
55-
asm volatile("mov.u64 %0, %%globaltimer;" : "=l"(nsecs));
55+
asm("mov.u64 %0, %%globaltimer;" : "=l"(nsecs));
5656
return (double)nsecs * getWTick();
5757
}
5858

openmp/libomptarget/test/lit.cfg

+1-53
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ for libomptarget_target in config.libomptarget_all_targets:
128128
# Is this target in the current system? If so create a compile, run and test
129129
# command. Otherwise create command that return false.
130130
if libomptarget_target == config.libomptarget_current_target:
131-
config.substitutions.append(("%libomptarget-compilexx-run-and-check-generic",
131+
config.substitutions.append(("%libomptarget-compilexx-run-and-check-generic",
132132
"%libomptarget-compilexx-run-and-check-" + libomptarget_target))
133133
config.substitutions.append(("%libomptarget-compile-run-and-check-generic",
134134
"%libomptarget-compile-run-and-check-" + libomptarget_target))
@@ -140,18 +140,6 @@ for libomptarget_target in config.libomptarget_all_targets:
140140
"%libomptarget-compilexx-" + libomptarget_target))
141141
config.substitutions.append(("%libomptarget-compile-generic",
142142
"%libomptarget-compile-" + libomptarget_target))
143-
config.substitutions.append(("%libomptarget-compileoptxx-run-and-check-generic",
144-
"%libomptarget-compileoptxx-run-and-check-" + libomptarget_target))
145-
config.substitutions.append(("%libomptarget-compileopt-run-and-check-generic",
146-
"%libomptarget-compileopt-run-and-check-" + libomptarget_target))
147-
config.substitutions.append(("%libomptarget-compileoptxx-and-run-generic",
148-
"%libomptarget-compileoptxx-and-run-" + libomptarget_target))
149-
config.substitutions.append(("%libomptarget-compileopt-and-run-generic",
150-
"%libomptarget-compileopt-and-run-" + libomptarget_target))
151-
config.substitutions.append(("%libomptarget-compileoptxx-generic",
152-
"%libomptarget-compileoptxx-" + libomptarget_target))
153-
config.substitutions.append(("%libomptarget-compileopt-generic",
154-
"%libomptarget-compileopt-" + libomptarget_target))
155143
config.substitutions.append(("%libomptarget-run-generic",
156144
"%libomptarget-run-" + libomptarget_target))
157145
config.substitutions.append(("%libomptarget-run-fail-generic",
@@ -186,28 +174,6 @@ for libomptarget_target in config.libomptarget_all_targets:
186174
config.substitutions.append(("%libomptarget-compile-" + \
187175
libomptarget_target, \
188176
"%clang-" + libomptarget_target + " %s -o %t"))
189-
config.substitutions.append(("%libomptarget-compileoptxx-run-and-check-" + \
190-
libomptarget_target, \
191-
"%libomptarget-compileoptxx-and-run-" + libomptarget_target + \
192-
" | " + config.libomptarget_filecheck + " %s"))
193-
config.substitutions.append(("%libomptarget-compileopt-run-and-check-" + \
194-
libomptarget_target, \
195-
"%libomptarget-compileopt-and-run-" + libomptarget_target + \
196-
" | " + config.libomptarget_filecheck + " %s"))
197-
config.substitutions.append(("%libomptarget-compileoptxx-and-run-" + \
198-
libomptarget_target, \
199-
"%libomptarget-compileoptxx-" + libomptarget_target + " && " + \
200-
"%libomptarget-run-" + libomptarget_target))
201-
config.substitutions.append(("%libomptarget-compileopt-and-run-" + \
202-
libomptarget_target, \
203-
"%libomptarget-compileopt-" + libomptarget_target + " && " + \
204-
"%libomptarget-run-" + libomptarget_target))
205-
config.substitutions.append(("%libomptarget-compileoptxx-" + \
206-
libomptarget_target, \
207-
"%clangxx-" + libomptarget_target + " -O3 %s -o %t"))
208-
config.substitutions.append(("%libomptarget-compileopt-" + \
209-
libomptarget_target, \
210-
"%clang-" + libomptarget_target + " -O3 %s -o %t"))
211177
config.substitutions.append(("%libomptarget-run-" + \
212178
libomptarget_target, \
213179
"%t"))
@@ -241,24 +207,6 @@ for libomptarget_target in config.libomptarget_all_targets:
241207
config.substitutions.append(("%libomptarget-compile-" + \
242208
libomptarget_target, \
243209
"echo ignored-command"))
244-
config.substitutions.append(("%libomptarget-compileopt-run-and-check-" + \
245-
libomptarget_target, \
246-
"echo ignored-command"))
247-
config.substitutions.append(("%libomptarget-compileoptxx-run-and-check-" + \
248-
libomptarget_target, \
249-
"echo ignored-command"))
250-
config.substitutions.append(("%libomptarget-compileopt-and-run-" + \
251-
libomptarget_target, \
252-
"echo ignored-command"))
253-
config.substitutions.append(("%libomptarget-compileoptxx-and-run-" + \
254-
libomptarget_target, \
255-
"echo ignored-command"))
256-
config.substitutions.append(("%libomptarget-compileoptxx-" + \
257-
libomptarget_target, \
258-
"echo ignored-command"))
259-
config.substitutions.append(("%libomptarget-compileopt-" + \
260-
libomptarget_target, \
261-
"echo ignored-command"))
262210
config.substitutions.append(("%libomptarget-run-" + \
263211
libomptarget_target, \
264212
"echo ignored-command"))

openmp/libomptarget/test/offloading/wtime.c

-24
This file was deleted.

0 commit comments

Comments
 (0)