[PATCH] D155481: [RISCV] A test for conditional binary ops.

Mikhail Gudim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 09:04:47 PDT 2023


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

Consider the following pattern:

  %binop_ = binop %x, %y
  %select_ = select %c, %binop_, %x

If there is an identity `%identity` operand for `binop`, it is possible to transform
the above code to:

  %opearand = select %c, %y, %identity
  %result = binop %x, %operand

This transformation is profitable when `%identity` is all zeroes or
ones.

This patch commits a test for such patterns.


https://reviews.llvm.org/D155481

Files:
  llvm/test/CodeGen/RISCV/condbinops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155481.541080.patch
Type: text/x-patch
Size: 29519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230717/76bf3112/attachment.bin>


More information about the llvm-commits mailing list