remove useless condition in assert in SelectionDAG.cpp
authorWang, Xin10 <xin10.wang@intel.com>
Tue, 18 Apr 2023 01:50:10 +0000 (21:50 -0400)
committerWang, Xin10 <xin10.wang@intel.com>
Tue, 18 Apr 2023 01:53:19 +0000 (21:53 -0400)
The condition Opcode <= std::numeric_limits<int>::max() will
always be true here.

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D148306

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 14ab62e..bdbd2f8 100644 (file)
@@ -7952,7 +7952,7 @@ SDValue SelectionDAG::getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl,
   assert((Opcode == ISD::INTRINSIC_VOID ||
           Opcode == ISD::INTRINSIC_W_CHAIN ||
           Opcode == ISD::PREFETCH ||
-          ((int)Opcode <= std::numeric_limits<int>::max() &&
+          (Opcode <= (unsigned)std::numeric_limits<int>::max() &&
            (int)Opcode >= ISD::FIRST_TARGET_MEMORY_OPCODE)) &&
          "Opcode is not a memory-accessing opcode!");