[llvm] r235415 - [NVPTX] do not run DCE after SLSR and SeparateConstOffsetFromGEP
Jingyue Wu
jingyue at google.com
Tue Apr 21 13:47:15 PDT 2015
Author: jingyue
Date: Tue Apr 21 15:47:15 2015
New Revision: 235415
URL: http://llvm.org/viewvc/llvm-project?rev=235415&view=rev
Log:
[NVPTX] do not run DCE after SLSR and SeparateConstOffsetFromGEP
Summary:
With D9096 and D9101, there's no need to run DCE after SLSR and
SeparateConstOffsetFromGEP.
Test Plan: no regression
Reviewers: jholewinski, meheff
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D9172
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp?rev=235415&r1=235414&r2=235415&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp Tue Apr 21 15:47:15 2015
@@ -164,6 +164,10 @@ void NVPTXPassConfig::addIRPasses() {
addPass(createNVPTXAssignValidGlobalNamesPass());
addPass(createGenericToNVVMPass());
addPass(createNVPTXFavorNonGenericAddrSpacesPass());
+ // FavorNonGenericAddrSpaces shortcuts unnecessary addrspacecasts, and leave
+ // them unused. We could remove dead code in an ad-hoc manner, but that
+ // requires manual work and might be error-prone.
+ addPass(createDeadCodeEliminationPass());
addPass(createStraightLineStrengthReducePass());
addPass(createSeparateConstOffsetFromGEPPass());
// The SeparateConstOffsetFromGEP pass creates variadic bases that can be used
@@ -173,16 +177,6 @@ void NVPTXPassConfig::addIRPasses() {
addPass(createGVNPass());
else
addPass(createEarlyCSEPass());
- // Both FavorNonGenericAddrSpaces and SeparateConstOffsetFromGEP may leave
- // some dead code. We could remove dead code in an ad-hoc manner, but that
- // requires manual work and might be error-prone.
- //
- // The FavorNonGenericAddrSpaces pass shortcuts unnecessary addrspacecasts,
- // and leave them unused.
- //
- // SeparateConstOffsetFromGEP rebuilds a new index from the old index, and the
- // old index and some of its intermediate results may become unused.
- addPass(createDeadCodeEliminationPass());
}
bool NVPTXPassConfig::addInstSelector() {
More information about the llvm-commits
mailing list