[all-commits] [llvm/llvm-project] decc19: MachineCSE.cpp - use auto const& iterators in for-...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Sat Sep 26 06:32:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: decc1944f38f4205bf53829bf91e3c98ea6fc7ac
      https://github.com/llvm/llvm-project/commit/decc1944f38f4205bf53829bf91e3c98ea6fc7ac
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-09-26 (Sat, 26 Sep 2020)

  Changed paths:
    M llvm/lib/CodeGen/MachineCSE.cpp

  Log Message:
  -----------
  MachineCSE.cpp - use auto const& iterators in for-range loops to avoid copies. NFCI.


  Commit: a61272a900296573902dfce99274fd335239a4d3
      https://github.com/llvm/llvm-project/commit/a61272a900296573902dfce99274fd335239a4d3
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-09-26 (Sat, 26 Sep 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/AArch64/srem-seteq-vec-nonsplat.ll
    M llvm/test/CodeGen/X86/srem-seteq-vec-nonsplat.ll
    M llvm/test/CodeGen/X86/vector-idiv-sdiv-128.ll
    M llvm/test/CodeGen/X86/vector-idiv-sdiv-256.ll
    M llvm/test/CodeGen/X86/vector-idiv-sdiv-512.ll
    M llvm/test/CodeGen/X86/vector-mul.ll
    M llvm/test/CodeGen/X86/vector-trunc-math.ll

  Log Message:
  -----------
  [DAG] Fold vector mul(x,0)/mul(x,1) to a clearing mask

If we're multiplying all elements of a vector by '0' or '1' then we can more efficiently perform this as a clearing mask (that is likely to further simplify to a shuffle blend).

This was noticed when reviewing D87502 but seems to help idiv/irem by constant cases even more as '0'/'1' values are often used for 'passthrough' cases.

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


Compare: https://github.com/llvm/llvm-project/compare/f91b9c0f9858...a61272a90029


More information about the All-commits mailing list