[PATCH] D54001: [ValueTracking] determine sign of 0.0 from select when matching min/max FP

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 1 15:22:04 PDT 2018


arsenm added inline comments.


================
Comment at: lib/Analysis/ValueTracking.cpp:4762-4773
+    if (match(FalseVal, m_PosZeroFP()) && !match(TrueVal, m_NegZeroFP())) {
+      if (match(CmpLHS, m_NegZeroFP()))
+        CmpLHS = FalseVal;
+      if (match(CmpRHS, m_NegZeroFP()))
+        CmpRHS = FalseVal;
+    }
+    if (match(FalseVal, m_NegZeroFP()) && !match(TrueVal, m_PosZeroFP())) {
----------------
This looks big. Can you avoid repeating the same thing for the true and false cases?


https://reviews.llvm.org/D54001





More information about the llvm-commits mailing list