[PATCH] D79314: PR45733 : global weak symbol are excluded from the optimization .

Umesh Kalappa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 21:32:57 PDT 2020


umesh.kalappa0 added a comment.

In D79314#2032099 <https://reviews.llvm.org/D79314#2032099>, @efriedma wrote:

> Okay, so assuming that optimization is invalid, there's a bug in clang *somewhere*.  You haven't explained why this is the right fix.
>
> LLVM IR is a distinct language with its own specification.  The definition of weak_odr is very explicitly written out.  If you're going to change LLVM IR optimizations, you need to justify the change in terms of that specification, not C code.




In D79314#2032099 <https://reviews.llvm.org/D79314#2032099>, @efriedma wrote:

> Okay, so assuming that optimization is invalid, there's a bug in clang *somewhere*.  You haven't explained why this is the right fix.


We are bailing out the optimization, if the global has the weak_odr linkage  ,which is explicit in the condition check .

> LLVM IR is a distinct language with its own specification.  The definition of weak_odr is very explicitly written out.  If you're going to change LLVM IR optimizations, you need to justify the change in terms of that specification, not C code.

Yes, don't propagate the constant for the weak_odr / weak globals (in SCCP ).


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79314/new/

https://reviews.llvm.org/D79314





More information about the llvm-commits mailing list