[PATCH] D98159: [RISCV] Add RISCVISD::BR_CC similar to RISCVISD::SELECT_CC.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 7 16:06:03 PST 2021


craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, frasercrmck.
Herald added subscribers: StephenFan, vkmr, evandro, 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, hiraditya.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

This allows me to introduce similar combines for branches as
we have recently added for SELECT_CC. Some of them are less
useful for standalone setccs and only help branch instructions.
By having a BR_CC node its easier to only affect branches.

I'm using CondCodeSDNode to make isel patterns easier to
write so we can refer to the codes by name. SELECT_CC uses a
constant instead.

I've normalizing the condition code just like SELECT_CC so
we need less patterns for the swapped conditions. I've also
folded the setlt X, -1 handling into the normalize to get rid
of that special case isel pattern.

computeKnownBitsForTargetNode support for SELECT_CC is added
to allow MaskedValueIsZero to work for cases where the true
and false values of the SELECT_CC are setccs and the
result of the SELECT_CC is used by a BR_CC. This was needed
to avoid regressions in some of the overflow tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98159

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.h
  llvm/lib/Target/RISCV/RISCVInstrInfo.td
  llvm/test/CodeGen/RISCV/xaluo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98159.328912.patch
Type: text/x-patch
Size: 13348 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210308/66524bcf/attachment.bin>


More information about the llvm-commits mailing list