[PATCH] D18634: Don't IPO over functions that can be de-refined

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 19:10:04 PDT 2016


> On Mar 31, 2016, at 7:04 PM, Chandler Carruth via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> ================
> Comment at: include/llvm/IR/GlobalValue.h:143-151
> @@ +142,11 @@
> +  bool mayBeOverridden() const {
> +    switch (getLinkage()) {
> +    case WeakAnyLinkage:
> +    case LinkOnceAnyLinkage:
> +    case CommonLinkage:
> +    case ExternalWeakLinkage:
> +      return true;
> +
> +    default:
> +      return false;
> +    }
> ----------------
> Do we want to invert this (and above) so that the default is conservatively correct if we add a new linkage?
There aren’t that many total linkage types.  Would it be too many lines of code to just enumerate them all?  The switch coverage will tell us when we add new cases.

Pete

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160331/03b6978c/attachment.html>


More information about the llvm-commits mailing list