[PATCH] D110239: [AArch64] Enable type promotion for AArch64

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 06:06:31 PDT 2021


dmgreen created this revision.
dmgreen added reviewers: avieira, SjoerdMeijer, aemerson, samparker, t.p.northover.
Herald added subscribers: hiraditya, kristof.beyls.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This enables the type promotion pass for AArch64, which acts as a CodeGenPrepare pass to promote illegal integers to legal ones, especially useful for removing extends that would otherwise require cross-basic-block analysis.

(I have enabled this generally, for both ISel and GlobalISel. In some quick experiments it appeared to help GlobalISel remove extra extends in places too, but that might just be missing optimizations that are better left for later. I can disable it if that sounds better).

In my experiments, this can improvement performance in some cases, and codesize was a small improvement. SPEC was a very small improvement, within the noise. Some of the test cases show extends being moved out of loops, often when the extend would be part of a cmp operand, but that should reduce the latency of the instruction in the loop on many cpus. The signed-truncation-check tests are increasing as they are no longer matching specific DAG combines. I will work on improving those.

We also hope to add some additional improvements to the pass in the near future, to capture more cases of promoting extends through phis that have come up in a few places lately.


https://reviews.llvm.org/D110239

Files:
  llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic.ll
  llvm/test/CodeGen/AArch64/O3-pipeline.ll
  llvm/test/CodeGen/AArch64/and-mask-removal.ll
  llvm/test/CodeGen/AArch64/atomic-ops-lse.ll
  llvm/test/CodeGen/AArch64/atomic-ops.ll
  llvm/test/CodeGen/AArch64/cmpxchg-idioms.ll
  llvm/test/CodeGen/AArch64/lack-of-signed-truncation-check.ll
  llvm/test/CodeGen/AArch64/signed-truncation-check.ll
  llvm/test/CodeGen/AArch64/typepromotion-overflow.ll
  llvm/test/CodeGen/AArch64/typepromotion-phisret.ll
  llvm/test/CodeGen/AArch64/typepromotion-signed.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110239.374188.patch
Type: text/x-patch
Size: 49893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210922/056ac393/attachment.bin>


More information about the llvm-commits mailing list