[PATCH] D109789: [SCEV] Stop blindly propagating flags from inbound geps to SCEV nodes

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 14:27:36 PST 2021


dim added a comment.

>From a fellow FreeBSD user I received a test case which *appears* to be fixed by this particular review/commit, and which otherwise leads to an assertion:

  Assertion failed: (isSCEVable(Ty) && "Type is not SCEVable!"), function getTypeSizeInBits, file /usr/src/contrib/llvm-project/llvm/lib/Analysis/ScalarEvolution.cpp, line 3922.
  PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
  Stack dump:
  0.      Program arguments: clang -cc1 -triple x86_64-- -S -target-cpu znver3 -O2 read_termcap-min.c
  1.      <eof> parser at end of file
  2.      Code generation
  3.      Running pass 'Function Pass Manager' on module 'read_termcap-min.c'.
  4.      Running pass 'Loop Pass Manager' on function '@e'
  5.      Running pass 'Loop Strength Reduction' on basic block '%while.cond2.15'

However, it *needs* the `-target-cpu znver3`, otherwise the assertion won't trigger. I assume this review/commit is not expected to fix this?

For reference, the minimized test case is just this (easiest is to use clang 13.0.0 to check it, it should assert right away):

  // clang -cc1 -triple x86_64-- -S -target-cpu znver3 -O2 read_termcap-min.c
  char *a;
  char **b;
  char *d[0];
  int e() {
    char c[0];
    b = d;
    a = c;
    while (++a)
      if (*a) {
        while (++a)
          if (*a)
            break;
        b++;
        if (b >= d + 32)
          break;
      }
    return 0;
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109789



More information about the llvm-commits mailing list