[PATCH] D75799: [JumpThreading] Don't create PHI nodes with "is.constant" values

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 12:33:08 PDT 2020


void added a comment.

In D75799#1931173 <https://reviews.llvm.org/D75799#1931173>, @joerg wrote:

> IMO the root of the problem here is that the branches are mixing predicated variables (bytes) with non-predicated variables (sz). If users want deterministic behavior here, that shouldn't be done.


I don't understand. The `builtin_expect()` call is only a suggestion to the compiler that a branch may or may not be taken. I don't see why this isn't allowed:

  if (sz >= 0 && sz < bytes) {
      if (!__builtin_constant_p(bytes))
      ...
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75799





More information about the llvm-commits mailing list