[GlobalISel] Extend CombinerHelper::matchConstantOp() to match constant splat vectors.
authorAmara Emerson <amara@apple.com>
Thu, 30 Sep 2021 07:20:56 +0000 (00:20 -0700)
committerAmara Emerson <amara@apple.com>
Thu, 30 Sep 2021 21:31:25 +0000 (14:31 -0700)
commitca8316b7048d2554e8a4bdd5af1c27af5418dfd3
treecd03f1346bbc50916cc5536adefe45fd46b754e0
parentfdcbb540fc5ffbf5faa03c2f10fa88ca2c38f845
[GlobalISel] Extend CombinerHelper::matchConstantOp() to match constant splat vectors.

This allows the "x op 0 -> x" fold to optimize vector constant RHSs.

Differential Revision: https://reviews.llvm.org/D110802
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AArch64/GlobalISel/combine-mul.mir
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-trivial-arith.mir