[PATCH] D61228: [PowerPC] Set the innermost hot loop(from PGO) to align 32 bytes

Zhang Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 27 09:44:59 PDT 2019


ZhangKang created this revision.
ZhangKang added reviewers: nemanjai, echristo, steven.zhang, hfinkel, hiraditya, jsji, efriedma.
Herald added a project: LLVM.
ZhangKang edited the summary of this revision.

If the nested loop has profile data and is an innermost loop, prefer to a 32-byte alignment, so that we can decrease cache misses and branch-prediction misses.

The old code will only align hot loop to 32 bytes when the LoopSize larger than 16 bytes and smaller than 32 bytes, this patch will align the innermost hot loop(from PGO) to 32 bytes not only for the hot loop whose size is 16~32 bytes.

For some special cases, the performance can improve more than 30% after adding the patch for ppc.

This patch have a dependency on the patch D61227 <https://reviews.llvm.org/D61227>: [NFC]][PowerPC] Use -check-prefixes to simplify the check in code-align.ll.


https://reviews.llvm.org/D61228

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/test/CodeGen/PowerPC/code-align.ll
  llvm/test/CodeGen/PowerPC/loop-align-pgo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61228.196975.patch
Type: text/x-patch
Size: 15789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190427/dc0388c5/attachment.bin>


More information about the llvm-commits mailing list