[polly] 3dcb535 - [Polly] Remove use of -O3 in regression test.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 9 16:14:26 PST 2021


Author: Michael Kruse
Date: 2021-02-09T18:13:35-06:00
New Revision: 3dcb535115e48a90886ed6cf275bd3eea14e354f

URL: https://github.com/llvm/llvm-project/commit/3dcb535115e48a90886ed6cf275bd3eea14e354f
DIFF: https://github.com/llvm/llvm-project/commit/3dcb535115e48a90886ed6cf275bd3eea14e354f.diff

LOG: [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.

Added: 
    

Modified: 
    polly/include/polly/CodeGen/PPCGCodeGeneration.h
    polly/lib/CodeGen/PPCGCodeGeneration.cpp
    polly/lib/Support/RegisterPasses.cpp
    polly/test/GPGPU/spir-typesize.ll

Removed: 
    


################################################################################
diff  --git a/polly/include/polly/CodeGen/PPCGCodeGeneration.h b/polly/include/polly/CodeGen/PPCGCodeGeneration.h
index d003fb266c47..9a6c596e5f49 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 0b959002cee1..53818a4097ee 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 @@ class PPCGCodeGeneration : public ScopPass {
   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 d9caed41ddba..0d2a5801bac1 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 dae75ad74b49..2e9459134555 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


        


More information about the llvm-commits mailing list