Skip to content

Prepare for LLVM 9 update#62474

Merged
bors merged 8 commits intorust-lang:masterfrom
nikic:update-llvm
Jul 10, 2019
Merged

Prepare for LLVM 9 update#62474
bors merged 8 commits intorust-lang:masterfrom
nikic:update-llvm

Conversation

@nikic
Copy link
Copy Markdown
Contributor

@nikic nikic commented Jul 7, 2019

Main changes:

  • In preparation for opaque pointer types, the byval attribute now takes a type. As such, the argument type needs to be threaded through to the function/callsite attribute application logic.
  • On ARM the +fp-only-sp and +d16 features have become -fp64 and -d32. I've switched the target definitions to use the new names, but also added bidirectional emulation so either can be used on any LLVM version for backwards compatibility.
  • The datalayout can now specify function pointer alignment. In particular on ARM Fi8 is specified, which means that function pointer alignment is independent of function alignment. I've added this to our datalayouts to match LLVM (which is something we check) and strip the fnptr alignment for older LLVM versions.
  • The fmul/fadd reductions now always respect the accumulator (including for unordered reductions), so we should pass the identity instead of undef.

Open issues:

  • https://reviews.llvm.org/D62106 causes linker errors with ld.bdf due to https://sourceware.org/bugzilla/show_bug.cgi?id=24784. To avoid this I've enabled RelaxELFRelocations, which results in a GOTPCRELX relocation for __tls_get_addr and avoids the issue. However, this is likely not acceptable because relax relocations are not supported by older linker versions. We may need an LLVM option to keep using PLT for __tls_get_addr despite RtLibUseGOT.

The corresponding llvm-project PR is rust-lang/llvm-project#19.

r? @ghost

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants