GlobalOpt: Be more aggressive about elminating side-effect free static dtors.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 9 Feb 2012 14:26:06 +0000 (14:26 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 9 Feb 2012 14:26:06 +0000 (14:26 +0000)
commitd4692747439aac1fbc2064e11b53e3e6ea5ad463
treec23eb536941b06a60c06a0af6e13d4db31fdc2a2
parent2c6ae095b8a944c8355377498b9ad11bb94af2d5
GlobalOpt: Be more aggressive about elminating side-effect free static dtors.

GlobalOpt runs early in the pipeline (before inlining) and complex class
hierarchies often introduce bitcasts or GEPs which weren't optimized away.
Teach it to ignore side-effect free instructions instead of depending on
other passes to remove them.

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