[PATCH] D119955: [InstCombine] push constant operand down/outside in sequence of min/max intrinsics

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 09:33:33 PST 2022


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:924
+  if (!InnerMM || InnerMM->getIntrinsicID() != MinMaxID ||
+      match(X, m_Constant()) || match(Y, m_Constant()))
+    return nullptr;
----------------
spatel wrote:
> lebedev.ri wrote:
> > Constant or ImmConstant?
> I figured any constant would be safer. I'm not sure what happens if we put constant expressions in these patterns, so just give up?
This fold only hoists an immconstant, so there indeed is a chance of looping iff x or y is a immconstant,
but i don't see why non-imm constant would be dangerous.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119955/new/

https://reviews.llvm.org/D119955



More information about the llvm-commits mailing list