[PATCH] D124374: [RISCV][TargetLowering] Special case overflow expansion for (uaddo X, C).

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 07:54:49 PDT 2022


reames added a comment.

It's not clear to my why preferring a comparison involving RHS over one involving LHS is generally profitable just because RHS happens to be a constant.  Correct me if I'm wrong, but nothing has ensured that RHS is a small constant has it?  Meaning, we may have to materialize it into a register and pay the same cost as the LHS based compare?  By using RHS, we loose the ability to do CSE of repeated uadds.

I think you want some predicate to check that the comparison can fold into an immediate form at the minimum.

I'm new to this area, so I may simply be missing something here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124374/new/

https://reviews.llvm.org/D124374



More information about the llvm-commits mailing list