[llvm-dev] [GlobalISel] A Proposal for global instruction selection

Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 18 15:01:30 PST 2015


> On Nov 18, 2015, at 1:32 PM, Quentin Colombet via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi James,
> 
>> On Nov 18, 2015, at 11:53 AM, James Molloy <james at jamesmolloy.co.uk> wrote:
>> 
>> Hi Quentin,
>> 
>> I'm really excited to see this happening!
>> 
>> My major question is over the testing story for this. How are we going to write unit tests for GIR?
> 
> Thanks for bringing that up!
> That is a very good question and also one that will require a lot of work to address properly.
> 
> Ultimately, I’d like we are able to write unit tests directly in the MachineInstr representation. Part of the goal of making the IR self contained, i.e., with no back links to LLVM IR, is to make the testing easier.
> 
> Now, to answer the question on how we do that, I have a pragmatic answer, though I am not proud of it:
> We are going to write unit tests with LLVM IR as input and check the MI output of the pass, e.g.,with print-after=IRTranslator.
> 
> That’s not great, but at least we can test now!
We do have the .mir dumping and reading. To me that code looks like it basically works and just might need a bug fix here and there. Should be the right thing to use when starting a new project like this, shouldn't it?

- Matthias



More information about the llvm-dev mailing list