summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/AMDGPUSubtarget.h
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2012-06-19 18:47:18 -0400
committerTom Stellard <[email protected]>2012-06-21 20:42:06 +0000
commitcd287301ec598d2811f3f85c03d23bae01be2359 (patch)
treeee21b535265591da3e0add2d5c5072d52a7a0247 /src/gallium/drivers/radeon/AMDGPUSubtarget.h
parentb73cf49c91b57d05795748da5803c3095ec25526 (diff)
radeon/llvm: Use the VLIW Scheduler for R600->NI
It's not optimal, but it's better than the register pressure scheduler that was previously being used. The VLIW scheduler currently ignores all the complicated instruction groups restrictions and just tries to fill the instruction groups with as many instructions as possible. Though, it does know enough not to put two trans only instructions in the same group. We are able to ignore the instruction group restrictions in the LLVM backend, because the finalizer in r600_asm.c will fix any illegal instruction groups the backend generates. Enabling the VLIW scheduler improved the run time for a sha1 compute shader by about 50%. I'm not sure what the impact will be for graphics shaders. I tested Lightsmark with the VLIW scheduler enabled and the framerate was about the same, but it might help apps that use really big shaders.
Diffstat (limited to 'src/gallium/drivers/radeon/AMDGPUSubtarget.h')
-rw-r--r--src/gallium/drivers/radeon/AMDGPUSubtarget.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/AMDGPUSubtarget.h b/src/gallium/drivers/radeon/AMDGPUSubtarget.h
new file mode 100644
index 00000000000..96ace88b476
--- /dev/null
+++ b/src/gallium/drivers/radeon/AMDGPUSubtarget.h
@@ -0,0 +1,36 @@
+//=====-- AMDGPUSubtarget.h - Define Subtarget for the AMDIL ---*- C++ -*-====//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//==-----------------------------------------------------------------------===//
+//
+// This file declares the AMDGPU specific subclass of TargetSubtarget.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _AMDGPUSUBTARGET_H_
+#define _AMDGPUSUBTARGET_H_
+#include "AMDILSubtarget.h"
+
+namespace llvm {
+
+class AMDGPUSubtarget : public AMDILSubtarget
+{
+ InstrItineraryData InstrItins;
+
+public:
+ AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS) :
+ AMDILSubtarget(TT, CPU, FS)
+ {
+ InstrItins = getInstrItineraryForCPU(CPU);
+ }
+
+ const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
+};
+
+} // End namespace llvm
+
+#endif // AMDGPUSUBTARGET_H_