Skip to content

[GlobalISel] Fixes unused variable error in testMOPredicate_MO #143364

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 9, 2025

Conversation

jyli0116
Copy link
Contributor

@jyli0116 jyli0116 commented Jun 9, 2025

Solves unused variable error in generated Global ISel code due to changes from #140935

@llvmbot
Copy link
Member

llvmbot commented Jun 9, 2025

@llvm/pr-subscribers-tablegen

@llvm/pr-subscribers-llvm-globalisel

Author: None (jyli0116)

Changes

Solves unused variable error in generated Global ISel code due to changes from #140935


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

2 Files Affected:

  • (modified) llvm/test/TableGen/GlobalISelEmitter/GlobalISelEmitter.td (+1)
  • (modified) llvm/utils/TableGen/GlobalISelEmitter.cpp (+2-1)
diff --git a/llvm/test/TableGen/GlobalISelEmitter/GlobalISelEmitter.td b/llvm/test/TableGen/GlobalISelEmitter/GlobalISelEmitter.td
index 53d29225e774e..23e22b8b84183 100644
--- a/llvm/test/TableGen/GlobalISelEmitter/GlobalISelEmitter.td
+++ b/llvm/test/TableGen/GlobalISelEmitter/GlobalISelEmitter.td
@@ -167,6 +167,7 @@ def HasC : Predicate<"Subtarget->hasC()"> { let RecomputePerFunction = 1; }
 // CHECK-NEXT:    const auto &Operands = State.RecordedOperands; 
 // CHECK-NEXT:    Register Reg = MO.getReg();
 // CHECK-NEXT:    (void)Operands; 
+// CHECK-NEXT:    (void)Reg;
 // CHECK-NEXT:    switch (PredicateID) {
 // CHECK-NEXT:    case GICXXPred_MO_Predicate_leaf: {
 // CHECK-NEXT:       return true;
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
index 5b61d6e3f6561..28b1a837bbd94 100644
--- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -2314,7 +2314,8 @@ void GlobalISelEmitter::emitLeafPredicateFns(raw_ostream &OS) {
       OS,
       "  const auto &Operands = State.RecordedOperands;\n"
       "  Register Reg = MO.getReg();\n"
-      "  (void)Operands;",
+      "  (void)Operands;\n"
+      "  (void)Reg;",
       ArrayRef<const Record *>(MatchedRecords), &getPatFragPredicateEnumName,
       [](const Record *R) {
         return R->getValueAsString("GISelLeafPredicateCode");

@jyli0116 jyli0116 merged commit 7e00a7c into llvm:main Jun 9, 2025
10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 9, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-5 while building llvm at step 4 "cmake-configure".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/21122

Here is the relevant piece of the build log for the reference
Step 4 (cmake-configure) failure: cmake (failure)


rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
…143364)

Solves unused variable error in generated Global ISel code due to
changes from llvm#140935
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
…143364)

Solves unused variable error in generated Global ISel code due to
changes from llvm#140935
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
…143364)

Solves unused variable error in generated Global ISel code due to
changes from llvm#140935
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.

4 participants