[PATCH] D71960: [Attributor] AAUndefinedBehavior: Use AAValueSimplify in memory accessing instructions.

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 14 12:48:49 PST 2020


xbolva00 added a comment.

I have a similar case how to exploit UB to simplify code:

  int process(char *p) __attribute__((nonnull));
  
  
  void doit(bool b, char *d) {
      char *p = 0;
      if (b)
          p = d;
      process(p);
  }

In this case, it is invalid to call process with null pointer since args are nonnull, so we can remove branch and call process(d) directly.


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

https://reviews.llvm.org/D71960





More information about the llvm-commits mailing list