Reverts the code changes from r234675 but keeps the test case. We were already maintaining a DenseMap of globals with dynamic initializers anyway. Fixes the test case from PR23234. llvm-svn: 234961