[all-commits] [llvm/llvm-project] fcd51d: [InstCombine] Factorise Add and Min/Max using dist...

Jorge Botto via All-commits all-commits at lists.llvm.org
Sat Nov 2 09:08:33 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fcd51dee42792bf264d26ab4978eb0a3a3001728
      https://github.com/llvm/llvm-project/commit/fcd51dee42792bf264d26ab4978eb0a3a3001728
  Author: Jorge Botto <Jorge.botto.16 at ucl.ac.uk>
  Date:   2024-11-02 (Sat, 02 Nov 2024)

  Changed paths:
    M llvm/include/llvm/IR/Operator.h
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    A llvm/test/Transforms/InstCombine/intrinsic-distributive.ll

  Log Message:
  -----------
  [InstCombine] Factorise Add and Min/Max using distributivity (#101717)

This PR fixes part of https://github.com/llvm/llvm-project/issues/92433.

It specifically adds the 4 cases mentioned in
https://github.com/llvm/llvm-project/issues/92433#issuecomment-2117064459.

I've added 8 positive tests, 4 of which are mentioned in the comment
above and 4 which are their commutative equivalents. Alive proof:
https://alive2.llvm.org/ce/z/z6eFTb
I've also added 8 negative tests, because we want to make sure we do not
optimise if the relevant flags are not relevant because the optimisation
wouldn't be sound. Alive proof that the optimisation is invalid:
https://alive2.llvm.org/ce/z/NvNjTD
I did have to make the integer types `i4` to make Alive not timeout and
to fit them all on one page.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list