summaryrefslogtreecommitdiff
path: root/lib/Target/R600/R600RegisterInfo.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-11-15 00:12:45 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-11-15 00:12:45 +0000
commit19a99df130f5747da950faf4ca5170d71f05594c (patch)
tree9fa3fe9f4458c88dafaef52b94685ac7b0fbea8e /lib/Target/R600/R600RegisterInfo.cpp
parent1ccba3161c5285a74921f0ff183e18a3e0343710 (diff)
downloadllvm-19a99df130f5747da950faf4ca5170d71f05594c.tar.gz
llvm-19a99df130f5747da950faf4ca5170d71f05594c.tar.bz2
llvm-19a99df130f5747da950faf4ca5170d71f05594c.tar.xz
R600: Fix scheduling of instructions that use the LDS output queue
The LDS output queue is accessed via the OQAP register. The OQAP register cannot be live across clauses, so if value is written to the output queue, it must be retrieved before the end of the clause. With the machine scheduler, we cannot statisfy this constraint, because it lacks proper alias analysis and it will mark some LDS accesses as having a chain dependency on vertex fetches. Since vertex fetches require a new clauses, the dependency may end up spiltting OQAP uses and defs so the end up in different clauses. See the lds-output-queue.ll test for a more detailed explanation. To work around this issue, we now combine the LDS read and the OQAP copy into one instruction and expand it after register allocation. This patch also adds some checks to the EmitClauseMarker pass, so that it doesn't end a clause with a value still in the output queue and removes AR.X and OQAP handling from the scheduler (AR.X uses and defs were already being expanded post-RA, so the scheduler will never see them). Reviewed-by: Vincent Lejeune <vljn at ovi.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194755 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/R600RegisterInfo.cpp')
-rw-r--r--lib/Target/R600/R600RegisterInfo.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Target/R600/R600RegisterInfo.cpp b/lib/Target/R600/R600RegisterInfo.cpp
index fbe333d203..f3bb88b3ee 100644
--- a/lib/Target/R600/R600RegisterInfo.cpp
+++ b/lib/Target/R600/R600RegisterInfo.cpp
@@ -85,3 +85,16 @@ const RegClassWeight &R600RegisterInfo::getRegClassWeight(
const TargetRegisterClass *RC) const {
return RCW;
}
+
+bool R600RegisterInfo::isPhysRegLiveAcrossClauses(unsigned Reg) const {
+ assert(!TargetRegisterInfo::isVirtualRegister(Reg));
+
+ switch (Reg) {
+ case AMDGPU::OQAP:
+ case AMDGPU::OQBP:
+ case AMDGPU::AR_X:
+ return false;
+ default:
+ return true;
+ }
+}