[all-commits] [llvm/llvm-project] 6357cc: [InstCombine] reassociate min/max intrinsics with ...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Tue Feb 15 05:31:37 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6357ccf57fd5d5c60ffddd611a3f5510b52c2b9c
      https://github.com/llvm/llvm-project/commit/6357ccf57fd5d5c60ffddd611a3f5510b52c2b9c
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-02-15 (Tue, 15 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/minmax-intrinsics.ll

  Log Message:
  -----------
  [InstCombine] reassociate min/max intrinsics with constant operands

Integer min/max operations are associative:
  max (max X, C0), C1 --> max X, (max C0, C1) --> max X, NewC

https://alive2.llvm.org/ce/z/wW5HVM

This would avoid a regression when we canonicalize to min/max intrinsics
(see D98152 ).

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




More information about the All-commits mailing list