[PATCH] D17898: Implement expansion of {s, u}{min, max} in integer legalization

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 08:37:23 PDT 2016


arsenm added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1679-1685
@@ +1678,9 @@
+  unsigned int LoOpc = N->getOpcode();
+  switch (N->getOpcode()) {
+    default: llvm_unreachable("invalid min/max opcode");
+    case ISD::SMAX: LoOpc = ISD::UMAX; CondC = ISD::SETGT; break;
+    case ISD::UMAX: CondC = ISD::SETUGT; break;
+    case ISD::SMIN: LoOpc = ISD::UMIN; CondC = ISD::SETLT; break;
+    case ISD::UMIN: CondC = ISD::SETULT; break;
+  }
+
----------------
I would prefer moving this to a static function with a switch and returns of the enums


Repository:
  rL LLVM

http://reviews.llvm.org/D17898





More information about the llvm-commits mailing list