HomePhabricator

[RISCV] Improve legalization of i32 UADDO/USUBO on RV64.

Authored by craig.topper on Mar 15 2021, 9:20 AM.

Description

[RISCV] Improve legalization of i32 UADDO/USUBO on RV64.

The default legalization uses zero extends that require pair of shifts
on RISCV. Instead we can take advantage of the fact that unsigned
compares work equally well on sign extended inputs. This allows
us to use addw/subw and sext.w.

Reviewed By: luismarques

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