[llvm] [IR2Vec] Adding tests to check multiple invocations of `getFunctionVector()` and `getInstVecMap()` return same results (PR #162365)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 7 13:23:32 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/unittests/Analysis/IR2VecTest.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/unittests/Analysis/IR2VecTest.cpp b/llvm/unittests/Analysis/IR2VecTest.cpp
index ee14596bc..40b4aa21f 100644
--- a/llvm/unittests/Analysis/IR2VecTest.cpp
+++ b/llvm/unittests/Analysis/IR2VecTest.cpp
@@ -436,7 +436,7 @@ TEST_F(IR2VecTestFixture, MultipleComputeEmbeddingsConsistency_Symbolic) {
// Get initial function vector
const auto &FuncVec1 = Emb->getFunctionVector();
-
+
// Compute embeddings again by calling getFunctionVector multiple times
const auto &FuncVec2 = Emb->getFunctionVector();
const auto &FuncVec3 = Emb->getFunctionVector();
@@ -449,7 +449,7 @@ TEST_F(IR2VecTestFixture, MultipleComputeEmbeddingsConsistency_Symbolic) {
// Also check that instruction vectors remain consistent
const auto &InstMap1 = Emb->getInstVecMap();
const auto &InstMap2 = Emb->getInstVecMap();
-
+
EXPECT_EQ(InstMap1.size(), InstMap2.size());
for (const auto &[Inst, Vec1] : InstMap1) {
ASSERT_TRUE(InstMap2.count(Inst));
@@ -463,7 +463,7 @@ TEST_F(IR2VecTestFixture, MultipleComputeEmbeddingsConsistency_FlowAware) {
// Get initial function vector
const auto &FuncVec1 = Emb->getFunctionVector();
-
+
// Compute embeddings again by calling getFunctionVector multiple times
const auto &FuncVec2 = Emb->getFunctionVector();
const auto &FuncVec3 = Emb->getFunctionVector();
@@ -476,7 +476,7 @@ TEST_F(IR2VecTestFixture, MultipleComputeEmbeddingsConsistency_FlowAware) {
// Also check that instruction vectors remain consistent
const auto &InstMap1 = Emb->getInstVecMap();
const auto &InstMap2 = Emb->getInstVecMap();
-
+
EXPECT_EQ(InstMap1.size(), InstMap2.size());
for (const auto &[Inst, Vec1] : InstMap1) {
ASSERT_TRUE(InstMap2.count(Inst));
``````````
</details>
https://github.com/llvm/llvm-project/pull/162365
More information about the llvm-commits
mailing list