[all-commits] [llvm/llvm-project] f8a574: [InstCombine] C0 >> (X - C1) --> (C0 << C1) >> X

Nicolas Abram via All-commits all-commits at lists.llvm.org
Wed Apr 27 11:21:19 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f8a574bf4de48547a8d4f7f0b9c884e9e5be8d32
      https://github.com/llvm/llvm-project/commit/f8a574bf4de48547a8d4f7f0b9c884e9e5be8d32
  Author: Nicolas Abram Lujan <abramlujan at gmail.com>
  Date:   2022-04-27 (Wed, 27 Apr 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
    M llvm/test/Transforms/InstCombine/shift-add.ll

  Log Message:
  -----------
  [InstCombine] C0 >> (X - C1) --> (C0 << C1) >> X

With the right pre-conditions, we can fold the offset
into the shifted constant:
https://alive2.llvm.org/ce/z/drMRBU
https://alive2.llvm.org/ce/z/cUQv-_

Fixes #55016

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




More information about the All-commits mailing list