Skip to content

[PERF] remove pointee types from cg_ssa and cg_llvm#105412

Closed
erikdesjardins wants to merge 4 commits intorust-lang:masterfrom
erikdesjardins:opaque
Closed

[PERF] remove pointee types from cg_ssa and cg_llvm#105412
erikdesjardins wants to merge 4 commits intorust-lang:masterfrom
erikdesjardins:opaque

Conversation

@erikdesjardins
Copy link
Contributor

@erikdesjardins erikdesjardins commented Dec 7, 2022

Modern LLVM (15+ by default) doesn't have pointee types, so computing them is a waste of time.

This can't be merged in its current state, because:

  • current LLVM 15 allows -Cllvm-args="-opaque-pointers=0" (not sure that we should support this configuration though)
  • we support older LLVM versions without fully working opaque pointers

Workarounds could be:

  • cx.type_ptr_to(|| ...compute pointee type...), closure only called in LLVM < 15 (kinda awkward)
  • targeted if llvm_version < 15 { cx.type_ptr_to(...compute pointee type...) } else { cx.type_i8p() } only at important callsites (might have to end up doing this)

This is just to measure the max possible perf win from everything.

r? @ghost

@rustbot label S-experimental

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

Labels

perf-regression Performance regression. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants