HomePhabricator

[RISCV] Implement convertSelectOfConstantsToMath

Authored by lenary on May 2 2020, 7:05 AM.

Description

[RISCV] Implement convertSelectOfConstantsToMath

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.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D79260

Details

Committed
lenaryMay 2 2020, 7:05 AM
Reviewer
luismarques
Differential Revision
D79260: [RISCV] Implement convertSelectOfConstantsToMath
Parents
rGbf552d29ee77: [RISCV][NFC] Tests for (select (const), (const))
Branches
Unknown
Tags
Unknown