[LLVMdev] If Conversion and predicated returns

Hal Finkel hfinkel at anl.gov
Wed Apr 10 15:09:03 PDT 2013


----- Original Message -----
> From: "Krzysztof Parzyszek" <kparzysz at codeaurora.org>
> To: llvmdev at cs.uiuc.edu
> Sent: Wednesday, April 10, 2013 1:10:32 PM
> Subject: Re: [LLVMdev] If Conversion and predicated returns
> 
> On 4/10/2013 12:45 PM, Hal Finkel wrote:
> >
> > Should AnalyzeBranch be enhanced to somehow indicate conditional
> > returns?
> 
> I don't think that returns can ever be analyzable (since LLVM's CFG
> does
> not have a designated exit block).
> 
> 
> > Alternatively, the diamond conversion routine contains this:
> >
> >    // RemoveExtraEdges won't work if the block has an unanalyzable
> >    branch,
> >    // which can happen here if TailBB is unanalyzable and is
> >    merged, so
> >    // explicitly remove BBI1 and BBI2 as successors.
> >    BBI.BB->removeSuccessor(BBI1->BB);
> >    BBI.BB->removeSuccessor(BBI2->BB);
> >    RemoveExtraEdges(BBI);
> >
> > should something similar be added prior to the calls to
> > RemoveExtraEdges in the simple and triangle conversion routines?
> 
> Both of these cases know what scenario they are dealing with (i.e.
> whether there is a return instruction in the block or not), so they
> should be able to handle the edge updates (just like the diamond
> case).
>   The only special case would be when the CFG edges go to the same
>   block
> (i.e. there is a conditional branch whose both paths end up in the
> same
> place), but I think that if-conversion would give up on that (or that
> the branch folder would take care of it).

Seemed simply enough. r179227.

Thanks again,
Hal

> 
> My 2c.
> 
> -Krzysztof
> 
> 
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> hosted by The Linux Foundation
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 



More information about the llvm-dev mailing list