From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 84232] PHINode containing itself causes segfault in LLVM when compiling Blender OpenCL kernel with R600 backend Date: Wed, 22 Oct 2014 23:07:00 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0607700592==" Return-path: Received: from culpepper.freedesktop.org (unknown [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id BD59B89EB4 for ; Wed, 22 Oct 2014 16:07:00 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0607700592== Content-Type: multipart/alternative; boundary="1414019220.CAbCe3D02.18157"; charset="UTF-8" --1414019220.CAbCe3D02.18157 Date: Wed, 22 Oct 2014 23:07:00 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" https://bugs.freedesktop.org/show_bug.cgi?id=84232 --- Comment #10 from Vitaliy Filippov --- 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. --1414019220.CAbCe3D02.18157 Date: Wed, 22 Oct 2014 23:07:00 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"

Comment # 10 on bug 84232 from
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.
--1414019220.CAbCe3D02.18157-- --===============0607700592== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0607700592==--