GlobalOpt should maintain externally_initialized when splitting aggregates
authorOliver Stannard <oliver.stannard@arm.com>
Mon, 9 Nov 2015 16:47:16 +0000 (16:47 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Mon, 9 Nov 2015 16:47:16 +0000 (16:47 +0000)
commit1cff5e80070eb3cb1c1f24acf0ef039a2cb547c4
tree2928abce10e56f0345b31edf4a749c1740d2259b
parente5e54367e73bf4727f88efbee58bee9183a66faf
GlobalOpt should maintain externally_initialized when splitting aggregates

When GlobalOpt splits an internal, global variable with an aggregate type, it
should propagate the externally_initialized flag to the newly created globals.

This makes the pass safe for our downstream use of this flag, while still
allowing some useful optimisations (such as removing dead parts of the split
aggregate) to be performed.

Differential Revision: http://reviews.llvm.org/D13382

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252490 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/GlobalOpt.cpp
test/Transforms/GlobalOpt/externally-initialized-aggregate.ll [new file with mode: 0644]