[llvm] [PBQP] Use llvm::interleaved (NFC) (PR #136462)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 19 16:33:18 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/136462

None

>From a3154fb16c79fda1a759181687ce1928acbcb376 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 19 Apr 2025 16:17:58 -0700
Subject: [PATCH] [PBQP] Use llvm::interleaved (NFC)

---
 llvm/include/llvm/CodeGen/PBQP/Math.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/llvm/include/llvm/CodeGen/PBQP/Math.h b/llvm/include/llvm/CodeGen/PBQP/Math.h
index 6a8942e08b101..2b2b498e54fce 100644
--- a/llvm/include/llvm/CodeGen/PBQP/Math.h
+++ b/llvm/include/llvm/CodeGen/PBQP/Math.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/InterleavedRange.h"
 #include <algorithm>
 #include <cassert>
 #include <functional>
@@ -111,12 +112,7 @@ inline hash_code hash_value(const Vector &V) {
 template <typename OStream>
 OStream& operator<<(OStream &OS, const Vector &V) {
   assert((V.getLength() != 0) && "Zero-length vector badness.");
-
-  OS << "[ " << V[0];
-  for (unsigned i = 1; i < V.getLength(); ++i)
-    OS << ", " << V[i];
-  OS << " ]";
-
+  OS << "[ " << llvm::interleaved(V) << " ]";
   return OS;
 }
 



More information about the llvm-commits mailing list