[llvm] 5b53b17 - DAG: Add missing comment for transform

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 07:01:19 PDT 2020


Author: Matt Arsenault
Date: 2020-08-17T10:01:12-04:00
New Revision: 5b53b17cd307d1b507d28ac19278c1209684f23e

URL: https://github.com/llvm/llvm-project/commit/5b53b17cd307d1b507d28ac19278c1209684f23e
DIFF: https://github.com/llvm/llvm-project/commit/5b53b17cd307d1b507d28ac19278c1209684f23e.diff

LOG: DAG: Add missing comment for transform

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index dbc83d6d4414a..a76505861dee5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -7328,6 +7328,7 @@ SDValue TargetLowering::expandAddSubSat(SDNode *Node, SelectionDAG &DAG) const {
     return DAG.getNode(ISD::SUB, dl, VT, Max, RHS);
   }
 
+  // uadd.sat(a, b) -> umin(a, ~b) + b
   if (Opcode == ISD::UADDSAT && isOperationLegalOrCustom(ISD::UMIN, VT)) {
     SDValue InvRHS = DAG.getNOT(dl, RHS, VT);
     SDValue Min = DAG.getNode(ISD::UMIN, dl, VT, LHS, InvRHS);


        


More information about the llvm-commits mailing list