R600: Add a SubtargetFeatture for disabling the ifcvt pass.

This is useful when writing test cases for the AMDIL structurizer.

llvm-svn: 195029
This commit is contained in:
Tom Stellard 2013-11-18 19:43:33 +00:00
parent f1e3f77507
commit 783893a893
4 changed files with 14 additions and 1 deletions

View File

@ -28,6 +28,11 @@ def FeatureIRStructurizer : SubtargetFeature <"enable-irstructurizer",
// Target features
def FeatureIfCvt : SubtargetFeature <"disable-ifcvt",
"EnableIfCvt",
"false",
"Disable the if conversion pass">;
def FeatureFP64 : SubtargetFeature<"fp64",
"FP64",
"true",

View File

@ -37,6 +37,7 @@ AMDGPUSubtarget::AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS) :
FP64 = false;
CaymanISA = false;
EnableIRStructurizer = false;
EnableIfCvt = true;
ParseSubtargetFeatures(GPU, FS);
DevName = GPU;
}
@ -70,6 +71,10 @@ AMDGPUSubtarget::IsIRStructurizerEnabled() const {
return EnableIRStructurizer;
}
bool
AMDGPUSubtarget::isIfCvtEnabled() const {
return EnableIfCvt;
}
bool
AMDGPUSubtarget::isTargetELF() const {
return false;
}

View File

@ -50,6 +50,7 @@ private:
bool FP64;
bool CaymanISA;
bool EnableIRStructurizer;
bool EnableIfCvt;
InstrItineraryData InstrItins;
@ -66,6 +67,7 @@ public:
bool hasHWFP64() const;
bool hasCaymanISA() const;
bool IsIRStructurizerEnabled() const;
bool isIfCvtEnabled() const;
virtual bool enableMachineScheduler() const {
return getGeneration() <= NORTHERN_ISLANDS;

View File

@ -169,7 +169,8 @@ bool AMDGPUPassConfig::addPreSched2() {
if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS)
addPass(createR600EmitClauseMarkers(*TM));
addPass(&IfConverterID);
if (ST.isIfCvtEnabled())
addPass(&IfConverterID);
if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS)
addPass(createR600ClauseMergePass(*TM));
return false;