On 7/24/14, 7:18 AM, Tim Northover wrote: [...]> Which triple are you using? And is the correct code used when you run > the same IR through "llc -mtriple=whatever"?armv7-linux-gnueabihf, as suggested; and if I use llc -mtriple then the code compiles to: vstr s0, [r0] bx lr ...which I would consider correct. (What's more interesting is *without* specifying the triple llc generates armel code. Should llc default to generating code which will actually run on a given platform? Is it possible my version of llvm has been compiled with the wrong options? clang generates correct code, but it looks like it's not going via llc.)> Finally, which version of LLVM are you using?llvm-3.5, as supplied by Debian. [...]> It ought to be the environment part of the triple that controls it: > eabihf or gnueabihf, for example.Does the system support linking together multiple modules with different triples? Since my function is externally visible, is it deliberately using the armel calling convention because it thinks it's being called from code where my triple doesn't apply? Should I be setting the triple on the execution engine as a whole (which I've avoided so far because the API looks painful)? [...]> Did you try setting a breakpoint in that function I mentioned and > finding out just which test fails on the path to returning AAPCS_VFP?No; I don't have a debugger on this platform. -- ┌─── dg@cowlark.com ───── http://www.cowlark.com ───── │ "Feminism encourages women to leave their husbands, kill their │ children, practice withcraft, destroy capitalism and become lesbians." │ --- Rev. Pat Robertson -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 876 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140724/a93136d2/attachment.sig>
> Should llc default to > generating code which will actually run on a given platform? Is it > possible my version of llvm has been compiled with the wrong options?It's a configure-time option, I believe. It's entirely possible the Debian packages have it wrong, but I'd always have and test with an override: if I could make a default work that would just be bonus success.> Does the system support linking together multiple modules with different > triples?Not really. You'll probably get some code out the other end, but with a pretty much randomly chosen triple. More features along those lines are planned (it's useful for CPU-specific routines, particularly during LTO).>> Did you try setting a breakpoint in that function I mentioned and >> finding out just which test fails on the path to returning AAPCS_VFP? > > No; I don't have a debugger on this platform.That's probably the first thing I'd look at fixing. Beyond that, before even thinking about implementing a JITing compiler, I'd build LLVM with debugging symbols and make sure I build against that. LLVM's API just isn't packaged for people to use as a black box. It's the ad-hoc mixture of all the bells and whistles existing users have found useful, without the important ones being marked. I could suggest various diagnostics at this point, but they'd all come back to a debugger very quickly. Cheers. Tim.
On 7/24/14, 7:06 PM, Tim Northover wrote: [...]>> No; I don't have a debugger on this platform. > > That's probably the first thing I'd look at fixing.Oddly enough, I find myself rather disinclined to debug gdb... [...]> LLVM's API just isn't packaged for people to use as a black box. It's > the ad-hoc mixture of all the bells and whistles existing users have > found useful, without the important ones being marked.I've noticed. I should add that my application works absolutely fine on amd64 on Linux and OS X; I'm not trying to *develop* on ARM, merely get an existing app working. I'm reasonably confident that the logic is correct. When developing an LLVM backend, I've used tracing to find out what the compiler was doing while generating code; is the tracing logic built in to the JIT? Can it be enabled? That should at least tell me *why* it's picking the registers it is. -- ┌─── dg@cowlark.com ───── http://www.cowlark.com ───── │ "Feminism encourages women to leave their husbands, kill their │ children, practice withcraft, destroy capitalism and become lesbians." │ --- Rev. Pat Robertson -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 876 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140724/67e485ea/attachment.sig>