blonk
July 27, 2022, 6:27am
1
Why does matches
disappear from the output in this godbolt ?
Does Rust/LLVM deduplicate functions?
Or does it treat this as some sort of trivial map that will always be inlined (in the case of -O
)?
If I stick a #[inline(never)]
onto matches
it will reappear (and is indeed identical to ifchain
).
H2CO3
July 27, 2022, 6:40am
2
LLVM does appear to have a MergeFunctions
pass.
2 Likes
CAD97
July 27, 2022, 7:07am
4
If you want to disable this behavior (e.g. on godbolt for showing generated asm), you can use -Cmerge-functions=disabled
. (At this point I habitually include it when I set up a godbolt experiment.)
4 Likes
system
Closed
October 25, 2022, 7:07am
5
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.