[PATCH] D108091: [AggressiveInstCombine] Add shift left instruction to `TruncInstCombine` DAG

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 16 00:54:59 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/test/Transforms/AggressiveInstCombine/trunc_shifts.ll:4
 
 define i16 @shl_1_commute(i8 %x) {
 ; CHECK-LABEL: @shl_1_commute(
----------------
anton-afanasyev wrote:
> lebedev.ri wrote:
> > Pedantic nitpick: commute means `mul %x, %y   <=>   mul %y, %x`
> > Here you want to use `negative_test` in place of `not_commute`, and drop `commute`.
> "Commute" here means that `trunc` and `shl` commutes as operators: `trunc ∘ shl = shl ∘ trunc`, i.e. `trunc(shl(*, *)) = shl(trunc(*), trunc(*)))`. But I'm to change it, thanks.
I have literally never seen such usage in all of LLVM. But that may be sample size issue.
Usually it's marked as `fold`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108091



More information about the llvm-commits mailing list