PR35760 shows an example program which, when compiled with clang -O0
or gcc at any optimization level, prints '0'. However, llvm transforms
the program in a way that causes it to print '1'.
Fix the issue by having AllUsesOfValueWillTrapIfNull return false when
analyzing a load from a global which is used by an icmp. This special
case was untested [0] so this is just deleting dead code.
An alternative fix might be to change the GlobalStatus analysis for the
global to report "Stored" instead of "StoredOnce". However, "StoredOnce"
is appropriate when only one value other than the initializer is stored
to the global.
Please delete unnecessary metadata.