[llvm-commits] Request for merge: GHC/ARM calling convention.

Karel Gardas karel.gardas at centrum.cz
Wed Aug 1 13:35:46 PDT 2012


Hello,

first of all, similar email was sent a month ago to llvmdev@ mailing 
list, but I've been kindly notified by Renato Golin and David Blaikie 
that the proper way to submit patch for merge is by sending it to this 
mailing list instead of llvmdev at . So I'm doing this now leaving the text 
of original email intact but updating attached patch to current (today) 
LLVM HEAD. Original email text follows:

One of the LLVM 3.0 new feature was a support for GHC
specific calling convention on ARM platform. It looks like this support
was merged just into 3.0 branch, specifically it appeared in 3.0 RC2.
Anyway, I hope this is just a mistake or omission that such support was
merged only into 3.0 and not also into HEAD. I've just found it by
testing LLVM 3.1 with GHC 7.4.2 and LLVM complained to me about
unsupported calling convention which was surprising for me and I've gone
for a little bit investigation and found all the GHC/ARM calling
convention code missing from it.

So I've grabbed LLVM HEAD and applied the GHC/ARM calling convention
patch to it with some tweaks to resolve rejects. I've also changed a
patch a little bit to use LLVM's facility to generate callee-saved regs
list automatically from ARMCallingConv.td. However either I don't know
well syntax for callee save regs specification or the tool does not
support empty list, I've needed to use simple work around to come to the
same result as was in the previous patch version. (For those interested,
the error with empty list was "expected identifier in dag init")

+// GHC set of callee saved regs is empty as all those regs are
+// used for passing STG regs around
+// sub/add LR is a workaround for not being able to compile empty list:
+// def CSR_GHC : CalleeSavedRegs<()>;
+def CSR_GHC : CalleeSavedRegs<(sub (add LR), LR)>;

otherwise, the patch is the same like it was merged into 3.0 release as
submitted here:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/044173.html

Please see attached patch and tell me if it's all right for inclusion
into LLVM HEAD or not and if not, what else shall I provide in order to
make LLVM team happy about it.

BTW: of course, LLVM HEAD with this patch applied is already tested here
with GHC 7.4.2. (i.e. the compiler bootstrap well with it) and LLVM's
own testsuite does not reveal any new regression caused by this patch.

Thanks a lot!
Karel


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: llvm-ghc-arm.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120801/2d5f5ece/attachment.ksh>


More information about the llvm-commits mailing list