[PATCH] D70749: [InstCombine] do not insert nonnull assumption for undef

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 11:32:48 PST 2019


efriedma added a comment.

In D70749#1761120 <https://reviews.llvm.org/D70749#1761120>, @jdoerfert wrote:

> I think the "solution" here is to weaken the guarantees of `nonnull`. That is, if the value is dead, it might be null after all.


LLVM IR has no notion of "dead".  We could say that if the argument would be null, the behavior is defined, but the value is poison in the callee.  (Or something like that; not sure that phrasing properly captures the semantics.)

> The only alternative I see is to make passes that replace dead values aware of attributes, e.g., let them clear them out. Though, I fear that also hides the problems only a few indirections deeper.

I don't think there's some deep class of problems hidden here beyond DeadArgElim itself.  The current rule is clear.  I would rather not change LangRef unless there's some interesting optimization that's blocked by the current semantics.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70749





More information about the llvm-commits mailing list