lts with llvm 3.8 for ARM

Kai Nacke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Mar 10 08:38:17 PST 2016


On Thursday, 10 March 2016 at 08:18:55 UTC, Joakim wrote:
> I've tried out native and cross-compiling for Android/ARM with 
> the just-released llvm 3.8.  I ran into an error when compiling 
> with any optimizations:
>
> ldc2: CommandLine Error: Option 'arm-load-store-opt' registered 
> more than once!
>             LLVM ERROR: inconsistency in registered CommandLine 
> options
>
> I tracked it down to llvm's addPassesToEmitFile, which calls 
> that optimization pass in two places, addPreRegAlloc and 
> addPreSched2:
>
> https://github.com/llvm-mirror/llvm/blob/master/lib/Target/ARM/ARMTargetMachine.cpp#L386
>
> However, llvm 3.7 does the same, so it appears that llvm 3.8 
> finally enforces that the same pass isn't inserted twice?
>
> I'm able to work around the issue by disabling that pass, using 
> --arm-load-store-opt=false.  All the same tests pass on 
> Android/ARM after that.
>
> Let me know if anyone else runs into the same issue with llvm 
> 3.8 for ARM.
>

Hi Joakim!

I know this error from LLVM 3.7 and aarch64 target. The problem 
is the PassNameParser used in gen/optimizer (~ line 44). The code 
is copied from the LLVM opt tool. I asked on the LLVM mailing 
list about it and got the recommendation to not use this approach 
in a productive tool because it is for test only.

I did not yet prepare a PR because it only affected the AArch64 
port. But now we should remove this feature.

Regards,
Kai

> Other tweaks:
>
> - I was able to use Kai's longdouble patch to cross-compile, 
> but I had to change ldc-real.h/cpp so that llvm::APFloat::mod 
> only called a single argument.
>
> - Dan's PR for std.internal.math.errorfunction 
> (https://github.com/ldc-developers/phobos/pull/25) is not 
> necessary with llvm 3.8, ie those tests pass without it.




More information about the digitalmars-d-ldc mailing list