[PATCH] D158852: [SDAG] Add computeKnownBits support for ISD::SPLAT_VECTOR_PARTS

Luke Lau via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 08:23:22 PDT 2023


luke created this revision.
luke added reviewers: reames, craig.topper, RKSimon.
Herald added subscribers: asb, sunshaoce, pmatos, foad, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: All.
luke requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, MaskRay.
Herald added a project: LLVM.

We can work out the known bits for a given lane by concatenating the known bits of each scalar operand.

In the description of ISD::SPLAT_VECTOR_PARTS in ISDOpcodes.h it says that the
total size of the scalar operands must cover the output element size, but I've
added a stricter assertion here that the total width of the scalar operands
must be exactly equal to the element size. It doesn't seem to trigger, and I'm
not sure if there any targets that use SPLAT_VECTOR_PARTS for anything other
than v4i32 -> v2i64 splats.

We also need to include it in isTargetCanonicalConstantNode, otherwise
returning the known bits introduces an infinite combine loop.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158852

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158852.553490.patch
Type: text/x-patch
Size: 12031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230825/f6bc530a/attachment.bin>


More information about the llvm-commits mailing list