Skip to content

[GISel] [NFC] Capitalize loop indices in GISelValueTracking.cpp for style consistency #143113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

usha1830
Copy link
Contributor

@usha1830 usha1830 commented Jun 6, 2025

Following up on a comment on #142355.
Updated other instances in the file as well.

@jayfoad

@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2025

@llvm/pr-subscribers-llvm-globalisel

Author: Usha Gupta (usha1830)

Changes

Following up on a comment on #142355.
Updated other instances in the file as well.

@jayfoad


Full diff: https://github.com/llvm/llvm-project/pull/143113.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp (+12-12)
diff --git a/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp b/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
index 2d276f05e24cf..135e1d2163e23 100644
--- a/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
@@ -222,11 +222,11 @@ void GISelValueTracking::computeKnownBitsImpl(Register R, KnownBits &Known,
     // Collect the known bits that are shared by every demanded vector element.
     Known.Zero.setAllBits();
     Known.One.setAllBits();
-    for (unsigned i = 0, e = MI.getNumOperands() - 1; i < e; ++i) {
-      if (!DemandedElts[i])
+    for (unsigned I = 0, E = MI.getNumOperands() - 1; I < E; ++I) {
+      if (!DemandedElts[I])
         continue;
 
-      computeKnownBitsImpl(MI.getOperand(i + 1).getReg(), Known2, APInt(1, 1),
+      computeKnownBitsImpl(MI.getOperand(I + 1).getReg(), Known2, APInt(1, 1),
                            Depth + 1);
 
       // Known bits are the values that are shared by every demanded element.
@@ -685,11 +685,11 @@ void GISelValueTracking::computeKnownBitsImpl(Register R, KnownBits &Known,
         MRI.getType(MI.getOperand(1).getReg()).getNumElements();
     unsigned NumSubVectors = MI.getNumOperands() - 1;
 
-    for (unsigned i = 0; i != NumSubVectors; ++i) {
+    for (unsigned I = 0; I != NumSubVectors; ++I) {
       APInt DemandedSub =
-          DemandedElts.extractBits(NumSubVectorElts, i * NumSubVectorElts);
+          DemandedElts.extractBits(NumSubVectorElts, I * NumSubVectorElts);
       if (!!DemandedSub) {
-        computeKnownBitsImpl(MI.getOperand(i + 1).getReg(), Known2, DemandedSub,
+        computeKnownBitsImpl(MI.getOperand(I + 1).getReg(), Known2, DemandedSub,
                              Depth + 1);
 
         Known = Known.intersectWith(Known2);
@@ -1944,11 +1944,11 @@ unsigned GISelValueTracking::computeNumSignBits(Register R,
     // Collect the known bits that are shared by every demanded vector element.
     FirstAnswer = TyBits;
     APInt SingleDemandedElt(1, 1);
-    for (unsigned i = 0, e = MI.getNumOperands() - 1; i < e; ++i) {
-      if (!DemandedElts[i])
+    for (unsigned I = 0, E = MI.getNumOperands() - 1; I < E; ++I) {
+      if (!DemandedElts[I])
         continue;
 
-      unsigned Tmp2 = computeNumSignBits(MI.getOperand(i + 1).getReg(),
+      unsigned Tmp2 = computeNumSignBits(MI.getOperand(I + 1).getReg(),
                                          SingleDemandedElt, Depth + 1);
       FirstAnswer = std::min(FirstAnswer, Tmp2);
 
@@ -1967,12 +1967,12 @@ unsigned GISelValueTracking::computeNumSignBits(Register R,
     unsigned NumSubVectorElts =
         MRI.getType(MI.getOperand(1).getReg()).getNumElements();
     unsigned NumSubVectors = MI.getNumOperands() - 1;
-    for (unsigned i = 0; i < NumSubVectors; ++i) {
+    for (unsigned I = 0; I < NumSubVectors; ++I) {
       APInt DemandedSub =
-          DemandedElts.extractBits(NumSubVectorElts, i * NumSubVectorElts);
+          DemandedElts.extractBits(NumSubVectorElts, I * NumSubVectorElts);
       if (!DemandedSub)
         continue;
-      unsigned Tmp2 = computeNumSignBits(MI.getOperand(i + 1).getReg(),
+      unsigned Tmp2 = computeNumSignBits(MI.getOperand(I + 1).getReg(),
                                          DemandedSub, Depth + 1);
 
       FirstAnswer = std::min(FirstAnswer, Tmp2);

@usha1830
Copy link
Contributor Author

usha1830 commented Jun 6, 2025

@arsenm Could you please merge this PR?

@arsenm arsenm merged commit d5a1f49 into llvm:main Jun 6, 2025
9 checks passed
nvjle added a commit that referenced this pull request Jun 7, 2025
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jun 7, 2025
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
…tyle consistency (llvm#143113)

Following up on a comment on
llvm#142355.
Updated other instances in the file as well.

@jayfoad
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
…tyle consistency (llvm#143113)

Following up on a comment on
llvm#142355.
Updated other instances in the file as well.

@jayfoad
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
…tyle consistency (llvm#143113)

Following up on a comment on
llvm#142355.
Updated other instances in the file as well.

@jayfoad
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants