diff options
author | Michael Kruse <llvm-project@meinersbur.de> | 2021-02-09 18:05:43 -0600 |
---|---|---|
committer | Michael Kruse <llvm-project@meinersbur.de> | 2021-02-09 18:13:35 -0600 |
commit | 3dcb535115e48a90886ed6cf275bd3eea14e354f (patch) | |
tree | b2689568422c810c3f5b032341df86d323be7e57 | |
parent | 4f14c17df70916913d71914343dd4f6c709e218d (diff) | |
download | llvm-3dcb535115e48a90886ed6cf275bd3eea14e354f.zip llvm-3dcb535115e48a90886ed6cf275bd3eea14e354f.tar.gz llvm-3dcb535115e48a90886ed6cf275bd3eea14e354f.tar.bz2 |
[Polly] Remove use of -O3 in regression test.
In addition to that regression tests should not test the intire pass
pipeline (unless they are testing the pipeline itself), the Polly-ACC
currently does not support the new pass manager. If enabled by default,
such tests will therefore fail.
Use the -polly-gpu-runtime and -polly-gpu-arch options also as default
values for the PPCGCodeGeneration pass. This requires to move the option
to be moved from the pipeline-building Register passes to the
PPCGCodeGeneration implementation.
Fixes the spir-typesize.ll buildbot fail.
-rw-r--r-- | polly/include/polly/CodeGen/PPCGCodeGeneration.h | 8 | ||||
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 29 | ||||
-rw-r--r-- | polly/lib/Support/RegisterPasses.cpp | 21 | ||||
-rw-r--r-- | polly/test/GPGPU/spir-typesize.ll | 4 |
4 files changed, 37 insertions, 25 deletions
diff --git a/polly/include/polly/CodeGen/PPCGCodeGeneration.h b/polly/include/polly/CodeGen/PPCGCodeGeneration.h index d003fb2..9a6c596 100644 --- a/polly/include/polly/CodeGen/PPCGCodeGeneration.h +++ b/polly/include/polly/CodeGen/PPCGCodeGeneration.h @@ -22,6 +22,12 @@ enum GPURuntime { CUDA, OpenCL }; namespace polly { extern bool PollyManagedMemory; -} + +/// Use for pass instantiation defaults. +/// @{ +extern GPURuntime GPURuntimeChoice; +extern GPUArch GPUArchChoice; +/// @} +} // namespace polly #endif // POLLY_PPCGCODEGENERATION_H diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 0b959002..53818a4 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -117,6 +117,29 @@ static cl::opt<int> cl::desc("Minimal number of compute statements to run on GPU."), cl::Hidden, cl::init(10 * 512 * 512)); +GPURuntime polly::GPURuntimeChoice; +static cl::opt<GPURuntime, true> XGPURuntimeChoice( + "polly-gpu-runtime", cl::desc("The GPU Runtime API to target"), + cl::values(clEnumValN(GPURuntime::CUDA, "libcudart", + "use the CUDA Runtime API"), + clEnumValN(GPURuntime::OpenCL, "libopencl", + "use the OpenCL Runtime API")), + cl::location(polly::GPURuntimeChoice), cl::init(GPURuntime::CUDA), + cl::ZeroOrMore, cl::cat(PollyCategory)); + +GPUArch polly::GPUArchChoice; +static cl::opt<GPUArch, true> + XGPUArchChoice("polly-gpu-arch", cl::desc("The GPU Architecture to target"), + cl::values(clEnumValN(GPUArch::NVPTX64, "nvptx64", + "target NVIDIA 64-bit architecture"), + clEnumValN(GPUArch::SPIR32, "spir32", + "target SPIR 32-bit architecture"), + clEnumValN(GPUArch::SPIR64, "spir64", + "target SPIR 64-bit architecture")), + cl::location(polly::GPUArchChoice), + cl::init(GPUArch::NVPTX64), cl::ZeroOrMore, + cl::cat(PollyCategory)); + extern bool polly::PerfMonitoring; /// Return a unique name for a Scop, which is the scop region with the @@ -2548,7 +2571,11 @@ public: const DataLayout *DL; RegionInfo *RI; - PPCGCodeGeneration() : ScopPass(ID) {} + PPCGCodeGeneration() : ScopPass(ID) { + // Apply defaults. + Runtime = GPURuntimeChoice; + Architecture = GPUArchChoice; + } /// Construct compilation options for PPCG. /// diff --git a/polly/lib/Support/RegisterPasses.cpp b/polly/lib/Support/RegisterPasses.cpp index d9caed4..0d2a580 100644 --- a/polly/lib/Support/RegisterPasses.cpp +++ b/polly/lib/Support/RegisterPasses.cpp @@ -106,27 +106,6 @@ static cl::opt<TargetChoice> ), cl::init(TARGET_CPU), cl::ZeroOrMore, cl::cat(PollyCategory)); -#ifdef GPU_CODEGEN -static cl::opt<GPURuntime> GPURuntimeChoice( - "polly-gpu-runtime", cl::desc("The GPU Runtime API to target"), - cl::values(clEnumValN(GPURuntime::CUDA, "libcudart", - "use the CUDA Runtime API"), - clEnumValN(GPURuntime::OpenCL, "libopencl", - "use the OpenCL Runtime API")), - cl::init(GPURuntime::CUDA), cl::ZeroOrMore, cl::cat(PollyCategory)); - -static cl::opt<GPUArch> - GPUArchChoice("polly-gpu-arch", cl::desc("The GPU Architecture to target"), - cl::values(clEnumValN(GPUArch::NVPTX64, "nvptx64", - "target NVIDIA 64-bit architecture"), - clEnumValN(GPUArch::SPIR32, "spir32", - "target SPIR 32-bit architecture"), - clEnumValN(GPUArch::SPIR64, "spir64", - "target SPIR 64-bit architecture")), - cl::init(GPUArch::NVPTX64), cl::ZeroOrMore, - cl::cat(PollyCategory)); -#endif - VectorizerChoice polly::PollyVectorizerChoice; static cl::opt<polly::VectorizerChoice, true> Vectorizer( "polly-vectorizer", cl::desc("Select the vectorization strategy"), diff --git a/polly/test/GPGPU/spir-typesize.ll b/polly/test/GPGPU/spir-typesize.ll index dae75ad..2e94591 100644 --- a/polly/test/GPGPU/spir-typesize.ll +++ b/polly/test/GPGPU/spir-typesize.ll @@ -1,9 +1,9 @@ -; RUN: opt %loadPolly -O3 -polly -polly-target=gpu \ +; RUN: opt %loadPolly -polly-codegen-ppcg \ ; RUN: -polly-gpu-arch=spir64 \ ; RUN: -polly-acc-dump-kernel-ir -polly-process-unprofitable -disable-output < %s | \ ; RUN: FileCheck -check-prefix=I64 %s -; RUN: opt %loadPolly -O3 -polly -polly-target=gpu \ +; RUN: opt %loadPolly -polly-codegen-ppcg \ ; RUN: -polly-gpu-arch=spir32 \ ; RUN: -polly-acc-dump-kernel-ir -polly-process-unprofitable -disable-output < %s | \ ; RUN: FileCheck -check-prefix=I32 %s |