[llvm] r212893 - R600: Add option to disable promote alloca

Matt Arsenault arsenm2 at gmail.com
Mon Jul 14 09:25:46 PDT 2014


On Jul 14, 2014, at 7:29 AM, Tom Stellard <tom at stellard.net> wrote:
>> 
> 
> Why are you modifying the feature string here?  Can't you just initialize
> EnablePromoteAlloc to true?
> 
> -Tom
> 

That doesn’t work as expected. The value is still set to true by the feature value, rendering the flag useless. Changing that to false results in negating the flag and requiring something like “disable” in the name. This is what other targets do to get default features so the flag is called +/- feature instead of -disable-feature to enable it.


>> 
>>   if (getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) {
>>     InstrInfo.reset(new R600InstrInfo(*this));
>> 
>> Modified: llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h?rev=212893&r1=212892&r2=212893&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h (original)
>> +++ llvm/trunk/lib/Target/R600/AMDGPUSubtarget.h Sat Jul 12 21:08:26 2014
>> @@ -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;
>>   }
>> 
>> Modified: llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp?rev=212893&r1=212892&r2=212893&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp (original)
>> +++ llvm/trunk/lib/Target/R600/AMDGPUTargetMachine.cpp Sat Jul 12 21:08:26 2014
>> @@ -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::addAnalysisPas
>> 
>> void AMDGPUPassConfig::addCodeGenPrepare() {
>>   const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
>> -  addPass(createAMDGPUPromoteAlloca(ST));
>> -  addPass(createSROAPass());
>> +  if (ST.isPromoteAllocaEnabled()) {
>> +    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
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140714/a6346a4e/attachment.html>


More information about the llvm-commits mailing list