Hi Jakub,
On 3/5/26 2:08 PM, Jakub Jelinek wrote:
Thanks for working on this. I'll defer the IPA review to Martin/Honza,
my knowledge of the IPA passes is limited, I'll just note that this is
highly desirable (maybe not just IPA-SRA for it but other IPA optimizations,
perhaps IPA-CP, IPA-VRP etc.)
I actually managed to get ipa-cp working, but I had trouble finding
testcases where the propagation made an impact, i.e. where it enabled an
optimization that couldn't be done before. I want to implement it, but
I'd save it for subsequent patches. With this committed, adding
additional passes shouldn't be an issue.
and just want to note that due to inlining
and unrolling and other code copying one can end up with multiple
.ASSUME ifn calls for the same *.assume_fn, and if that happens one needs
to be careful (similarly to other IPA optimizations with static function
and multiple callers in the TU) to optimize it with all callers (in this
case "callers") in mind and adjust them all, rather than just assuming
there must be exactly one. But if all corresponding .ASSUME calls for
a particular *.assume_fn can be changed, changing arguments the normal
IPA way is fine and desirable, except normal calls look like
foo (arg1, arg2, arg3) but in this case it is
.ASSUME (&foo.assume_fn, arg1, arg2, arg3).
If the function gets copied, the corresponding edge should be copied as
well. I'll prepare testcases for it, but I don't think that's going to
be an issue :)
Jakub
Best regards,
Josef