diff options
Diffstat (limited to 'lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp')
-rw-r--r-- | lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp b/lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp index 95813c8430d1c..7c5a54162d777 100644 --- a/lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp +++ b/lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp @@ -7,6 +7,9 @@ // //===----------------------------------------------------------------------===// // +// FIXME: This pass is deprecated in favor of NVPTXInferAddressSpaces, which +// uses a new algorithm that handles pointer induction variables. +// // When a load/store accesses the generic address space, checks whether the // address is casted from a non-generic address space. If so, remove this // addrspacecast because accessing non-generic address spaces is typically @@ -164,8 +167,8 @@ Value *NVPTXFavorNonGenericAddrSpaces::hoistAddrSpaceCastFromGEP( GEP->getSourceElementType(), Cast->getOperand(0), Indices, "", GEPI); NewGEP->setIsInBounds(GEP->isInBounds()); + NewGEP->takeName(GEP); NewASC = new AddrSpaceCastInst(NewGEP, GEP->getType(), "", GEPI); - NewASC->takeName(GEP); // Without RAUWing GEP, the compiler would visit GEP again and emit // redundant instructions. This is exercised in test @rauw in // access-non-generic.ll. @@ -263,7 +266,7 @@ bool NVPTXFavorNonGenericAddrSpaces::optimizeMemoryInstruction(Instruction *MI, } bool NVPTXFavorNonGenericAddrSpaces::runOnFunction(Function &F) { - if (DisableFavorNonGeneric) + if (DisableFavorNonGeneric || skipFunction(F)) return false; bool Changed = false; |