aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/R600/AMDGPUTargetMachine.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-01-18 21:15:53 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-01-18 21:15:53 +0000
commit82d3d4524f2595b2dce617e963b6d67876b4f9ba (patch)
tree87c19301345734b36691ce557d6357150007dfc0 /lib/Target/R600/AMDGPUTargetMachine.cpp
parent935a91540b7aa8f29ea48fe2df657db0ce5b7d5d (diff)
R600: Proper insert S_WAITCNT instructions
Some instructions like memory reads/writes are executed asynchronously, so we need to insert S_WAITCNT instructions to block before accessing their results. Previously we have just inserted S_WAITCNT instructions after each async instruction, this patch fixes this and adds a prober insertion pass. Patch by: Christian König Tested-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> Signed-off-by: Christian König <deathsimple@vodafone.de> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/AMDGPUTargetMachine.cpp')
-rw-r--r--lib/Target/R600/AMDGPUTargetMachine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/R600/AMDGPUTargetMachine.cpp b/lib/Target/R600/AMDGPUTargetMachine.cpp
index d09dc2efff..26ac928347 100644
--- a/lib/Target/R600/AMDGPUTargetMachine.cpp
+++ b/lib/Target/R600/AMDGPUTargetMachine.cpp
@@ -116,6 +116,11 @@ bool AMDGPUPassConfig::addPreRegAlloc() {
}
bool AMDGPUPassConfig::addPostRegAlloc() {
+ const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
+
+ if (ST.device()->getGeneration() > AMDGPUDeviceInfo::HD6XXX) {
+ addPass(createSIInsertWaits(*TM));
+ }
return false;
}