[PATCH] D123256: [TargetLowering][RISCV] Allow truncation if the arguments of a setcc are splats.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 14:27:15 PDT 2022


craig.topper created this revision.
craig.topper added reviewers: spatel, frasercrmck.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

We're just trying to canonicalize here and won't be using the constant
value returned.

The attached test changes are because we were previously commuting
a seteq X, (splat_vector 0) because we also have (sub 0, X). The
0 is larger than the element type so we don't detect it as a splat
without the AllowTruncation flag. By preventing the commute we are
able to match it to the vmseq.vx instruction during isel. We only
look for constants on the RHS in isel.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123256

Files:
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/cttz-sdnode.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123256.421014.patch
Type: text/x-patch
Size: 24332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220406/46224720/attachment.bin>


More information about the llvm-commits mailing list