[PATCH] D107766: [AggressiveInstCombine] Add shift instructions to `TruncInstCombine` DAG

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 14 22:10:04 PDT 2021


anton-afanasyev added a comment.

In D107766#2945161 <https://reviews.llvm.org/D107766#2945161>, @lebedev.ri wrote:

> I think we want to do this in three steps.
> `lshr` is easy and obvious, but for `ashr` we want to count *sign* bits.
> Haven't really thought about `shl`

Do you mean splitting this to three separate patches?
`shl` is simpler than both right shifts since it has no bits moved from truncated part to the untruncated one.
The condition used for `shl` here is necessary and sufficient, whereas it is only sufficient for the right shifts.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107766



More information about the llvm-commits mailing list