AMDGPU: Disable some passes that are not meaningful

Don't run passes related to stack maps, garbage collection,
exceptions since these aren't useful for GPUs.

There might be a few more to turn off that I'm less sure about
(e.g. ShrinkWrapping) or I'm not sure how to disable
(SafeStack and StackProtector)

llvm-svn: 248591
This commit is contained in:
Matt Arsenault 2015-09-25 17:41:20 +00:00
parent 25b0acb57e
commit 0a10900070
1 changed files with 15 additions and 3 deletions

View File

@ -110,7 +110,13 @@ namespace {
class AMDGPUPassConfig : public TargetPassConfig {
public:
AMDGPUPassConfig(TargetMachine *TM, PassManagerBase &PM)
: TargetPassConfig(TM, PM) {}
: TargetPassConfig(TM, PM) {
// Exceptions and StackMaps are not supported, so these passes will never do
// anything.
disablePass(&StackMapLivenessID);
disablePass(&FuncletLayoutID);
}
AMDGPUTargetMachine &getAMDGPUTargetMachine() const {
return getTM<AMDGPUTargetMachine>();
@ -126,8 +132,9 @@ public:
void addIRPasses() override;
void addCodeGenPrepare() override;
virtual bool addPreISel() override;
virtual bool addInstSelector() override;
bool addPreISel() override;
bool addInstSelector() override;
bool addGCPasses() override;
};
class R600PassConfig : public AMDGPUPassConfig {
@ -200,6 +207,11 @@ bool AMDGPUPassConfig::addInstSelector() {
return false;
}
bool AMDGPUPassConfig::addGCPasses() {
// Do nothing. GC is not supported.
return false;
}
//===----------------------------------------------------------------------===//
// R600 Pass Setup
//===----------------------------------------------------------------------===//