[PATCH] R600: Add option to disable promote alloca
Matt Arsenault
Matthew.Arsenault at amd.com
Thu Jun 26 22:56:22 PDT 2014
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"));
+
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();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4319.10911.patch
Type: text/x-patch
Size: 979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140627/0d6e3748/attachment.bin>
More information about the llvm-commits
mailing list