[PATCH] D94546: [RISCV] Optimize select_cc after fp compare expansion
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 12 12:44:11 PST 2021
craig.topper created this revision.
craig.topper added reviewers: lenary, luismarques, mundaym, asb, jrtc27.
Herald added subscribers: frasercrmck, NickHung, evandro, apazos, sameer.abuasal, pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, 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.
Some FP compares expand to a sequence ending with (xor X, 1). If
the consumer select_cc we can likely get rid of this xor by fixing
up the select_cc condition.
This patch combines (select_cc (xor X, 1), 0, setne, trueV, falseV) -
(select_cc X, 0, seteq, trueV, falseV) if we can prove X is 0/1.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D94546
Files:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/double-select-fcmp.ll
llvm/test/CodeGen/RISCV/float-select-fcmp.ll
llvm/test/CodeGen/RISCV/half-select-fcmp.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94546.316203.patch
Type: text/x-patch
Size: 16375 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210112/aed8cf65/attachment.bin>
More information about the llvm-commits
mailing list