[all-commits] [llvm/llvm-project] baae81: Add tests for D121320

Matthias Braun via All-commits all-commits at lists.llvm.org
Tue Mar 15 14:18:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: baae814377bca9c1090f58d30036ececc99b62d7
      https://github.com/llvm/llvm-project/commit/baae814377bca9c1090f58d30036ececc99b62d7
  Author: Matthias Braun <matze at braunis.de>
  Date:   2022-03-15 (Tue, 15 Mar 2022)

  Changed paths:
    M llvm/test/CodeGen/X86/cmp.ll

  Log Message:
  -----------
  Add tests for D121320

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


  Commit: 84ef62126a328add20798e7fa5c130d5f315c740
      https://github.com/llvm/llvm-project/commit/84ef62126a328add20798e7fa5c130d5f315c740
  Author: Matthias Braun <matze at braunis.de>
  Date:   2022-03-15 (Tue, 15 Mar 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
    M llvm/test/CodeGen/X86/cmp.ll
    M llvm/test/CodeGen/X86/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll
    M llvm/test/CodeGen/X86/hoist-and-by-const-from-shl-in-eqcmp-zero.ll

  Log Message:
  -----------
  X86ISelDAGToDAG: Transform TEST + MOV64ri to SHR + TEST

Optimize a pattern where a sequence of 8/16 or 32 bits is tested for
zero: LLVM normalizes this towards and `AND` with mask which is usually
good, but does not work well on X86 when the mask does not fit into a
64bit register. This DagToDAG peephole transforms sequences like:

```
movabsq $562941363486720, %rax # imm = 0x1FFFE00000000
testq %rax, %rdi
```

to

```
shrq $33, %rdi
testw %di, %di
```

The result has a shorter encoding and saves a register if the tested
value isn't used otherwise.

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


Compare: https://github.com/llvm/llvm-project/compare/e39095a32e88...84ef62126a32


More information about the All-commits mailing list