[llvm] [Matrix] Adjust lifetime.ends during multiply fusion. (PR #84914)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 13:05:02 PDT 2024


fhahn wrote:

> Is the potential lifetime extension something you expect rarely? We should discuss this more on sample IR. I'm worried that we don't have good grasp on the trade-off. Another possible short term solution is to suppress fusion in this scenario (but again, I have no sense how frequent the liveends would interfere with fusion).

How often the lifetimes cause issues manifest depends on the use cases, but when used together with C++ templates, temporary objects could be quite common. The impact of longer lifetimes of a few objects could in some cases increase things like stack size, but in practice the benefit from fusion (when we deem profitable)should by far outweigh any gains from slightly shorter lifetimes. Without fusion, the generated code also likely has higher register pressure, as we need to load all data up-front.

Instead of dropping the lifetimes in some cases we could also use something like the first block that post-dominates both the block of the lifetime.end and the store, but requiring post-dominator tree would further increase compile-time

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


More information about the llvm-commits mailing list