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

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 09:30:26 PST 2019


nlopes added a comment.

I think it's clear that dead arg elimination is incorrect in replacing a valid pointer with null in an attributed with non-null tag.  Changing the semantics on non-respecting the tags from UB to poison doesn't help either.
The problem with dropping attributes is that a given function call site, the attributes to be considered are the union of the attributes in the function call and in the callee declaration. We can't rely drop attributes from the callee since some linking later may add them back.

Some random ideas:

1. Introduce either negative attributes (so you can have A and !A), with !A meaning exclude A from the union of attributes
2. Introduce an attribute to stop the union with callee attributes (added when erasing attributes)
3. Introduce a placeholder value to be used in function calls that is not materialized and ignores all attributes.

3. sounds too specific for DeadArgElim, while 1) and 2) are more generic.  Not sure if the generality of 1) is needed.


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