Skip to content
Commit 1fb87ace authored by LiaoChunyu's avatar LiaoChunyu
Browse files

[RISCV] Optimize x > 1 ? x : 1 -> x > 0 ? x : 1

if x == 1,
  x > 1 ? x : 1  return x, which is also 1.
  x > 0 ? x : 1  return 1.

Reduce the number of load 1 instructions.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D132211
parent e6a08005
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment