Skip to content

Commit b4f54bf

Browse files
committed
[llvm][LoongArch] Fix compiler warning produced by assert
Fixes #154918 tion ‘llvm::SDValue fillSubVectorFromBuildVector(llvm::BuildVectorSDNode*, llvm::SelectionDAG&, llvm::SDLoc, const llvm::LoongArchSubtarget&, llvm::EVT, unsigned int)’: /home/davspi01/work/open_source/llvm-project/llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:2863:16: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits] 2863 | assert(first >= 0 && | ~~~~~~^~~~ first is unsigned so this part of the expression is redundant.
1 parent 3c6cd73 commit b4f54bf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,8 +2860,7 @@ static SDValue fillSubVectorFromBuildVector(BuildVectorSDNode *Node,
28602860
EVT ResTy, unsigned first) {
28612861
unsigned NumElts = ResTy.getVectorNumElements();
28622862

2863-
assert(first >= 0 &&
2864-
first + NumElts <= Node->getSimpleValueType(0).getVectorNumElements());
2863+
assert(first + NumElts <= Node->getSimpleValueType(0).getVectorNumElements());
28652864

28662865
SmallVector<SDValue, 16> Ops(Node->op_begin() + first,
28672866
Node->op_begin() + first + NumElts);

0 commit comments

Comments
 (0)