[PATCH] D16074: Make sure that any new and optimized objects created during GlobalOPT copy all the attributes from the base object.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 11:56:15 PST 2016


joker.eph added a subscriber: joker.eph.
joker.eph added a comment.

I thought we were conservatively avoiding to mess around with variable that have a section (address space?) attached. How do we know that we can split an array or a structure that has a section attached? Couldn't is be mapped to some hardware?


================
Comment at: lib/Transforms/IPO/GlobalOpt.cpp:503
@@ -502,2 +502,3 @@
       Globals.push_back(NGV);
+      NGV->copyAttributesFrom(GV);
       NewGlobals.push_back(NGV);
----------------
Nit: moving it one line above seems nicer to me.

================
Comment at: lib/Transforms/IPO/GlobalOpt.cpp:538
@@ -536,2 +537,3 @@
       Globals.push_back(NGV);
+      NGV->copyAttributesFrom(GV);
       NewGlobals.push_back(NGV);
----------------
same


http://reviews.llvm.org/D16074





More information about the llvm-commits mailing list