[llvm] [MachinePipeliner] Improve loop carried dependence analysis (PR #94185)

Yuta Mukai via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 07:03:14 PDT 2024


ytmukai wrote:

Hi @quic-santdas, thanks for your comment.

> why this should impact some earlier loops which were being pipelined?

Currently, the incremental value per iteration of the address of a memory access is recognized only by the instruction that defines the base register. The code is as follows. 

https://github.com/llvm/llvm-project/blob/30e5d7190d39fe4f0982435d4fb5043e64acdc9f/llvm/lib/CodeGen/MachinePipeliner.cpp#L2583-L2599

This method does not always give the correct value. Therefore, in order to obtain the correct value, this patch fixes it to recognize only the patterns that make up a cycle, as shown below.

https://github.com/llvm/llvm-project/blob/dfc329e9e569e5a72b901017057f09af246c93ed/llvm/lib/CodeGen/MachinePipeliner.cpp#L2593-L2600

Because of the simplicity of the analysis, I have a concern that there may not be sufficient patterns to be supported. (Failure to analyze incremental values does not necessarily disable the pipeline, but it could result in poor scheduling.)

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


More information about the llvm-commits mailing list