Question about Alias analysis #96434
-
Hi, I noticed that according to this document, Ryujit has implemented the dead store elimination optimization. However, it appears that it does not implement Alias analysis like LLVM does in its compiler backend. I'm curious about the difference between having or not having alias analysis for DSE. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Indeed, RyuJit doesn't implement general LLVM-style alias analysis. It does have a scoped version as part of the value numbering. It does mean we don't dead-store writes to non-local memory. In a sense, the more general analysis is important in LLVM because it represents local memory modification via stores to |
Beta Was this translation helpful? Give feedback.
-
That's cool, thanks for your explanation! |
Beta Was this translation helpful? Give feedback.
Indeed, RyuJit doesn't implement general LLVM-style alias analysis. It does have a scoped version as part of the value numbering.
It does mean we don't dead-store writes to non-local memory. In a sense, the more general analysis is important in LLVM because it represents local memory modification via stores to
alloca
s, while in RyuJit both enregisterable values and things like structs areLCL_VAR
s. And, of course, LLVM has a very complex pointer aliasing model that is intended to take advantage of the optimization opportunities presented by liberal UB rules in C/C++, something that does not exist in IL.