[all-commits] [llvm/llvm-project] 3ad8fb: [Reassociate] Teach ConvertShiftToMul to preserve ...

topperc via All-commits all-commits at lists.llvm.org
Thu Jun 4 14:51:54 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ad8fbd20592303445af55222e1d846b96d27126
      https://github.com/llvm/llvm-project/commit/3ad8fbd20592303445af55222e1d846b96d27126
  Author: Craig Topper <craig.topper at gmail.com>
  Date:   2020-06-04 (Thu, 04 Jun 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/Reassociate.cpp
    M llvm/test/Transforms/Reassociate/wrap-flags.ll

  Log Message:
  -----------
  [Reassociate] Teach ConvertShiftToMul to preserve nsw flag if the shift amount is not bitwidth - 1.

Multiply and shl have different signed overflow behavior in
some cases. But it looks like we should be ok as long as the
shift amount is less than bitwidth - 1.

Alive2: http://volta.cs.utah.edu:8080/z/MM4WZP

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




More information about the All-commits mailing list