[all-commits] [llvm/llvm-project] a7b9d7: [DAGCombiner] Move or/xor/and opcode check in Redu...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Apr 15 16:42:36 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a7b9d75e7a4e4d9555f54753c70e66821dd447a9
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-04-15 (Fri, 15 Apr 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

  Log Message:
  [DAGCombiner] Move or/xor/and opcode check in ReduceLoadOpStoreWidth before hasOneUse check.

hasOneUse is not cheap on nodes with chain results that might have
many uses. By checking the opcode first, we can avoid a costly walk
of the use list on nodes we aren't interested in.

Found by investigating calls to hasNUsesOfValue from the example
provided in D123857.

More information about the All-commits mailing list