[DAGCombiner] Move or/xor/and opcode check in ReduceLoadOpStoreWidth before hasOneUse...
authorCraig Topper <craig.topper@sifive.com>
Fri, 15 Apr 2022 23:33:12 +0000 (16:33 -0700)
committerCraig Topper <craig.topper@sifive.com>
Fri, 15 Apr 2022 23:38:27 +0000 (16:38 -0700)
commita7b9d75e7a4e4d9555f54753c70e66821dd447a9
treeabb7cee87c5051cf4907c3c94eab74bc7164ba5e
parent81143b69dd832da189b1c875fd8a94b288c486c6
[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.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp