Discussion
Loading...

#Tag

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Stéphane Bortzmeyer boosted
arya dradjica
@bal4e@tech.lgbt  ·  activity timestamp 4 hours ago

Optimizing Rust code is really fun. When something is run millions or billions of times, nanoseconds and individual CPU instructions matter. The best way to do this isn't to write assembly -- it's to put yourself in LLVM's place, understand the kinds of optimizations it wants to perform, and understand what is blocking them. A common case I run into is "LLVM wants to represent (a, b) as (a + b, b), but it's part of a struct so the change has to be performed every time the struct is loaded." LLVM can't change the struct, obviously...

Has anybody tried teaching LLVM data structure optimization? Along the lines of: "Here's a struct with a completely undefined layout and representation, and every single function that can access the struct. Based on the uses, try to memoize common computations by adding new fields, and try removing unused fields." Getting there requires locating all uses of the fields of a struct, but this is possible (at least, quite often) in Rust.

#programming #optimization #llvm

  • Copy link
  • Flag this post
  • Block
arya dradjica
@bal4e@tech.lgbt  ·  activity timestamp 4 hours ago

Optimizing Rust code is really fun. When something is run millions or billions of times, nanoseconds and individual CPU instructions matter. The best way to do this isn't to write assembly -- it's to put yourself in LLVM's place, understand the kinds of optimizations it wants to perform, and understand what is blocking them. A common case I run into is "LLVM wants to represent (a, b) as (a + b, b), but it's part of a struct so the change has to be performed every time the struct is loaded." LLVM can't change the struct, obviously...

Has anybody tried teaching LLVM data structure optimization? Along the lines of: "Here's a struct with a completely undefined layout and representation, and every single function that can access the struct. Based on the uses, try to memoize common computations by adding new fields, and try removing unused fields." Getting there requires locating all uses of the fields of a struct, but this is possible (at least, quite often) in Rust.

#programming #optimization #llvm

  • Copy link
  • Flag this post
  • Block
d@nny disc@ mc²
@hipsterelectron@circumstances.run  ·  activity timestamp last month

i feel like if you have an entire support matrix predicated on whether your fucked up build process can build your fucked up fork maybe it's time to reconsider your priorities. like why are you owning that internal build in the first place? i need to make sure i've got this right

d@nny disc@ mc²
@hipsterelectron@circumstances.run replied  ·  activity timestamp last month

like come on

# Indicates whether the LLVM testsuite is enabled in the build or not. Does
# not execute the tests as part of the build as part of x.py build et al,
# just makes it possible to do `ninja check-llvm` in the staged LLVM build
# directory when doing LLVM development as part of Rust development.
#llvm.tests = false

did no one question "hey why do we need to set these things here in the first place if it doesn't matter and we can just delegate to llvm's existing build system?"? idk

  • Copy link
  • Flag this comment
  • Block
N-gated Hacker News
@ngate@mastodon.social  ·  activity timestamp last month

👀 Wow, hold your horses! Zig builds are apparently breaking the sound barrier now. 🚀 After years of intense labor and a bit of #LLVM yeeting, they've achieved the unimaginable: a #compiler that might finally compile something before your coffee goes cold. ☕️🔥
https://mitchellh.com/writing/zig-builds-getting-faster #ZigLang #SoundBarrier #FastCompilation #HackerNews #ngated

Mitchell Hashimoto

Zig Builds Are Getting Faster

  • Copy link
  • Flag this post
  • Block
Jacket
@jacket@tech.lgbt  ·  activity timestamp 2 months ago

This is not helping me in the market but what I love doing the most is computer language engineering. I'm learning how to write an #LSP right now to support my born language in neovim. I also discovered #LLVM recently. It lets you compile to any target from a generic ASM. It made me realize something. The first languages where all compiled. Then, we got the interpreted languages. But recently, the new languages are all compiled again! Think of #rust, #go, #zig, #elixir. I wonder if it's because we perfected the tooling in a way that maintaining a compiled language is not that hard anymore. Go is a weird one. It has a garbage collector. Yeah! A compiled language with a garbage collector. It means that there is a process that is embedded in the executable to just do garbage collection. We might now have a real reason anymore to interpret.

  • Copy link
  • Flag this post
  • Block
Ben Ramsey boosted
Mishal
@shahmishal@mastodon.social  ·  activity timestamp 4 months ago

My team at Apple is currently hiring for a role that focuses on compiler tools and infrastructure. If you’re interested in this opportunity, please take a look at the job posting here: https://jobs.apple.com/en-us/details/200613714/compiler-tools-engineer?team=SFTWR #llvm #swiftlang

  • Copy link
  • Flag this post
  • Block
Mishal
@shahmishal@mastodon.social  ·  activity timestamp 4 months ago

My team at Apple is currently hiring for a role that focuses on compiler tools and infrastructure. If you’re interested in this opportunity, please take a look at the job posting here: https://jobs.apple.com/en-us/details/200613714/compiler-tools-engineer?team=SFTWR #llvm #swiftlang

  • Copy link
  • Flag this post
  • Block
Jan :rust: :ferris:
@janriemer@floss.social  ·  activity timestamp 5 months ago

TPDE Compiler Back-End Framework

https://arxiv.org/abs/2505.22610

"TPDE-LLVM: a standalone back-end for LLVM-IR, which compiles 10--20x faster than LLVM -O0 with similar code quality, usable as library (e.g., for JIT), as tool (tpde-llc), and integrated in Clang/Flang (with a patch)."

Holy cow! 🤯

Open Source on GitHub:
https://github.com/tpde2/tpde

#Performance#Compiler#LLVM

  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login