[PATCH] D68898: JumpThreading: enhance JT to handle BB with no successor and address comparison

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 12 22:01:21 PDT 2019


wmi added a comment.

I change the testcase a little so the terminator won't be ret, but the generated code pattern is the same. Should it be handled as well?

  ------------------------------------
  #include <array>
  #include <algorithm>
  
  constexpr std::array<int, 3> x = {1, 7, 17};
  bool global, cond;
  
  void Contains(int i) {
    global = std::find(x.begin(), x.end(), i) != x.end();
    if (cond)
      __builtin_printf("hello\n");
  }
  ------------------------------------


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

https://reviews.llvm.org/D68898





More information about the llvm-commits mailing list