[InstCombine] hoist min/max intrinsics above select with constant op
authorSanjay Patel <spatel@rotateright.com>
Sun, 27 Jun 2021 13:58:28 +0000 (09:58 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sun, 27 Jun 2021 14:02:23 +0000 (10:02 -0400)
commit153da08a6cd7feea6644b3191019573d70a5bbd3
tree47c5208dcb519b115235c8589a05defcd805d1a2
parent81fcdae68c5ff656c30032fd26c6a21af4c51dbb
[InstCombine] hoist min/max intrinsics above select with constant op

This is an extension of the handling for unary intrinsics and
follows the logic that we use for binary ops.

We don't canonicalize to min/max intrinsics yet, but this might
help unlock other folds seen in D98152.
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/select-min-max.ll