[M3devel] llvm backend integration

Rodney M. Bates rodney_bates at lcwb.coop
Sat Aug 29 20:17:05 CEST 2015



On 08/28/2015 07:08 PM, Antony Hosking wrote:
> Sounds great!  What's missing?
>

No provision for starting from an intermediate file format, as there is
for m3cc.  Also, it might be nice to get the human-readable forms of the
two IRs as side outputs, for development work.  Just a convenience, though.
And, it just feels like Builder.m3 could use a good code review in general.

> Sent from my iPad
>
>> On 29 Aug 2015, at 5:45 am, Rodney M. Bates <rodney_bates at lcwb.coop> wrote:
>>
>> The llvm back end now has an initial degree of integration into cm3.  To get it, add
>>
>>   M3_BACKEND_MODE="StAloneLlvmAsm"
>>
>> near the front of the m3makefile, or elsewhere in quake code that will get interpreted.
>>
>> It does the following:
>>
>>   Runs the M3 front end, producing cm3 IR in a *.mc or *.mi file.
>>
>>   Runs the stand-alone program 'm3llvm', compiled by package m3-sys/llvm, to produce llvm
>>   bitcode IR, in file *.mb or *.ib.
>>
>>   Runs 'llc' (a main program that is part of llvm), to produce assembly code, in file *.ms or *.is.
>>
>>   Runs 'as' to assemble to object code, in file *.mo or *.io.
>>
>> Prerequisites:
>>   llc on the path.
>>   m3llvm on the path.
>>   as on the path.
>>
>>   In turn, building m3llvm will require llvm 3.5.0 headers and compiled libraries,
>>   see the m3makefile of llvm, which must give their locations.
>>
>> 'cm3 -keep' will retain all the intermediate files.  Only binary forms of the cm3 IR
>> and llvm IR are created, but you can get human-readable versions of them with
>> 'm3cgcat' and 'llvm-dis'.
>>
>> Look in m3-sys/cminstall/src/config-no-install/Unix.common, (which is installed to
>> /usr/local/cm3/bin/config/Unix.common) to make simple alterations to the command-line
>> parameters to m3llvm.  (Other targets are not supported).
>>
>> --
>> Rodney Bates
>> rodney.m.bates at acm.org
>> _______________________________________________
>> M3devel mailing list
>> M3devel at elegosoft.com
>> https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel
>

-- 
Rodney Bates
rodney.m.bates at acm.org



More information about the M3devel mailing list