[all-commits] [llvm/llvm-project] 8a645f: [AArch64] Enable type promotion for AArch64

David Green via All-commits all-commits at lists.llvm.org
Wed Sep 29 07:13:26 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a645fc44b545acdea9fb3daf8642ab4b9e219a0
      https://github.com/llvm/llvm-project/commit/8a645fc44b545acdea9fb3daf8642ab4b9e219a0
  Author: David Green <david.green at arm.com>
  Date:   2021-09-29 (Wed, 29 Sep 2021)

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

  Log Message:
  -----------
  [AArch64] Enable type promotion for AArch64

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. We can disable it again if required.

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.

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.

Differential Revision: https://reviews.llvm.org/D110239




More information about the All-commits mailing list