forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
4f14c17df7
commit
3dcb535115
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue