[PATCH] R600: Add option to disable promote alloca
Tom Stellard
tom at stellard.net
Fri Jun 27 06:43:54 PDT 2014
On Fri, Jun 27, 2014 at 05:56:22AM +0000, Matt Arsenault wrote:
> This can make writing some tests harder, so add a flag to disable it.
>
> http://reviews.llvm.org/D4319
>
> Files:
> lib/Target/R600/AMDGPUTargetMachine.cpp
>
> Index: lib/Target/R600/AMDGPUTargetMachine.cpp
> ===================================================================
> --- lib/Target/R600/AMDGPUTargetMachine.cpp
> +++ lib/Target/R600/AMDGPUTargetMachine.cpp
> @@ -33,9 +33,13 @@
> #include "llvm/Transforms/Scalar.h"
> #include <llvm/CodeGen/Passes.h>
>
> -
> using namespace llvm;
>
> +static cl::opt<bool> DisablePromoteAlloca(
> + "disable-amdgpu-promote-alloca",
> + cl::Hidden,
> + cl::desc("Disable Promote Alloca for R600"));
> +
Can we make this a target features instead. Kind of like
FeatureIRStructurizer in AMDGPUT.td. This way it can be disabled
when using the LLVM API.
-Tom
> extern "C" void LLVMInitializeR600Target() {
> // Register the target
> RegisterTargetMachine<AMDGPUTargetMachine> X(TheAMDGPUTarget);
> @@ -137,8 +141,11 @@
>
> void AMDGPUPassConfig::addCodeGenPrepare() {
> const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
> - addPass(createAMDGPUPromoteAlloca(ST));
> - addPass(createSROAPass());
> + if (!DisablePromoteAlloca) {
> + addPass(createAMDGPUPromoteAlloca(ST));
> + addPass(createSROAPass());
> + }
> +
> TargetPassConfig::addCodeGenPrepare();
> }
> Index: lib/Target/R600/AMDGPUTargetMachine.cpp
> ===================================================================
> --- lib/Target/R600/AMDGPUTargetMachine.cpp
> +++ lib/Target/R600/AMDGPUTargetMachine.cpp
> @@ -33,9 +33,13 @@
> #include "llvm/Transforms/Scalar.h"
> #include <llvm/CodeGen/Passes.h>
>
> -
> using namespace llvm;
>
> +static cl::opt<bool> DisablePromoteAlloca(
> + "disable-amdgpu-promote-alloca",
> + cl::Hidden,
> + cl::desc("Disable Promote Alloca for R600"));
> +
> extern "C" void LLVMInitializeR600Target() {
> // Register the target
> RegisterTargetMachine<AMDGPUTargetMachine> X(TheAMDGPUTarget);
> @@ -137,8 +141,11 @@
>
> void AMDGPUPassConfig::addCodeGenPrepare() {
> const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
> - addPass(createAMDGPUPromoteAlloca(ST));
> - addPass(createSROAPass());
> + if (!DisablePromoteAlloca) {
> + addPass(createAMDGPUPromoteAlloca(ST));
> + addPass(createSROAPass());
> + }
> +
> TargetPassConfig::addCodeGenPrepare();
> }
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list