[all-commits] [llvm/llvm-project] 0cf48a: [InstCombine] visitTrunc - trunc (*shr (trunc A), ...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Sep 29 10:29:48 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0cf48a70651c722a5dabf0ca8ca246b110d7c2ab
      https://github.com/llvm/llvm-project/commit/0cf48a70651c722a5dabf0ca8ca246b110d7c2ab
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-09-29 (Tue, 29 Sep 2020)

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

  Log Message:
  -----------
  [InstCombine] visitTrunc - trunc (*shr (trunc A), C) --> trunc(*shr A, C)

Attempt to fold trunc (*shr (trunc A), C) --> trunc(*shr A, C) iff the shift amount if small enough that all zero/sign bits created by the shift are removed by the last trunc.

Helps fix the regressions encountered in D88316.

I've tweaked a couple of shift values as suggested by @lebedev.ri to ensure we have coverage of shift values close (above/below) to the max limit.

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




More information about the All-commits mailing list