[PATCH] D96622: [DAG] PromoteIntRes_ADDSUBSHLSAT - use promoted ISD::USUBSAT directly

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 14:41:21 PST 2021


RKSimon added a comment.

>> I think something similar should be possible for ISD::UADDSAT as well, which I'll look at later.
>
> This works for usubsat because the lower bound stays the same (0), while for uaddsat it would change (from 2^bw-1 to 2^new_bw-1). So not sure a similar pattern is possible for that case.

What I noticed was that removing UADDSAT from the 'shift' codegen (and always using the default expansion further down) seemed to generate better code - I'll take another look.

> We could also just dispatch USUBSAT to PromoteIntRes_ZExtIntBinOp in the main switch.

Thanks - I'd forgotten about that!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96622



More information about the llvm-commits mailing list