[llvm-commits] [PATCH] Keep address space in global opt

Nick Lewycky nicholas at mxc.ca
Wed Jan 9 12:37:30 PST 2013


Joey Gouly wrote:
> Hi all,
>
> Currently in 'TryToShrinkGlobalToBoolean' (inside GlobalOpt), the address
> space of the global is dropped.
>
> Attached is the patch to fix it.
>
> Ok to commit?

--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1825,7 +1824,7 @@ static bool 
TryToShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) {
                                               GlobalValue::InternalLinkage,
 
ConstantInt::getFalse(GV->getContext()),
                                               GV->getName()+".b",
-                                             GV->getThreadLocalMode());
+                                             GV->getThreadLocalMode(), 
GV->getType()->getAddressSpace());

Exceeds 80 columns.

Thanks for migrating the test to FileCheck. You can submit after you've 
fixed the 80col violation.

Nick



More information about the llvm-commits mailing list