From 1dcdcc00777e091e6fdb75a7069647091883771c Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 14 Jan 2015 05:13:18 +0000 Subject: [PATCH] NVPTX: Remove bogus remap logic for global variable address spaces The comment is incorrect, and the code mangles debug info. Remove the bad logic, which wasn't tested anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225943 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/NVPTX/NVPTXGenericToNVVM.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp b/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp index e50f6de01e1..c37eaff6437 100644 --- a/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp +++ b/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp @@ -408,19 +408,8 @@ MDNode *GenericToNVVM::remapMDNode(Module *M, MDNode *N) { } else if (auto *C = dyn_cast(Operand)) { if (auto *G = dyn_cast(C->getValue())) { GVMapTy::iterator I = GVMap.find(G); - if (I != GVMap.end()) { + if (I != GVMap.end()) NewOperand = ConstantAsMetadata::get(I->second); - if (++i < NumOperands) { - NewOperands.push_back(NewOperand); - // Address space of the global variable follows the global - // variable - // in the global variable debug info (see createGlobalVariable in - // lib/Analysis/DIBuilder.cpp). - NewOperand = ConstantAsMetadata::get( - ConstantInt::get(Type::getInt32Ty(M->getContext()), - I->second->getType()->getAddressSpace())); - } - } } } } -- 2.34.1