The MergeFunctions pass was originally intended to emit aliases
instead of thunks where possible (unnamed_addr). However, for a
long time this functionality was behind a flag hardcoded to false,
bitrotted and was eventually removed in
https://github.com/llvm-mirror/llvm/commit/f9f40b539b1dc44b10184684aa3f72e1192c454f.
Originally the functionality was first disabled in
https://github.com/llvm-mirror/llvm/commit/664040a03c17f432a127a35013eeb6b6a26e41fb
due to lack of support for aliases in Mach-O. I believe that this
is no longer the case nowadays, but not really familiar with this
area.
In the interest of being conservative, this patch reintroduces the
aliasing functionality (with some fixes) behind a default disabled
-mergefunc-use-aliases flag.