[polly] r250693 - Synthesize phi arguments in incoming block

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 03:19:22 PDT 2015


On 10/19/2015 11:19 AM, Michael Kruse via llvm-commits wrote:
> Author: meinersbur
> Date: Mon Oct 19 04:19:25 2015
> New Revision: 250693
>
> URL: http://llvm.org/viewvc/llvm-project?rev=250693&view=rev
> Log:
> Synthesize phi arguments in incoming block
>
> New values were always synthesized in the block of the instruction
> that needed them. This is incorrect for PHI node whose' value must be
> defined in the respective incoming block. This patch temporarily moves
> the builder's insert point to the incoming block while synthesizing phi
> node arguments.
>
> This fixes PR25241 (http://llvm.org/bugs/show_bug.cgi?id=25241)

You can also write llvm.org/PR25241

> +++ polly/trunk/test/Isl/CodeGen/pr25241.ll Mon Oct 19 04:19:25 2015
> @@ -0,0 +1,61 @@
> +; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s
> +
> +; PR25241 (https://llvm.org/bugs/show_bug.cgi?id=25241)
> +; Ensure that synthesized values of a PHI node argument are generated in the
> +; incoming block, not in the PHI's block.
> +
> +; CHECK-LABEL: polly.stmt.if.then.862:
> +; CHECK:         %[[R1:[0-9]+]] = add i32 %tmp, 1
> +; CHECK:         br label
> +
> +; CHECK-LABEL: polly.stmt.while.body.740.region_exiting:
> +; CHECKL         %polly.curr.3.ph = phi i32 [ undef, %polly.stmt.if.else.864 ], [ %[[R1]], %polly.stmt.if.then.862 ]

CHECK:

Thanks,
Tobias


More information about the llvm-commits mailing list