[llvm] [X86] LowerMINMAX - use valuetracking to attempt to find a smaller type that can efficiently lower min/max ops (PR #174294)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 4 04:17:45 PST 2026


================
@@ -10799,6 +10799,28 @@ SDValue TargetLowering::expandIntMINMAX(SDNode *Node, SelectionDAG &DAG) const {
   unsigned Opcode = Node->getOpcode();
   SDLoc DL(Node);
 
+  // If both sign bits are zero, flip UMIN/UMAX <-> SMIN/SMAX if legal.
----------------
RKSimon wrote:

I've raised #174325 - initially as a DAGCombine, but we can investigate handling this in expandIntMINMAX as well later on.

https://github.com/llvm/llvm-project/pull/174294


More information about the llvm-commits mailing list