This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Match (select C, -1, X)->(or -C, X) during lowerSelect
ClosedPublic

Authored by craig.topper on Oct 12 2022, 5:04 PM.

Details

Summary

Same with (select C, X, -1), (select C, 0, X), and (select C, X, 0).

There's a DAGCombine after we turn the select into select_cc, but
that may introduce a setcc that didn't previously exist. We could
add more DAGCombines to remove the extra setcc, but this seemed lower
effort.

Diff Detail

Event Timeline

craig.topper created this revision.Oct 12 2022, 5:04 PM
craig.topper requested review of this revision.Oct 12 2022, 5:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 5:04 PM

LGTM.

I'm going to glance at the missing DAGCombine and see if the other approach works cleanly; if it does, I may propose removing these.

reames accepted this revision.Oct 13 2022, 7:23 AM
This revision is now accepted and ready to land.Oct 13 2022, 7:23 AM
This revision was landed with ongoing or failed builds.Oct 13 2022, 9:07 AM
This revision was automatically updated to reflect the committed changes.