[all-commits] [llvm/llvm-project] 5fd883: [InstCombine] add tests for X*X == 0; NFC

Sanjay Patel via All-commits all-commits at lists.llvm.org
Thu Sep 15 09:30:28 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5fd883377c046d4b606f0cffa3d4f052ba75acf6
      https://github.com/llvm/llvm-project/commit/5fd883377c046d4b606f0cffa3d4f052ba75acf6
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-09-15 (Thu, 15 Sep 2022)

  Changed paths:
    M llvm/test/Transforms/InstCombine/icmp-mul.ll

  Log Message:
  -----------
  [InstCombine] add tests for X*X == 0; NFC


  Commit: 02a27b38909edc46c41732f79a837c95c9992d5a
      https://github.com/llvm/llvm-project/commit/02a27b38909edc46c41732f79a837c95c9992d5a
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-09-15 (Thu, 15 Sep 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp-mul.ll

  Log Message:
  -----------
  [InstCombine] fold X*X == 0 --> X == 0

This is safe when the mul does not overflow:
https://alive2.llvm.org/ce/z/LedVVP

This could be extended to handle non-zero compare constants
and non-squared multiplies.


Compare: https://github.com/llvm/llvm-project/compare/94620e4fc340...02a27b38909e


More information about the All-commits mailing list