[PATCH] D108201: [AggressiveInstCombine] Add logical shift right instr to `TruncInstCombine` DAG

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 04:15:39 PDT 2021


anton-afanasyev created this revision.
anton-afanasyev added reviewers: lebedev.ri, spatel, RKSimon.
Herald added a subscriber: hiraditya.
anton-afanasyev requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Add `lshr` instruction to the DAG post-dominated by `trunc`, allowing
TruncInstCombine to reduce bitwidth of expressions containing
these instructions.

We should be shifting by less than the target bitwidth.
Also it is sufficient to require that all truncated bits
of the value-to-be-shifted are zeros: https://alive2.llvm.org/ce/z/_LytbB

Part of https://reviews.llvm.org/D107766


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108201

Files:
  llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp
  llvm/test/Transforms/AggressiveInstCombine/pr50555.ll
  llvm/test/Transforms/AggressiveInstCombine/trunc_shifts.ll
  llvm/test/Transforms/PhaseOrdering/X86/pr50555.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108201.366858.patch
Type: text/x-patch
Size: 27248 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210817/bdb58e9e/attachment.bin>


More information about the llvm-commits mailing list