[llvm] r323439 - [X86] Apply clang-format to detectUSatPattern. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 08:38:56 PST 2018


Author: rksimon
Date: Thu Jan 25 08:38:56 2018
New Revision: 323439

URL: http://llvm.org/viewvc/llvm-project?rev=323439&view=rev
Log:
[X86] Apply clang-format to detectUSatPattern. NFCI.

Cleanup from D42544

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=323439&r1=323438&r2=323439&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jan 25 08:38:56 2018
@@ -34294,7 +34294,7 @@ static bool isSATValidOnAVX512Subtarget(
   return false;
 }
 
-/// Detect a pattern of truncation with saturation:
+/// Detect a pattern of truncation with unsigned saturation:
 /// (truncate (umin (x, unsigned_max_of_dest_type)) to dest_type).
 /// Return the source value to be truncated or SDValue() if the pattern was not
 /// matched.
@@ -34302,16 +34302,15 @@ static SDValue detectUSatPattern(SDValue
   if (In.getOpcode() != ISD::UMIN)
     return SDValue();
 
-  //Saturation with truncation. We truncate from InVT to VT.
+  // Saturation with truncation. We truncate from InVT to VT.
   assert(In.getScalarValueSizeInBits() > VT.getScalarSizeInBits() &&
-    "Unexpected types for truncate operation");
+         "Unexpected types for truncate operation");
 
   APInt C;
   if (ISD::isConstantSplatVector(In.getOperand(1).getNode(), C)) {
     // C should be equal to UINT32_MAX / UINT16_MAX / UINT8_MAX according
     // the element size of the destination type.
-    return C.isMask(VT.getScalarSizeInBits()) ? In.getOperand(0) :
-      SDValue();
+    return C.isMask(VT.getScalarSizeInBits()) ? In.getOperand(0) : SDValue();
   }
   return SDValue();
 }




More information about the llvm-commits mailing list