[llvm] [GVN][NewGVN][Local] Handle attributes for function calls after CSE (PR #114011)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 05:03:20 PDT 2024


nikic wrote:

> > You can't really restrict replacements after the fact in GVN, you need to do so during value numbering.
> 
> I've considered this approach before. But it is too heavy to add `Attributes` to `GVNPass::Expression`.

I don't have any particularly good ideas on how to fix this properly. Given that this is a CSE transform, I think we could get away with only dropping the poison-generating attributes, and otherwise keeping the attributes of the first call, to avoid the problematic !canBeReplacedBy case.


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


More information about the llvm-commits mailing list