diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2015-01-29 16:55:25 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2015-01-29 16:55:25 +0000 |
| commit | 83f0bcef7a3e96d022f8d31fd87c8363fd4f9a00 (patch) | |
| tree | f29b52cf36d73c5cdc161b00203816b987f329a5 /llvm/lib/Target/R600/AMDGPUSubtarget.cpp | |
| parent | e75aa4983c8bb64f63c8742d2e3dc32c6966b74b (diff) | |
| download | bcm5719-llvm-83f0bcef7a3e96d022f8d31fd87c8363fd4f9a00.tar.gz bcm5719-llvm-83f0bcef7a3e96d022f8d31fd87c8363fd4f9a00.zip | |
R600/SI: Define a schedule model and enable the generic machine scheduler
The schedule model is not complete yet, and could be improved.
llvm-svn: 227461
Diffstat (limited to 'llvm/lib/Target/R600/AMDGPUSubtarget.cpp')
| -rw-r--r-- | llvm/lib/Target/R600/AMDGPUSubtarget.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUSubtarget.cpp b/llvm/lib/Target/R600/AMDGPUSubtarget.cpp index 39cc383c89e..541dbab709d 100644 --- a/llvm/lib/Target/R600/AMDGPUSubtarget.cpp +++ b/llvm/lib/Target/R600/AMDGPUSubtarget.cpp @@ -20,6 +20,7 @@ #include "SIInstrInfo.h" #include "SIMachineFunctionInfo.h" #include "llvm/ADT/SmallString.h" +#include "llvm/CodeGen/MachineScheduler.h" using namespace llvm; @@ -111,3 +112,21 @@ bool AMDGPUSubtarget::isVGPRSpillingEnabled( const SIMachineFunctionInfo *MFI) const { return MFI->getShaderType() == ShaderType::COMPUTE || EnableVGPRSpilling; } + +void AMDGPUSubtarget::overrideSchedPolicy(MachineSchedPolicy &Policy, + MachineInstr *begin, + MachineInstr *end, + unsigned NumRegionInstrs) const { + if (getGeneration() >= SOUTHERN_ISLANDS) { + + // Track register pressure so the scheduler can try to decrease + // pressure once register usage is above the threshold defined by + // SIRegisterInfo::getRegPressureSetLimit() + Policy.ShouldTrackPressure = true; + + // Enabling both top down and bottom up scheduling seems to give us less + // register spills than just using one of these approaches on its own. + Policy.OnlyTopDown = false; + Policy.OnlyBottomUp = false; + } +} |

