This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add seto pattern expansion
ClosedPublic

Authored by luismarques on Mar 22 2019, 8:51 AM.

Details

Summary

Adds a seto pattern expansion. Without it the lowerings of fcmp one and
fcmp ord would be inefficient due to an unoptimized double negation.

Diff Detail

Event Timeline

luismarques created this revision.Mar 22 2019, 8:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2019, 8:51 AM
rogfer01 added inline comments.Mar 25 2019, 6:43 AM
lib/Target/RISCV/RISCVInstrInfoD.td
278 ↗(On Diff #191887)

This looks to me as logically the same as seto.

So we can make it legal (for F and D) in RISCVISelLowering.cpp (now it is marked as Expand) and use this pattern as its expansion.

lib/Target/RISCV/RISCVInstrInfoF.td
332 ↗(On Diff #191887)

Ditto.

luismarques retitled this revision from [RISCV] Optimize selection of fcmp one and fcmp ord to [RISCV] Add seto pattern expansion.
luismarques edited the summary of this revision. (Show Details)

Changed the patch to add a pattern expansion for seto, as nicely spotted and suggested by @rogfer01

asb accepted this revision.Mar 31 2019, 7:24 PM

LGTM, thanks!

This revision is now accepted and ready to land.Mar 31 2019, 7:24 PM
This revision was automatically updated to reflect the committed changes.