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

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


anton-afanasyev marked 4 inline comments as done.
anton-afanasyev 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(
----------------
spatel wrote:
> lebedev.ri wrote:
> > 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`.
> I was also confused by the use of "commute" here. The file name says we're truncating shifts, so I'd just make these all "shl..." or "narrow_shl..." (assuming we'll add the other shift ops in follow-up patches).
Ok, renamed tests.


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