[all-commits] [llvm/llvm-project] a9aa14: [InstCombine] add tests for shift-of-add with cons...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Tue Apr 19 12:21:51 PDT 2022


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

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

  Log Message:
  -----------
  [InstCombine] add tests for shift-of-add with constants; NFC


  Commit: 8a9c70fc01e6c900f060f3c23d96ee444be33a9a
      https://github.com/llvm/llvm-project/commit/8a9c70fc01e6c900f060f3c23d96ee444be33a9a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-04-19 (Tue, 19 Apr 2022)

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

  Log Message:
  -----------
  [InstCombine] C0 shift (X add nuw C) --> (C0 shift C) shift X

With 'nuw' we can convert the increment of the shift amount
into a pre-shift (constant fold) of the shifted constant:
https://alive2.llvm.org/ce/z/FkTyR2

Fixes issue #41976


Compare: https://github.com/llvm/llvm-project/compare/ab99a414ef95...8a9c70fc01e6


More information about the All-commits mailing list