[llvm-dev] [RFC] Implementing asm-goto support in Clang/LLVM

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 25 14:41:49 PDT 2018


On 10/25/2018 1:58 PM, Ivchenko, Alexander via llvm-dev wrote:
>
> * Due to the way successor and predecessor detection works, some CFG 
> simplifications such as trivial block elimination may be blocked if 
> they would result in duplicate successors for the callbr instruction, 
> as such duplicate successors are incorrectly processed in the IR and 
> cannot be removed due to being used by the callee
>

I'm not sure I follow what the issue is here; why can't a block appear 
multiple times in the successor list?  It happens routinely for other 
kinds of branches.

> * While the initial implementation of asm-goto won’t allow outputs, 
> the instruction’s syntax supports them in principle, so the support 
> for this can be added at a later date
>

It's fine if you don't want to actually implement this now, but we 
probably need a rough idea for how it will be implemented, so we're 
reasonably confident we won't have to change the semantics of callbr.  
Specifically, do we need to impose any restrictions on the successors of 
a callbr to allow reasonable code generation?  Without any rules, PHI 
nodes involving the outputs of callbr instructions could be very awkward 
to lower.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181025/53f9ac04/attachment.html>


More information about the llvm-dev mailing list