summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-14 05:13:18 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-14 05:13:18 +0000
commitf864ae2745376b5e996a1d1fdfef32c0bfd8567e (patch)
tree35367133dc88e9feed24b5138334ccd8095a8d61
parentb5d2d45c5c1419651ed4e6ebc3011a5a9bd51113 (diff)
downloadbcm5719-llvm-f864ae2745376b5e996a1d1fdfef32c0bfd8567e.tar.gz
bcm5719-llvm-f864ae2745376b5e996a1d1fdfef32c0bfd8567e.zip
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. llvm-svn: 225943
-rw-r--r--llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp b/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp
index e50f6de01e1..c37eaff6437 100644
--- a/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp
@@ -408,19 +408,8 @@ MDNode *GenericToNVVM::remapMDNode(Module *M, MDNode *N) {
} else if (auto *C = dyn_cast<ConstantAsMetadata>(Operand)) {
if (auto *G = dyn_cast<GlobalVariable>(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()));
- }
- }
}
}
}
OpenPOWER on IntegriCloud