www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [OT] LLVM tricks

reply Sergey <kornburn yandex.ru> writes:
Nice article with some interesting gotchas about LLVM IR 
optimizations. The article mostly about Zig, but as it stated 
"That’s a theme—any trick you do with LLVM IR would work for any 
LLVM-based language."

https://tigerbeetle.com/blog/2023-07-26-copy-hunting/

Wonder if those kind of analysis is possible to re-implement for 
LDC :)
Hope someone else will find this info useful too.
Jul 29 2023
parent reply Daniel N <no public.email> writes:
On Saturday, 29 July 2023 at 08:21:24 UTC, Sergey wrote:
 Nice article with some interesting gotchas about LLVM IR 
 optimizations. The article mostly about Zig, but as it stated 
 "That’s a theme—any trick you do with LLVM IR would work for 
 any LLVM-based language."

 https://tigerbeetle.com/blog/2023-07-26-copy-hunting/

 Wonder if those kind of analysis is possible to re-implement 
 for LDC :)
 Hope someone else will find this info useful too.
Yeah, already works. --output-ll - Write LLVM IR
Jul 29 2023
parent Johan <j j.nl> writes:
On Saturday, 29 July 2023 at 09:44:57 UTC, Daniel N wrote:
 On Saturday, 29 July 2023 at 08:21:24 UTC, Sergey wrote:
 Nice article with some interesting gotchas about LLVM IR 
 optimizations. The article mostly about Zig, but as it stated 
 "That’s a theme—any trick you do with LLVM IR would work for 
 any LLVM-based language."

 https://tigerbeetle.com/blog/2023-07-26-copy-hunting/

 Wonder if those kind of analysis is possible to re-implement 
 for LDC :)
 Hope someone else will find this info useful too.
Yeah, already works. --output-ll - Write LLVM IR
And you can see all of that too on godbolt. (also for GDC) https://d.godbolt.org/z/6jxdcdEsz -Johan
Jul 29 2023