[llvm-dev] [GlobalISel][RFC] Contract between LLVM IR and the backends for ISel

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 22 15:13:24 PST 2016


> On Jan 22, 2016, at 2:36 PM, Quentin Colombet via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi,
> 
> I would like your opinions on the contract we have between the LLVM IR and the backends.
> 
> 
> * Context *
> 
> Right now, the backends are supposed to be able to perform instruction selection on any valid LLVM IR.

Wishful thinking IMO.

Many IR constructs will be rejected by multiple in-tree backends today, because they expect a subset of the possible IR. Either they rely on some pass to “lower” the IR (CGP?), or they expect front-ends to avoid generating unsupported constructs.

— 
Mehdi



> Although this is *not* something I want to change for GlobalISel, I thought I brought that up on the mailing list to discuss the implications.
> 
> In particular, in the past, some people mentioned that they wanted to do (some part of) the legalization on LLVM IR. This may impact the contract we have between LLVM IR inputs and the backends and I would like to clarify that.
> 
> 
> * Feedback Needed *
> 
> 1. In your opinion where does a “backend" start?
> 
> For instance, does a backend starts at llc or at ISel?
> 
> 
> 2. Where does this contract apply?
> 
> For instance, is it at the start of the backend or at ISel (assuming those two definitions are different).
> 
> 
> * Implications *
> 
> Personally, I consider the backend starts at isel time and that the contract should remain what it is currently: being able to select any valid LLVM IR. I.e., this means we cannot rely on any LLVM IR legalization without changing the contract.
> 
> Thoughts?
> 
> Thanks,
> -Quentin
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list