Skip to content

Commit

Permalink
Use expansion for settin -O0 or /Od
Browse files Browse the repository at this point in the history
  • Loading branch information
ayylol committed Sep 10, 2024
1 parent d8f1292 commit 7ba92eb
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion sycl/test-e2e/Config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// RUN: %{build} %debug_option %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} %debug_option %no_opt -o %t.out
// RUN: echo SYCL_PRINT_EXECUTION_GRAPH=always > %t.cfg
// RUN: env SYCL_CONFIG_FILE_NAME=%t.cfg %t.out
// RUN: cat *.dot > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Config/env_vars.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// REQUIRES: opencl
// Env vars are used to pass OpenCL-specific flags to PI compiling/linking.
//
// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} %no_opt -o %t.out
//
// RUN: env SYCL_PROGRAM_COMPILE_OPTIONS="-g" %{run} %t.out
// RUN: env SYCL_PROGRAM_APPEND_COMPILE_OPTIONS="-g" %{run} %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/slm_alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// RUN: %{run} %t.2.out

// Check if the test sill passes with O0
// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t.3.out
// RUN: %{build} %no_opt -o %t.3.out
// RUN: %{run} %t.3.out

// This is end-to-end test for the slm_allocator API used together with the
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/slm_alloc_many_kernels_many_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// RUN: %{run} %t.2.out

// Check if the test sill passes with O0
// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t.3.out
// RUN: %{build} %no_opt -o %t.3.out
// RUN: %{run} %t.3.out

// Checks validity of SLM frame offsets in case of complex call graph with two
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/ESIMD/slm_alloc_many_kernels_one_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// RUN: %{run} %t.2.out

// Check if the test sill passes with O0
// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t.3.out
// RUN: %{build} %no_opt -o %t.3.out
// RUN: %{run} %t.3.out

// Check that SLM frame offset of a function foo called from two kernels Test1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t_O0.out
// RUN: %{build} %no_opt -o %t_O0.out
// RUN: %{run} %t_O0.out

/*
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/HierPar/hier_par_wgscope_O0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} %no_opt -o %t.out

// RUN: %{run} %t.out

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/NewOffloadDriver/aot-cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// RUN: %{run} %t.out

// Test -O0 with `--offload-new-driver`
// RUN: %clangxx %if cl_options %{/Od%} %else %{-O0%} -fsycl -fsycl-targets=spir64-x86_64 %S/Inputs/aot.cpp
// RUN: %clangxx %no_opt -fsycl -fsycl-targets=spir64-x86_64 %S/Inputs/aot.cpp
// RUN: %{run} %t.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// requires: cpu, gpu, accelerator
// UNSUPPORTED: hip
// FIXME: enable the test back, see intel/llvm#8146
// RUN: %{build} -Wno-error=incorrect-sub-group-size %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} -Wno-error=incorrect-sub-group-size %no_opt -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: cpu

// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} %no_opt -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: opencl

// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t0.out
// RUN: %{build} %no_opt -o %t0.out
// RUN: %if !acc %{ env SYCL_UR_TRACE=2 %{run} %t0.out 2>&1 | FileCheck %s --check-prefixes=CHECKOCL0 %}
// RUN: %{build} -O1 -o %t1.out
// RUN: %if !acc %{ env SYCL_UR_TRACE=2 %{run} %t1.out 2>&1 | FileCheck %s --check-prefixes=CHECKOCL1 %}
Expand All @@ -9,7 +9,7 @@
// RUN: %{build} -O3 -o %t3.out
// RUN: %if !acc %{ env SYCL_UR_TRACE=2 %{run} %t3.out 2>&1 | FileCheck %s --check-prefixes=CHECKOCL3 %}

// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} %no_opt -o %t.out
// RUN: %{run} %t.out

// This test verifies the propagation of front-end compiler optimization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %{build} -g -o %t.out
// RUN: %{build} -g %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} -g %no_opt -o %t.out
// RUN: %{build} -g -O2 -o %t.out
//
// The idea of this test is to make sure that we can compile the following
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/DAE-separate-compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// The test checks that the scenario works correctly.
//
// RUN: %{build} -O2 -c -o %t.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.o %if cl_options %{/Od%} %else %{-O0%} -Wno-unused-command-line-argument -o %t.out
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.o %no_opt -Wno-unused-command-line-argument -o %t.out
// RUN: %{run} %t.out

// Failing on HIP AMD, enable after fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -O0 is necessary; on higher levels of optimization, an error
// would not occur because of dead argument elimination of the local_accessor.
// RUN: %{build} -o %t.out %if cl_options %{/Od%} %else %{-O0%}
// RUN: %{build} -o %t.out %no_opt
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} %debug_option %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} %debug_option %no_opt -o %t.out
// RUN: %{build} %debug_option -O1 -o %t.out
// RUN: %{build} %debug_option -O2 -o %t.out
// RUN: %{build} %debug_option -O3 -o %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/unoptimized_stream.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %{build} %if cl_options %{/Od%} %else %{-O0%} -o %t.out
// RUN: %{build} %no_opt -o %t.out
// RUN: %{run} %t.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 2 additions & 0 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ def open_check_file(file_name):
config.substitutions.append(("%cxx_std_option", "/std:"))
config.substitutions.append(("%fPIC", ""))
config.substitutions.append(("%shared_lib", "/LD"))
config.substitutions.append(("%no_opt", "/Od"))
else:
config.substitutions.append(
(
Expand All @@ -406,6 +407,7 @@ def open_check_file(file_name):
("%fPIC", ("" if platform.system() == "Windows" else "-fPIC"))
)
config.substitutions.append(("%shared_lib", "-shared"))
config.substitutions.append(("%no_opt", "-O0"))

# Check if user passed verbose-print parameter, if yes, add VERBOSE_PRINT macro
if "verbose-print" in lit_config.params:
Expand Down

0 comments on commit 7ba92eb

Please sign in to comment.