Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHI nodes not grouped at top of basic block! #779

Open
regehr opened this issue Jun 26, 2020 · 0 comments
Open

PHI nodes not grouped at top of basic block! #779

regehr opened this issue Jun 26, 2020 · 0 comments

Comments

@regehr
Copy link
Collaborator

regehr commented Jun 26, 2020

int a[], f[];
int b, c, d;
long e;
void g() {
  for (; a <= 6; b++) {
    c = 6;
    for (; c >= 0; c--) {
      d = 6;
      for (; d >= 0; d--)
        f[d] = f >= --e < d;
    }
  }
}

compiled like this:

SOUPER_VERIFY=1 SOUPER_DISABLE_LLVM_PEEPHOLES=true SOUPER_ENUMERATIVE_SYNTHESIS_MAX_INSTS=1 ~/souper-regehr/build/sclang -O3 foo.c

ends up with:

PHI nodes not grouped at top of basic block!
  %inc.lcssa = phi i32 [ %inc, %for.inc13 ]
label %for.cond.for.end14_crit_edge
fatal error: error in backend: module broken after (and probably by) Souper
clang-11: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 11.0.0 (https://github.com/regehr/llvm-project.git cbd3118ced344b1c1d7b7023a13abdbc68ba5624)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/regehr/souper-regehr/third_party/llvm-Debug-install/bin
clang-11: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-11: note: diagnostic msg: /tmp/foo-4edb20.c
clang-11: note: diagnostic msg: /tmp/foo-4edb20.sh
clang-11: note: diagnostic msg: 

********************
zoecarver added a commit to zoecarver/souper that referenced this issue Oct 6, 2020
If replacing a PHI node with another instruction, make sure the
insertion point is after the last PHI node in that block. This prevents
the assertion described in google#779.
zoecarver added a commit to zoecarver/souper that referenced this issue Oct 6, 2020
If replacing a PHI node with another instruction, make sure the
insertion point is after the last PHI node in that block. This prevents
the assertion described in google#779.
zoecarver added a commit to zoecarver/souper that referenced this issue Oct 7, 2020
If replacing a PHI node with another instruction, make sure the
insertion point is after the last PHI node in that block. This prevents
the assertion described in google#779.
zoecarver added a commit to zoecarver/souper that referenced this issue Oct 9, 2020
If replacing a PHI node with another instruction, make sure the
insertion point is after the last PHI node in that block. This prevents
the assertion described in google#779.
regehr pushed a commit that referenced this issue Oct 16, 2020
If replacing a PHI node with another instruction, make sure the
insertion point is after the last PHI node in that block. This prevents
the assertion described in #779.
Jacarte pushed a commit to KTH/souper that referenced this issue Dec 21, 2020
If replacing a PHI node with another instruction, make sure the
insertion point is after the last PHI node in that block. This prevents
the assertion described in google#779.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant