[all-commits] [llvm/llvm-project] 6a2442: [AArch64] Increase AddedComplexity of BIC

Alexander Shaposhnikov via All-commits all-commits at lists.llvm.org
Tue Sep 6 13:31:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6a2442e9be2529ee00b0239330df068b91c92aab
      https://github.com/llvm/llvm-project/commit/6a2442e9be2529ee00b0239330df068b91c92aab
  Author: Alexander Shaposhnikov <ashaposhnikov at google.com>
  Date:   2022-09-06 (Tue, 06 Sep 2022)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrFormats.td
    M llvm/lib/Target/AArch64/AArch64InstrInfo.td
    M llvm/test/CodeGen/AArch64/addsub.ll
    M llvm/test/CodeGen/AArch64/dag-combine-setcc.ll
    M llvm/test/CodeGen/AArch64/select_const.ll

  Log Message:
  -----------
  [AArch64] Increase AddedComplexity of BIC

This diff adjusts AddedComplexity of BIC to bump its position
in the list of patterns to make LLVM pick it instead of MVN + AND.
MVN + AND requires 2 cycles, so does e.g. MOV + BIC, but the latter
outperforms the former if the instructions producing the operands of
BIC can be issued in parallel.

One may consider the following example:

ldur x15, [x0, #2] # 4 cycles
mvn x10, x15 # 1 cycle (depends on ldur)
and x9, x10, #0x8080808080808080

vs.

ldur x15, [x0, #2] # 4 cycles
mov x9, #0x8080808080808080 # 1 cycle (can be executed in parallel with ldur)
bic x9, x9, x15. # 1 cycle

Test plan: ninja check-all

Differential revision: https://reviews.llvm.org/D133345




More information about the All-commits mailing list