[PATCH] D154857: [RISCV] In RISCVRVVInitUndef, optimize case where entire register is undef

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 09:05:01 PDT 2023


reames created this revision.
reames added reviewers: craig.topper, luke, asb, kito-cheng, frasercrmck.
Herald added subscribers: jobnoorman, VincentWu, vkmr, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, bollu, simoncook, johnrusso, rbar, hiraditya, arichardson, mcrosier.
Herald added a project: All.
reames requested review of this revision.
Herald added subscribers: wangpc, eopXD, MaskRay.
Herald added a project: LLVM.

The sub-register logic is correct for an entirely undef register, but needlessly complicated.  We can do a single undef pseudo instead.

Note that the undef being adjusted in the test is the pass thru, which doesn't actually require the non-overlap constraint.  However, the sub-register logic doesn't include the special case for passthru operands that the implicit_def logic does.  However, the logic in implicit_def logic also looks suspect, so this isn't as simple as just copying it across.  We really should merge the two code paths, and I'm looking into that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154857

Files:
  llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp
  llvm/test/CodeGen/RISCV/rvv/subregister-undef-early-clobber.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154857.538675.patch
Type: text/x-patch
Size: 43959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230710/f7b4c6ff/attachment.bin>


More information about the llvm-commits mailing list