From 0f710d7a5ab37e55d3824552be0b60a00be383df Mon Sep 17 00:00:00 2001 From: Jingyue Wu Date: Tue, 21 Apr 2015 20:47:15 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235415 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/NVPTX/NVPTXTargetMachine.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/Target/NVPTX/NVPTXTargetMachine.cpp b/lib/Target/NVPTX/NVPTXTargetMachine.cpp index 1b6bc714505..f9545cc1d41 100644 --- a/lib/Target/NVPTX/NVPTXTargetMachine.cpp +++ b/lib/Target/NVPTX/NVPTXTargetMachine.cpp @@ -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() { -- 2.11.0