Problem
Immutable references can't be mutated so we should be able to consider them as valid targets for mem2reg in more cases.
As long as we only consider immutable references allocated in the current function that are known not to be aliased (participate in only simple load/store instructions following the existing rules for mutable references), we should know these immutable references are not aliased and should be able to assume a call cannot change their value for example.
Happy Case
Expand the optimization opportunities for immutable references.
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
Problem
Immutable references can't be mutated so we should be able to consider them as valid targets for mem2reg in more cases.
As long as we only consider immutable references allocated in the current function that are known not to be aliased (participate in only simple load/store instructions following the existing rules for mutable references), we should know these immutable references are not aliased and should be able to assume a call cannot change their value for example.
Happy Case
Expand the optimization opportunities for immutable references.
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response