Skip to content

Commit

Permalink
[NVPTX] do not run DCE after SLSR and SeparateConstOffsetFromGEP
Browse files Browse the repository at this point in the history
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

llvm-svn: 235415
  • Loading branch information
Jingyue Wu committed Apr 21, 2015
1 parent 7be03d6 commit 66a161f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
Expand Up @@ -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
Expand All @@ -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() {
Expand Down

0 comments on commit 66a161f

Please sign in to comment.