[LLVMdev] [llvm-commits] [llvm] r160610 - /llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp

Kaylor, Andrew andrew.kaylor at intel.com
Thu Sep 13 10:57:58 PDT 2012


OK, so I'll modify selectTarget() to use the Module triple for MCJIT but LLVM_HOSTTRIPLE for the old JIT and interpreter.

I'm adding code to look for 'elf' in the environment part of the triple, so while that doesn't currently do anything for MCJIT, it will when I'm done.

I'm also trying to add something to the MCJIT lit.local.cfg to make sure the tests are only run on target-compatible hosts.

Thanks for your help.

-Andy

-----Original Message-----
From: NAKAMURA Takumi [mailto:geek4civic at gmail.com] 
Sent: Thursday, September 13, 2012 3:35 AM
To: Kaylor, Andrew
Cc: llvm-commits at cs.uiuc.edu; llvmdev
Subject: Re: [llvm-commits] [llvm] r160610 - /llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp

2012/9/13 Kaylor, Andrew <andrew.kaylor at intel.com>:
> I'm a bit confused as to what is supposed to happen in the cross building scenarios.  For instance, if host=x86_64-linux and target=i686-mingw32, what should the MCJIT tests do?  Should they be suppressed because the architectures don't match?  If so, what about the case where host=x86_64-linux and target=x86_64-mingw32?

Basically, I don't think local JIT could execute other environments.
Both {i686|x86_64}-mingw32 are incompatible to Linux, at least.

It should be suppressed unless the target could run as RemoteTarget.

BTW, do you think -target i686-linux should run under x86_64 binary?
(I wish so, but it would involve some issues...)

> I'm modifying the MCJIT tests so that they will provide an explicit target triple on the run line.  In the case where the host OS is Windows, I'm appending "-elf" to the target triple.  I think that should be sufficient to make things work in the cases where the host triple and the target triple are compatible, and then I can suppress the cases where host and target aren't compatible in the lit.local.cfg file.
>
> Does that sound right?

Do you mean; "-mtriple=%{targettriple_provided_by_lit}-elf" ?
I think MCJIT may reinterpret the triple to be accepted by elf.

> My concern is that I don't quite know how to predict what will happen on some of the buildbots aside from checking something in and seeing what happens.  Hopefully any obvious problems will be caught in code review.

I can investigate failures if they happened in my builders. All of my builders are in my room :)

> Aside from the testing, it seems to me that TargetSelect should always use the Module target triple, and if it isn't compatible with the host environment then it will just fail.

It should be better that Target may be overridden. It was the reason why I tweaked TargetSelect().

...Takumi




More information about the llvm-dev mailing list