[llvm] [GlobalOpt] Handle operators separately when removing GV users (PR #84694)

Anshil Gandhi via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 22:25:07 PST 2024


gandhi56 wrote:

> Deleting stores where we can prove the stored value isn't a pointer to an allocation should be fine; it doesn't impact the controversial cases. (But the current version of the patch is more aggressive, maybe by accident.)

Assuming GV is a pointer root which is never read from, the store instruction can be removed even if it's value operand is a pointer.

I think the logic implemented to decide whether or not source value operands should be removed was a little messy. Hence the test from #64680 was failing.

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


More information about the llvm-commits mailing list