[llvm-dev] Instruction Execution With Hard Limitation at Runtime

Duan Bing via llvm-dev
2019-04-02T00:40:47Z

Got it, thanks!

Tim Northover <t.p.northover at gmail.com> 于2019年4月2日周二 上午12:27写道：

> Hi Duan,
>
> On Mon, 1 Apr 2019 at 16:16, Duan Bing via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > ifElseEnd41:                                      ; preds = %ifElse40,
> %ifElseEnd56
> >   call void @add_gas(i64 2)
> >   %380 = phi i32 [ %378, %ifElseEnd56 ], [ %379, %ifElse40 ]
> >   br label %ifElseEnd3
> >
> >
> > Use still stuck around after Def is destroyed:  %380 = phi i32 [ %40,
> %ifThen1 ], [ <badref>, %ifElseEnd41 ], !dbg !27
> > Assertion failed: (use_empty() && "Uses remain when a
value is
> destroyed!"), function ~Value, file
> /Users/duanbing/Project/llvm/llvm/lib/IR/Value.cpp, line 90.
> >
> > Can you give me some tips about what's happened or how to debug
this?
>
> The issue is that phi instructions must always be at the start of
> their basic block (see https://llvm.org/docs/LangRef.html#i-phi). You
> can use BasicBlock::getFirstNonPHI to get the correct insertion point
> for your call.
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20190402/680ecbd1/attachment.html>