[PATCH] D112675: [Instcombine] Add patterns to generate fneg(fabs(x)) instead of fcmp/sub/selects (part 1)

Usman Nadeem via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 16:21:23 PDT 2021


mnadeem added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2970
+  if (match(CondVal, m_FCmp(Pred, m_Specific(TrueVal), m_AnyZeroFP())) &&
+      (Pred == FCmpInst::FCMP_OLT || Pred == FCmpInst::FCMP_ULT)) {
+    if (match(FalseVal, m_FSub(m_PosZeroFP(), m_Specific(TrueVal)))) {
----------------
`<=` needs nsz on the select, so I'll just add that condition here and the rest should work fine.


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

https://reviews.llvm.org/D112675



More information about the llvm-commits mailing list