[PATCH] D89050: Add support for !noundef metatdata on loads

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 10:01:39 PDT 2020


nikic added a comment.

In D89050#2319554 <https://reviews.llvm.org/D89050#2319554>, @jdoerfert wrote:

> While this is certainly in line with the prior art, I would like to revisit the trade-offs of metadata on loads vs assume. While we need to make assume side-effect free (but potentially UB so we keep control dependences), it would allow us to reduce the number of encodings. Let's say you promote a load with `noundef`, you might introduce an "assume nodundef" for the promoted value anyway. That begs the question why not use assume anyway. (FWIW, when metadata was introduced for these things assume did not allow non-boolean properties.)

For some frontends (that model safe languages) it might be that *all* loads are noundef. While the work on assume bundles has improved the interaction of assumes with other optimizations, I think there are sufficient remaining issues that this kind of mass usage would probably result in regressions, especially as the optimization benefit of this metadata is currently rather minor. Additionally the sheer quantity of necessary assumes would likely have a non-trivial adverse effect on compile-time. If your original IR had 15% loads, and now you add one extra assume for every load, that will be a significant increase in instructions (not that metadata is completely free either).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89050



More information about the llvm-commits mailing list