[PATCH] Implement ADRP CSE for global symbols
liujiangning1 at gmail.com
Mon May 12 00:06:38 PDT 2014
Sorry for those failures introduced, and yes they are all my fault, and now the new patch should have all issues fixed.
There was a logic error around the original assertion and it was only to check the 1st global for each different global variable merges. And actually this is was newly introduced by the 1st refactoring patch.
Anyway this new patch fixed the followings,
1) The compilation failures you mentioned. A new test case global-merge-3.ll is added to detect this regression. This test intends to mix the "internal global" and "global", and test multiple merged globals.
If "internal globals" and "globals" are mixed in the same merged globals, we will use the 1st "global" name as the suffix as this newly created merged global variable.
2) Ask "internal global" to also use alignment target hook. Yes, you are right, we can also apply this special hook to internal globals. I didn't do this previously, because I didn't want to mix the globals exposing names to other symbols with the internal globals, for which we don't need to expose names to other modules at all. And also I think applying this alignment hook to "internal globals" should be orthogonal with -global-merge-on-external, so now I introduced another command line switch -global-merge-aligned. i.e.
-global-merge-on-external: control if globals excluding "internal globals" will be merged.
-global-merge-aligned: control if the special alignment will be applied to merged globals.
3) This patch is also formatted with git-clang-format.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 34418 bytes
Desc: not available
More information about the llvm-commits