[all-commits] [llvm/llvm-project] 782d01: [InstCombine] add tests for C << (X - C1); NFC

Sanjay Patel via All-commits all-commits at lists.llvm.org
Thu Apr 21 08:39:54 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 782d0105ba245aaded586931a997618a25f80690
      https://github.com/llvm/llvm-project/commit/782d0105ba245aaded586931a997618a25f80690
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-04-21 (Thu, 21 Apr 2022)

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

  Log Message:
  -----------
  [InstCombine] add tests for C << (X - C1); NFC


  Commit: 5819f4a422865fc9a8ea4dc772769e14010ff6a7
      https://github.com/llvm/llvm-project/commit/5819f4a422865fc9a8ea4dc772769e14010ff6a7
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-04-21 (Thu, 21 Apr 2022)

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

  Log Message:
  -----------
  [InstCombine] C0 <<{nsw, nuw} (X - C1) --> (C0 >> C1) << X

This is similar to an existing pre-shift-of-constant fold:
8a9c70fc01e6
...but in this case, we need no-wrap on the shl and a negative
offset:
https://alive2.llvm.org/ce/z/_RVz99

Fixes #54890


Compare: https://github.com/llvm/llvm-project/compare/f80e369f61eb...5819f4a42286


More information about the All-commits mailing list