[PATCH] D24033: Convert clamp into fmaxnum/fminnum pairs.

Kevin Hu via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 12:49:13 PDT 2016


hxy9243 marked 14 inline comments as done.

================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5120-5123
@@ +5119,6 @@
+
+  // Check if float point constant are the same
+  if (&CmpN1FPVal.getSemantics() != &N1FPVal.getSemantics()
+      || CmpN1FPVal.compare(N1FPVal) != APFloat::cmpEqual)
+    return SDValue();
+
----------------
These are separate instructions, and could have different semantics. The comparison will be broken if we don't check semantics.

================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5134-5135
@@ +5133,4 @@
+  APFloat N2Operand2Val = N2Operand2->getValueAPF();
+  if (&CmpN1FPVal.getSemantics() != &N2Operand2Val.getSemantics())
+    return SDValue();
+
----------------
Ditto.


https://reviews.llvm.org/D24033





More information about the llvm-commits mailing list