aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-11-18 21:06:58 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-11-18 21:06:58 +0000
commit162c1010bd600b1fd53f5e9f045be611d35e83a1 (patch)
tree4bcbe5509674a18e00916d80180813972730ae27 /llvm/lib/Target/R600/AMDGPUTargetMachine.cpp
parent7a7c4684e41e4f7ecf6b77fd162abcb4596a6ec1 (diff)
downloadllvm-162c1010bd600b1fd53f5e9f045be611d35e83a1.zip
llvm-162c1010bd600b1fd53f5e9f045be611d35e83a1.tar.gz
llvm-162c1010bd600b1fd53f5e9f045be611d35e83a1.tar.bz2
R600/SI: Move SIFixSGPRCopies to inst selector passes
This should expose more of the actually used VALU instructions to the machine optimization passes. This also should help getting i1 handling into a better state. For not entirly understood reasons, this fixes the split-scalar-i64-add.ll test where a 64-bit add would only partially be moved to the VALU resulting in use of undefined VCC. llvm-svn: 222256
Diffstat (limited to 'llvm/lib/Target/R600/AMDGPUTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/R600/AMDGPUTargetMachine.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp b/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp
index 6f8ce1a..b2cd988 100644
--- a/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp
@@ -150,8 +150,15 @@ AMDGPUPassConfig::addPreISel() {
}
bool AMDGPUPassConfig::addInstSelector() {
+ const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
+
addPass(createAMDGPUISelDag(getAMDGPUTargetMachine()));
- addPass(createSILowerI1CopiesPass());
+
+ if (ST.getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
+ addPass(createSILowerI1CopiesPass());
+ addPass(createSIFixSGPRCopiesPass(*TM));
+ }
+
return false;
}
@@ -161,12 +168,7 @@ bool AMDGPUPassConfig::addPreRegAlloc() {
if (ST.getGeneration() <= AMDGPUSubtarget::NORTHERN_ISLANDS) {
addPass(createR600VectorRegMerger(*TM));
} else {
- addPass(createSIFixSGPRCopiesPass(*TM));
- // SIFixSGPRCopies can generate a lot of duplicate instructions,
- // so we need to run MachineCSE afterwards.
- addPass(&MachineCSEID);
-
- if (getOptLevel() > CodeGenOpt::None && ST.loadStoreOptEnabled()) {
+ if (getOptLevel() > CodeGenOpt::None && ST.loadStoreOptEnabled()) {
// Don't do this with no optimizations since it throws away debug info by
// merging nonadjacent loads.