[all-commits] [llvm/llvm-project] 31971c: [InstCombine] Try to narrow expr if trunc cannot b...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Jul 3 12:30:54 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 31971ca1c6f42aa9a5e162d63528b9709448f8d9
      https://github.com/llvm/llvm-project/commit/31971ca1c6f42aa9a5e162d63528b9709448f8d9
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-07-03 (Fri, 03 Jul 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/test/Transforms/InstCombine/trunc-binop-ext.ll

  Log Message:
  -----------
  [InstCombine] Try to narrow expr if trunc cannot be removed.

Narrowing an input expression of a truncate to a type larger than the
result of the truncate won't allow removing the truncate, but it may
enable further optimizations, e.g. allowing for larger vectorization
factors.

For now this is intentionally limited to integer types only, to avoid
producing new vector ops that might not be suitable for the target.

If we know that the only user is a trunc, we can also be allow more
cases, e.g. also shortening expressions with some additional shifts.

I would appreciate feedback on the best place to do such a narrowing.

This fixes PR43580.

Reviewers: spatel, RKSimon, lebedev.ri, xbolva00

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D82973




More information about the All-commits mailing list