[GlobalOpt] Extend logic in SRA heuristic to skip stores of initializer.
authorFlorian Hahn <flo@fhahn.com>
Tue, 7 Mar 2023 10:08:06 +0000 (11:08 +0100)
committerFlorian Hahn <flo@fhahn.com>
Tue, 7 Mar 2023 10:08:06 +0000 (11:08 +0100)
commit226778e1b2d185e8f4a817b24ee195e7e0f3ecc3
treefa2d1389ce75e0d648d7a6f050061b733dc0d345
parent764e39048c3664dd92dc5d4a65a5eb9e2beb7e49
[GlobalOpt] Extend logic in SRA heuristic to skip stores of initializer.

If all stores only store the initializer value of a global, consider it
as not stored in the heuristic. GlobalOpt will remove such stores later
on.

Depends on D129857.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D144476
llvm/lib/Transforms/IPO/GlobalOpt.cpp
llvm/test/Transforms/GlobalOpt/sra-many-stores-initializers.ll