This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Implement convertSelectOfConstantsToMath
ClosedPublic

Authored by lenary on May 1 2020, 1:27 PM.

Details

Summary

The current lowering of SELECT on RISC-V uses a branch instruction to load a
register with one or other value. This is inefficient, especially in the case of
small constants that can be computed easily.

By implementing the TargetLowering::convertSelectOfConstantsToMath hook, some of
the simpler cases are covered that let us avoid introducing a branch in these
cases.

Diff Detail

Event Timeline

lenary created this revision.May 1 2020, 1:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2020, 1:27 PM
This revision is now accepted and ready to land.May 1 2020, 1:39 PM
This revision was automatically updated to reflect the committed changes.