[llvm-branch-commits] [cfe-branch] r228185 - Merging r227861:
Hans Wennborg
hans at hanshq.net
Wed Feb 4 12:44:15 PST 2015
Author: hans
Date: Wed Feb 4 14:44:15 2015
New Revision: 228185
URL: http://llvm.org/viewvc/llvm-project?rev=228185&view=rev
Log:
Merging r227861:
------------------------------------------------------------------------
r227861 | jholewinski | 2015-02-02 13:05:49 -0800 (Mon, 02 Feb 2015) | 15 lines
When generating llvm.used, we may need an addrspacecast instead of a bitcast.
Summary:
This is especially important for targets that use multiple address spaces,
and commonly place global variables in address spaces other than zero.
Fixes PR22383
Test Plan: New test case added: llvm-used.cu
Reviewers: jingyue
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7345
------------------------------------------------------------------------
Added:
cfe/branches/release_36/test/CodeGenCUDA/llvm-used.cu
- copied unchanged from r227861, cfe/trunk/test/CodeGenCUDA/llvm-used.cu
Modified:
cfe/branches/release_36/ (props changed)
cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp
Propchange: cfe/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 4 14:44:15 2015
@@ -1,4 +1,4 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:226008,226049,226136,226282,226382,226384,226624,226707,226754,226863,226877,227062,227088,227220,227251,227278,227295,227368,227393,227979,228053
+/cfe/trunk:226008,226049,226136,226282,226382,226384,226624,226707,226754,226863,226877,227062,227088,227220,227251,227278,227295,227368,227393,227861,227979,228053
/cfe/trunk/test:170344
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp?rev=228185&r1=228184&r2=228185&view=diff
==============================================================================
--- cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/branches/release_36/lib/CodeGen/CodeGenModule.cpp Wed Feb 4 14:44:15 2015
@@ -935,8 +935,8 @@ static void emitUsed(CodeGenModule &CGM,
UsedArray.resize(List.size());
for (unsigned i = 0, e = List.size(); i != e; ++i) {
UsedArray[i] =
- llvm::ConstantExpr::getBitCast(cast<llvm::Constant>(&*List[i]),
- CGM.Int8PtrTy);
+ llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
+ cast<llvm::Constant>(&*List[i]), CGM.Int8PtrTy);
}
if (UsedArray.empty())
More information about the llvm-branch-commits
mailing list