[PATCH] D33850: Inlining: Don't re-map simplified cloned instructions.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 16:57:23 PDT 2017


On Fri, Jun 30, 2017 at 4:21 PM, Davide Italiano via Phabricator <
reviews at reviews.llvm.org> wrote:

> davide added a comment.
>
> This actually seem to happen, i.e. we hit this assertion. We have an
> end-to-end (i.e. C test) that reduces to:
>
>   define void @patatino() {
>   for.cond:
>     br label %for.body
>
>   for.body:
>     %tobool = icmp eq i32 5, 0
>     %sel = select i1 %tobool, i32 0, i32 2
>     br i1 undef, label %cleanup1.thread, label %cleanup1
>
>   cleanup1.thread:
>     ret void
>
>   cleanup1:
>     %cleanup.dest2 = phi i32 [ %sel, %for.body ]
>     %switch = icmp ult i32 %cleanup.dest2, 1
>     ret void
>   }
>
>   define void @main() {
>   entry:
>     call void @patatino()
>     ret void
>   }
>
> crashing with `opt -inline` as when we call `SimplifyInstruction`
>
>   %switch = icmp ult i32 %cleanup.dest2, 1
>
> simplifies to
>
>   %tobool = icmp eq i32 5, 0
>
> This simplification, if something, is a little peculiar, as I expected
> that to just be simplified to `false`.
>

But the assert is that it should simplify to the copy of that instruction
that has already been inserted into main, and not to the copy remaining in
patatino.


>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D33850
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170630/0815b656/attachment.html>


More information about the llvm-commits mailing list