[llvm] [NFC][IR2Vec] Fix warnings on MSVC compilation (PR #148911)

S. VenkataKeerthy via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 10:51:40 PDT 2025


https://github.com/svkeerthy created https://github.com/llvm/llvm-project/pull/148911

None

>From 3a4a656c714aa339a9ad18948c9cce9b8a404f40 Mon Sep 17 00:00:00 2001
From: svkeerthy <venkatakeerthy at google.com>
Date: Tue, 15 Jul 2025 17:50:28 +0000
Subject: [PATCH] [NFC] Fix warnings in IR2Vec on MSVC compilation

---
 llvm/lib/Analysis/IR2Vec.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Analysis/IR2Vec.cpp b/llvm/lib/Analysis/IR2Vec.cpp
index cfe0c566e2adc..898bf5b202feb 100644
--- a/llvm/lib/Analysis/IR2Vec.cpp
+++ b/llvm/lib/Analysis/IR2Vec.cpp
@@ -304,10 +304,11 @@ Vocabulary::VocabVector Vocabulary::createDummyVocabForTest(unsigned Dim) {
   float DummyVal = 0.1f;
   // Create a dummy vocabulary with entries for all opcodes, types, and
   // operand
-  for (unsigned _ : seq(0u, Vocabulary::MaxOpcodes + Vocabulary::MaxTypeIDs +
-                                Vocabulary::MaxOperandKinds)) {
+  for ([[maybe_unused]] unsigned _ :
+       seq(0u, Vocabulary::MaxOpcodes + Vocabulary::MaxTypeIDs +
+                   Vocabulary::MaxOperandKinds)) {
     DummyVocab.push_back(Embedding(Dim, DummyVal));
-    DummyVal += 0.1;
+    DummyVal += 0.1f;
   }
   return DummyVocab;
 }



More information about the llvm-commits mailing list