[LLVMdev] Proposal for new Legalization framework

Evan Cheng evan.cheng at apple.com
Fri Apr 26 08:43:16 PDT 2013


Hi Reed,


Sent from my iPad

On Apr 25, 2013, at 3:46 PM, Reed Kotler <rkotler at mips.com> wrote:

> On 04/24/2013 07:39 PM, Chris Lattner wrote:
>> On Apr 24, 2013, at 6:27 PM, Reed Kotler <rkotler at mips.com> wrote:
>>> I would really push towards doing this in LLVM IR as the next step.
>> 
>> What makes you say that?
>> 
>>> It's possible that what you are proposing is the right "long term" solution but I think it's not a good evolutionary approach; it's more revolutionary.
>> 
>> Doing this in LLVM IR seems like a major step backwards.  It gets us no closer to the ultimate goal, would add a ton of code, and would make the compiler more complex.
>> 
>> -Chris
> I did not really answer you question very succinctly because I ranted about selection DAG and that's not the issue here.
> 
> So you want to have a machine ir and Dan was proposing to do it regular IR.
> 
> My main reason for using regular IR is that I think it's more likely to be doable in an incremental way and I don't see how creating another IR will help things.

I believe we, i.e. the entire llvm community, agree that replacing the instruction selector a big undertaking. I believe it will be the most complex and lengthy one that we would have done. It will take some time to create an alternative to selectiondag. Then it will take a couple of years still to migrate the existing targets over before we can kill off selectiondag. 

Given that, we really want one true alternative that will live for a long time. So doing instruction selection in llvm IR doesn't make sense unless we believe it will satisfy all of our goals. It will just a technical debt which will be hard to eliminate if it finds a client. 

> 
> You can add to the existing IR things that are needed to make it powerful enough to do what machine IR would do.
> 
> In the end, machine IR will look just like a subset of the current IR plus some additional things so I don't see how it helps make a new one and now there will be many things that are similar to IR but with slightly different rules, a different C++ class definition, etc.
> 
> I think that path to a machine IR will be very lengthy unless Apple and Google are willing to throw a lot of high quality resources that way.

Many people are thinking hard about it. I'm optimistic that some concrete proposals will be presented to the community in the next 2-3 months. In the mean time, I think it's best if the interested parties meet to discuss this in person (sorry I understand this is not possible for some). To me, it's almost impossible to discuss such a broad topic in email threads since it will inevitably splinter into multiple threads. 

Evan

> 
> 
> Reed
> 
> 
> _______________________________________________
> 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