[llvm] [SelectionDAG] Fix misplaced commas in operand bundle errors (PR #149331)

Fraser Cormack via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 17 08:13:45 PDT 2025


https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/149331

None

>From 82620d374aaad659a050be65bdef26a6c98501c8 Mon Sep 17 00:00:00 2001
From: Fraser Cormack <fraser at codeplay.com>
Date: Thu, 17 Jul 2025 16:12:37 +0100
Subject: [PATCH] [SelectionDAG] Fix misplaced commas in operand bundle errors

---
 llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 2 +-
 llvm/test/CodeGen/X86/invalid-operand-bundle-call.ll  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 74c14ede24755..97d5c4e5bf485 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -846,9 +846,9 @@ static void failForInvalidBundles(const CallBase &I, StringRef Name,
                                   ArrayRef<uint32_t> AllowedBundles) {
   if (I.hasOperandBundlesOtherThan(AllowedBundles)) {
     std::string Error;
+    bool First = true;
     for (unsigned i = 0, e = I.getNumOperandBundles(); i != e; ++i) {
       OperandBundleUse U = I.getOperandBundleAt(i);
-      bool First = true;
       if (is_contained(AllowedBundles, U.getTagID()))
         continue;
       if (!First)
diff --git a/llvm/test/CodeGen/X86/invalid-operand-bundle-call.ll b/llvm/test/CodeGen/X86/invalid-operand-bundle-call.ll
index ac4963f1f79cc..f39433001d8bc 100644
--- a/llvm/test/CodeGen/X86/invalid-operand-bundle-call.ll
+++ b/llvm/test/CodeGen/X86/invalid-operand-bundle-call.ll
@@ -1,10 +1,10 @@
 ; RUN: not llc -mtriple=x86_64-unknown-linux-gnu < %s 2>&1 | FileCheck %s
 
-; CHECK: LLVM ERROR: cannot lower calls with arbitrary operand bundles: foo
+; CHECK: LLVM ERROR: cannot lower calls with arbitrary operand bundles: foo, bar
 
 declare void @g()
 
 define void @f(i32 %arg) {
-  call void @g() [ "foo"(i32 %arg) ]
+  call void @g() [ "foo"(i32 %arg), "bar"(i32 %arg) ]
   ret void
 }



More information about the llvm-commits mailing list