[LLVMdev] [PATCH][RFC] HSAIL Target

Tom Stellard tom at stellard.net
Mon Jun 22 10:22:05 PDT 2015


On Mon, Jun 22, 2015 at 10:06:30AM -0700, Pete Cooper wrote:
> 
> > On Jun 22, 2015, at 9:31 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> > 
> > 
> > > One noteworthy difference from how other targets are structured is there are two code emission paths in the backend. The first path, which is the original used by the internal OpenCL compiler, uses a third party library (libHSAIL) for code emission plugged into the AsmPrinter. The reason for this is partially legacy, and partially because the HSA specification defines its own object format, BRIG, which is unlike any of the supported object formats such as ELF. Supporting BRIG in MC would be a challenge (largely because it is not really streamable), but attempting to emit it using the standard infrastructure may be a consideration in the future. This path supports emitting object files and text output via libHSAIL's disassembler. The second path which I've implemented over the past few months uses a normal AsmPrinter emitting HSAIL text using the standard MC infrastructure, and does not support object output. The two paths have similar pass rates on the C++ AMP conformance test suite, and should produce the same output except for some whitespace and comment differences.
> > 
> > This part is scary.
> > 
> > Having a third party library dependency is very undesirable from a testing perspective.
> > 
> > One of the important property of MC is avoiding the need for two code paths in the code generator.
> > 
> > If MC cannot support the format you need, we should work on fixing that in a way that maintains the property that most code is shared when writing objects or assembly. This is a need that is shared by Webassembly I think.
> > 
> > My suggestion would be to start with just the assembly printing path and work to figure out what needs to happen in MC.
> > 
> I wonder if we need a ‘raw’ version of MC which literally only emits bytes to the stream and doesn’t nothing else.  Of course there would be a ton of details to work out, like whether the raw MC supports sections, symbols, relocations, etc.  That might be just as much work as just adding a BRIG emitter.
> 

This used to exist.  It was called MCPureStreamer and was removed about a year ago.
We may be able to bring it back if it would be useful.

-Tom

> Just a thought though.
> 
> Cheers,
> Pete
> > Cheers, 
> > Rafael
> > 
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 

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