[llvm] r206228 - [ARM64][MC] Set the default CPU string to generic.

Juergen Ributzka juergen at apple.com
Mon Apr 21 19:54:35 PDT 2014


Hi Quentin,

this change “breaks" any JIT client that uses the C interface and generates code for ARM64.
The JIT won’t complain about the generic CPU and still generate code, but for the generic target. 

The problem is that the C interface currently doesn’t allow you to set the CPU type at all.
For example “CreateMCJITCompilerForModule” can pick up the target triple from the
module, but the CPU will always default to “generic”.

To fix this we could:
1.) Extend the C interface to also specify the CPU type and warn JIT clients that don’t specify a CPU for ARM64
2.) Default to “cyclone” for arm64-apple-* triples
3.) Every JIT client has to add the target processor attribute to the IR
4.) Revert this change

If we keep the “generic” CPU, then we should definitely add a warning message (took me quite some time to track this down).

Thanks

Cheers,
Juergen

On Apr 14, 2014, at 5:28 PM, Quentin Colombet <qcolombet at apple.com> wrote:

> Author: qcolombet
> Date: Mon Apr 14 19:28:39 2014
> New Revision: 206228
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=206228&view=rev
> Log:
> [ARM64][MC] Set the default CPU string to generic.
> 
> Modified:
>    llvm/trunk/lib/Target/ARM64/MCTargetDesc/ARM64MCTargetDesc.cpp
> 
> Modified: llvm/trunk/lib/Target/ARM64/MCTargetDesc/ARM64MCTargetDesc.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/MCTargetDesc/ARM64MCTargetDesc.cpp?rev=206228&r1=206227&r2=206228&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM64/MCTargetDesc/ARM64MCTargetDesc.cpp (original)
> +++ llvm/trunk/lib/Target/ARM64/MCTargetDesc/ARM64MCTargetDesc.cpp Mon Apr 14 19:28:39 2014
> @@ -44,10 +44,8 @@ static MCSubtargetInfo *createARM64MCSub
>                                                    StringRef FS) {
>   MCSubtargetInfo *X = new MCSubtargetInfo();
> 
> -  // FIXME: Make this darwin-only.
>   if (CPU.empty())
> -    // We default to Cyclone for now, on Darwin.
> -    CPU = "cyclone";
> +    CPU = "generic";
> 
>   InitARM64MCSubtargetInfo(X, TT, CPU, FS);
>   return X;
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list