lts with llvm 3.8 for ARM

Dan Olson via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Mar 10 08:28:17 PST 2016


Joakim <dlang at joakim.fea.st> writes:

> 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.

I was hoping those were only pre-3.8 release.  I ran into those when I
played with watchOS target.  I think LDC needs to use the PassManager
differently or the new PassManager?  I don't have any deep knowledge
here.  I ended up patching my fork of LLVM to rename optimization flags
so commandline and internal ones did not conflict.  AAarch64 has some
similar conflicts.

There is actually more stuff that doesn't work post 3.7 that needs
fixing, like some target option to disable fp elimination and something
to do with soft-float ABI.  I am writing this from memory but have notes
I can go over later this evening.  Should make LDC issues for these.
-- 
Dan


More information about the digitalmars-d-ldc mailing list