[PATCH] D28625: [InstCombine] try to shrink bitwise logic with phi operand

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 13:19:45 PST 2017

efriedma added a comment.

If you unroll your example loop once, it no longer gets recognized.

Another kind of similar pattern:

  int array_max(int n, char *p) {
    int result = 0;
    for (int i = 0; i < n; ++i)
      result = result > p[i] ? result : p[i];
    return result;


More information about the llvm-commits mailing list