mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 18:34:09 +00:00
R600: Add option to disable promote alloca
This can make writing some tests harder, so add a flag to disable it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212893 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8ef1fa761f
commit
8e53751320
@ -25,6 +25,11 @@ def FeatureIRStructurizer : SubtargetFeature <"disable-irstructurizer",
|
||||
"false",
|
||||
"Disable IR Structurizer">;
|
||||
|
||||
def FeaturePromoteAlloca : SubtargetFeature <"promote-alloca",
|
||||
"EnablePromoteAlloca",
|
||||
"true",
|
||||
"Enable promote alloca pass">;
|
||||
|
||||
// Target features
|
||||
|
||||
def FeatureIfCvt : SubtargetFeature <"disable-ifcvt",
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "R600InstrInfo.h"
|
||||
#include "SIInstrInfo.h"
|
||||
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
#define DEBUG_TYPE "amdgpu-subtarget"
|
||||
@ -37,12 +39,17 @@ AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT, StringRef GPU, StringRef FS) :
|
||||
FP64(false),
|
||||
CaymanISA(false),
|
||||
EnableIRStructurizer(true),
|
||||
EnablePromoteAlloca(false),
|
||||
EnableIfCvt(true),
|
||||
WavefrontSize(0),
|
||||
CFALUBug(false),
|
||||
LocalMemorySize(0),
|
||||
InstrItins(getInstrItineraryForCPU(GPU)) {
|
||||
ParseSubtargetFeatures(GPU, FS);
|
||||
|
||||
SmallString<256> FullFS("+promote-alloca,");
|
||||
FullFS += FS;
|
||||
|
||||
ParseSubtargetFeatures(GPU, FullFS);
|
||||
|
||||
if (getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) {
|
||||
InstrInfo.reset(new R600InstrInfo(*this));
|
||||
|
@ -52,6 +52,7 @@ private:
|
||||
bool FP64;
|
||||
bool CaymanISA;
|
||||
bool EnableIRStructurizer;
|
||||
bool EnablePromoteAlloca;
|
||||
bool EnableIfCvt;
|
||||
unsigned WavefrontSize;
|
||||
bool CFALUBug;
|
||||
@ -81,7 +82,7 @@ public:
|
||||
}
|
||||
|
||||
short getTexVTXClauseSize() const {
|
||||
return TexVTXClauseSize;
|
||||
return TexVTXClauseSize;
|
||||
}
|
||||
|
||||
Generation getGeneration() const {
|
||||
@ -129,6 +130,10 @@ public:
|
||||
return EnableIRStructurizer;
|
||||
}
|
||||
|
||||
bool isPromoteAllocaEnabled() const {
|
||||
return EnablePromoteAlloca;
|
||||
}
|
||||
|
||||
bool isIfCvtEnabled() const {
|
||||
return EnableIfCvt;
|
||||
}
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "llvm/Transforms/Scalar.h"
|
||||
#include <llvm/CodeGen/Passes.h>
|
||||
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
extern "C" void LLVMInitializeR600Target() {
|
||||
@ -137,8 +136,11 @@ void AMDGPUTargetMachine::addAnalysisPasses(PassManagerBase &PM) {
|
||||
|
||||
void AMDGPUPassConfig::addCodeGenPrepare() {
|
||||
const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
|
||||
addPass(createAMDGPUPromoteAlloca(ST));
|
||||
addPass(createSROAPass());
|
||||
if (ST.isPromoteAllocaEnabled()) {
|
||||
addPass(createAMDGPUPromoteAlloca(ST));
|
||||
addPass(createSROAPass());
|
||||
}
|
||||
|
||||
TargetPassConfig::addCodeGenPrepare();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user