[all-commits] [llvm/llvm-project] 096527: [EarlyCSE] fold commutable intrinsics

RotateRight via All-commits all-commits at lists.llvm.org
Sat Aug 29 09:11:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 096527214033772e8d80fdefd8a018b9bfa20021
      https://github.com/llvm/llvm-project/commit/096527214033772e8d80fdefd8a018b9bfa20021
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-08-29 (Sat, 29 Aug 2020)

  Changed paths:
    M llvm/include/llvm/IR/IntrinsicInst.h
    M llvm/lib/Transforms/Scalar/EarlyCSE.cpp
    M llvm/test/Transforms/EarlyCSE/commute.ll

  Log Message:
  -----------
  [EarlyCSE] fold commutable intrinsics

Handling the new min/max intrinsics is the motivation, but it
turns out that we have a bunch of other intrinsics with this
missing bit of analysis too.

The FP min/max tests show that we are intersecting FMF,
so that part should be safe too.

As noted in https://llvm.org/PR46897 , there is a commutative
property specifier for intrinsics, but no corresponding function
attribute, and so apparently no uses of that bit. We may want to
remove that next.

Follow-up patches should wire up the Instruction::isCommutative()
to this IntrinsicInst specialization. That requires updating
callers to be aware of the more general commutative property
(not just binops).

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




More information about the All-commits mailing list