[all-commits] [llvm/llvm-project] 0fefb5: [InstCombine] add tests for sub with rem operand; NFC

Sanjay Patel via All-commits all-commits at lists.llvm.org
Fri May 13 07:15:41 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0fefb56da7fd04c36675eebc2f9d1d851dca725b
      https://github.com/llvm/llvm-project/commit/0fefb56da7fd04c36675eebc2f9d1d851dca725b
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-05-13 (Fri, 13 May 2022)

  Changed paths:
    M llvm/test/Transforms/InstCombine/sub.ll

  Log Message:
  -----------
  [InstCombine] add tests for sub with rem operand; NFC


  Commit: ee6754c277a67cbc51eb6b3eb704a0ff751f9ddd
      https://github.com/llvm/llvm-project/commit/ee6754c277a67cbc51eb6b3eb704a0ff751f9ddd
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-05-13 (Fri, 13 May 2022)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstCombine/add4.ll
    M llvm/test/Transforms/InstCombine/exact.ll
    M llvm/test/Transforms/InstCombine/rem.ll
    M llvm/test/Transforms/InstCombine/sub.ll

  Log Message:
  -----------
  [ValueTracking] recognize sub X, (X % Y) as not overflowing

I fixed some poison-safety violations on related patterns in InstCombine
and noticed that we missed adding nsw/nuw on them, so this adds clauses
to the underlying analysis for that.

We need the undef input restriction to make this safe according to Alive2:
https://alive2.llvm.org/ce/z/48g9K8

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


Compare: https://github.com/llvm/llvm-project/compare/e0fcdf5496ca...ee6754c277a6


More information about the All-commits mailing list