[llvm] ca3d4df - [Metadata] Make range boundary variables unsigned (NFC) (#99338)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 22 08:02:09 PDT 2024
Author: AtariDreams
Date: 2024-07-22T17:02:05+02:00
New Revision: ca3d4dfe0c8844a8010751c51600a3bd3f6f80a4
URL: https://github.com/llvm/llvm-project/commit/ca3d4dfe0c8844a8010751c51600a3bd3f6f80a4
DIFF: https://github.com/llvm/llvm-project/commit/ca3d4dfe0c8844a8010751c51600a3bd3f6f80a4.diff
LOG: [Metadata] Make range boundary variables unsigned (NFC) (#99338)
They should be unsigned because the source and target value are too.
Added:
Modified:
llvm/lib/IR/Metadata.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 3aec7140510a6..ae5f5de142328 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -1287,12 +1287,12 @@ MDNode *MDNode::getMostGenericRange(MDNode *A, MDNode *B) {
return A;
// First, walk both lists in order of the lower boundary of each interval.
- // At each step, try to merge the new interval to the last one we adedd.
+ // At each step, try to merge the new interval to the last one we added.
SmallVector<ConstantInt *, 4> EndPoints;
- int AI = 0;
- int BI = 0;
- int AN = A->getNumOperands() / 2;
- int BN = B->getNumOperands() / 2;
+ unsigned AI = 0;
+ unsigned BI = 0;
+ unsigned AN = A->getNumOperands() / 2;
+ unsigned BN = B->getNumOperands() / 2;
while (AI < AN && BI < BN) {
ConstantInt *ALow = mdconst::extract<ConstantInt>(A->getOperand(2 * AI));
ConstantInt *BLow = mdconst::extract<ConstantInt>(B->getOperand(2 * BI));
More information about the llvm-commits
mailing list