[PATCH] D53774: [InstCombine] Combine nested min/max intrinsics with constants

Volkan Keles via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 30 11:27:47 PDT 2018


volkan added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:2067-2072
+    if (auto *M = dyn_cast<IntrinsicInst>(Arg0)) {
+      if (M->getIntrinsicID() == IID && match(Arg1, m_APFloat(C1)) &&
+          ((match(M->getArgOperand(0), m_Value(X)) &&
+            match(M->getArgOperand(1), m_APFloat(C2))) ||
+           (match(M->getArgOperand(1), m_Value(X)) &&
+            match(M->getArgOperand(0), m_APFloat(C2))))) {
----------------
lebedev.ri wrote:
> Can this be simplified at all using existing `m_Intrinsic<>()`?
`m_Intrinsic<>` can be used here, but that wouldn't be simpler as we need to call that for each intrinsics.


https://reviews.llvm.org/D53774





More information about the llvm-commits mailing list