[llvm] 7e77f19 - [TTI] Fix -Wsign-compare in BasicTTIImpl.h (NFC)
Jie Fu via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 6 05:09:46 PDT 2023
Author: Jie Fu
Date: 2023-10-06T20:08:51+08:00
New Revision: 7e77f19232880b2ea79eddeda6a0a6c8bc9a1d8c
URL: https://github.com/llvm/llvm-project/commit/7e77f19232880b2ea79eddeda6a0a6c8bc9a1d8c
DIFF: https://github.com/llvm/llvm-project/commit/7e77f19232880b2ea79eddeda6a0a6c8bc9a1d8c.diff
LOG: [TTI] Fix -Wsign-compare in BasicTTIImpl.h (NFC)
/llvm-project/llvm/include/llvm/CodeGen/BasicTTIImpl.h:948:33: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare]
(Index + Mask.size()) <= NumSrcElts) {
~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
Added:
Modified:
llvm/include/llvm/CodeGen/BasicTTIImpl.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index fbaee70b1265078..2d0d10982aff6f5 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -945,7 +945,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
if (ShuffleVectorInst::isZeroEltSplatMask(Mask, NumSrcElts))
return TTI::SK_Broadcast;
if (ShuffleVectorInst::isExtractSubvectorMask(Mask, NumSrcElts, Index) &&
- (Index + Mask.size()) <= NumSrcElts) {
+ (Index + Mask.size()) <= (size_t)NumSrcElts) {
SubTy = FixedVectorType::get(Ty->getElementType(), Mask.size());
return TTI::SK_ExtractSubvector;
}
More information about the llvm-commits
mailing list