[llvm] r239923 - LowerBitSets: Do not assign names to aliases of unnamed bitset element objects.

Peter Collingbourne peter at pcc.me.uk
Wed Jun 17 11:31:03 PDT 2015


Author: pcc
Date: Wed Jun 17 13:31:02 2015
New Revision: 239923

URL: http://llvm.org/viewvc/llvm-project?rev=239923&view=rev
Log:
LowerBitSets: Do not assign names to aliases of unnamed bitset element objects.

The restriction on unnamed aliases was removed in r239921. Mostly reverts
r239590, but we keep the test.

Modified:
    llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
    llvm/trunk/test/Transforms/LowerBitSets/unnamed.ll

Modified: llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp?rev=239923&r1=239922&r2=239923&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp Wed Jun 17 13:31:02 2015
@@ -556,9 +556,8 @@ void LowerBitSets::buildBitSetsFromGloba
     } else {
       GlobalAlias *GAlias =
           GlobalAlias::create(Globals[I]->getType(), Globals[I]->getLinkage(),
-                              "data", CombinedGlobalElemPtr, M);
-      if (Globals[I]->hasName())
-        GAlias->takeName(Globals[I]);
+                              "", CombinedGlobalElemPtr, M);
+      GAlias->takeName(Globals[I]);
       Globals[I]->replaceAllUsesWith(GAlias);
     }
     Globals[I]->eraseFromParent();

Modified: llvm/trunk/test/Transforms/LowerBitSets/unnamed.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerBitSets/unnamed.ll?rev=239923&r1=239922&r2=239923&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerBitSets/unnamed.ll (original)
+++ llvm/trunk/test/Transforms/LowerBitSets/unnamed.ll Wed Jun 17 13:31:02 2015
@@ -2,7 +2,8 @@
 
 target datalayout = "e-p:32:32"
 
-; CHECK: @data ={{.*}} alias
+; CHECK: @{{[0-9]+}} = alias
+; CHECK: @{{[0-9]+}} = alias
 @0 = constant i32 1
 @1 = constant [2 x i32] [i32 2, i32 3]
 





More information about the llvm-commits mailing list