[llvm] cf8d684 - remove useless condition in assert in SelectionDAG.cpp

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 18:54:08 PDT 2023


Author: Wang, Xin10
Date: 2023-04-17T21:53:19-04:00
New Revision: cf8d6844de3327ce2e1ff2e7f718b1e62f213fea

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

LOG: remove useless condition in assert in SelectionDAG.cpp

The condition Opcode <= std::numeric_limits<int>::max() will
always be true here.

Reviewed By: skan

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 14ab62eaa4de..bdbd2f899c8b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -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!");
 


        


More information about the llvm-commits mailing list