[llvm] [BasicAA] Guess reasonable contexts for separate storage hints (PR #76770)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 01:32:36 PST 2024


https://github.com/nikic commented:

Can you please first submit a PR to enable the separate storage functionality by default? It seems to be essentially free right now, and we may have trouble enabling it in the future if it is made more expensive first.

This patch doesn't seem to add much overhead on average, but seems to be quite expensive in some cases. For example there is an 8% compile-time increase for Interp/Disasm.cpp (http://llvm-compile-time-tracker.com/compare_clang.php?from=662453637d86179c0a7c55532172f735f9c14c6d&to=cc866a92542e99de74d4a946467bb8a73e227757&stat=instructions%3Au&sortBy=interestingness)

I'm wondering whether the motivating case could be solved by using (must-exec) separate_storage assumptions in the entry block to infer `noalias` on function parameters. Assuming that is a valid transform, we would benefit from other noalias-based optimizations as well. (We could probably even drop the assume in that case, as noalias should enable strictly more optimizations, and gets preserved during inlining using scoped AA metadata.)

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


More information about the llvm-commits mailing list