[llvm] [LLVM] Add HasFakeUses to MachineFunction (PR #110097)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 06:43:37 PDT 2024


jayfoad wrote:

> > Is it just a performance thing, so that you have a fast way to find out whether the function contains any fake uses, or does it carry more semantic information than that?
> 
> The former - there's an additional pass that will iterate over every Instruction to find and remove loads under certain conditions which are only relevant to functions with fake uses in them, which will only appear in specific developer builds (using the `-fextend-lifetimes` flag). Tracking that boolean, which can be trivially determined as part of parsing or ISel, seems like it would be preferable to either recalculating it later or adding it as a new function attribute.

OK. I'm ambivalent about this. On one hand it seems like there's a lot of boilerplate just for adding this flag (serializing it and deserializing it and checking for it consistency) which is all just useless complexity. On the other hand, if it saves some passes from scanning the IR of the function, that's 0.1% compile time each time.

https://github.com/llvm/llvm-project/pull/110097


More information about the llvm-commits mailing list