[Bug 84232] PHINode containing itself causes segfault in LLVM when compiling Blender OpenCL kernel with R600 backend

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Oct 22 16:07:00 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=84232

--- Comment #10 from Vitaliy Filippov <vitalif at yourcmc.ru> ---
I've managed to make a reduced test case with a recursive PHI after
StructurizeCFG !!!

int main()
{
  int i, j = 0;
  while (j % 2)
  {
    if (j > 100)
      j += 3;
    else if (j > 50)
      break;
  }
  return j;
}

clang-3.5 -S -emit-llvm test3.c
opt-3.5 -S -structurizecfg test3.ll > test3cfg.ll

Simple to visualise with graphviz:

( echo 'digraph G {'; perl -ne 'if (/\%(\S+) = phi/) { my $a = $1; print "$a ->
$_;\n" for /\[ \%([^\s,]+)/g; }' test3cfg.ll; echo '}' ) > test3cfg.dot
dot -Tsvg test3cfg.dot > test3cfg.svg

%21 and %26 phi's loop in the result.

Also there is a branch on constant in the end of test3cfg.ll:

br i1 false, label %14, label %Flow2

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20141022/93093f58/attachment.html>


More information about the dri-devel mailing list