Localize globals if they are only used in main(). This replaces the
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Thu, 10 Feb 2005 18:36:30 +0000 (18:36 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Thu, 10 Feb 2005 18:36:30 +0000 (18:36 +0000)
commitf64ea9d1221f52c47fed2ea86a74946c05f224ad
treefe2f49ec0132d1556844987307f8ed98c6a432a8
parentdb40cf1b5806812b5f9a79a0ce4fb154b3e10752
Localize globals if they are only used in main(). This replaces the
global with an alloca, which eventually gets promoted into a
register. This enables a lot of other optimizations later on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20109 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/GlobalOpt.cpp