[llvm] [CGSCCPassManagerTest] Replace no-op bitcast to create constant using the old function (PR #72460)
Youngsuk Kim via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 16 02:59:45 PST 2023
https://github.com/JOE1994 updated https://github.com/llvm/llvm-project/pull/72460
>From 635d759b710b7f220719addd40dab8f76ecbe9cf Mon Sep 17 00:00:00 2001
From: Youngsuk Kim <youngsuk.kim at hpe.com>
Date: Wed, 15 Nov 2023 18:13:59 -0600
Subject: [PATCH 1/2] [CGSCCPassManagerTest] Replace no-op bitcast to create
constant using the old function
With opaque pointers enabled, the existing ptr-to-ptr bitcast is a no-op and no
longer creates a constant that references the old function.
Replace the no-op bitcast with code that creates a constant that references the
old function. The test now fails if the 1 new line of code added to
`CallGraphUpdater::replaceFunctionWith()` in
cb0ecc5c33bd56a3eed0fa30ac787accec45d637 is removed (test passes if kept
intact).
---
llvm/unittests/Analysis/CGSCCPassManagerTest.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp b/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
index 309fe277e03fac7..7c22c7074150da0 100644
--- a/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
+++ b/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
@@ -1633,8 +1633,7 @@ TEST_F(CGSCCPassManagerTest, TestUpdateCGAndAnalysisManagerForPasses8) {
// Create an unsused constant that is referencing the old (=replaced)
// function.
- ConstantExpr::getBitCast(FnF,
- PointerType::getUnqual(FnF->getContext()));
+ ConstantExpr::getPtrToInt(FnF, Type::getInt64Ty(FnF->getContext()));
// Use the CallGraphUpdater to update the call graph.
CallGraphUpdater CGU;
>From ae843e8ec7576d91ac61201cd76da74c8b7babf4 Mon Sep 17 00:00:00 2001
From: Youngsuk Kim <joseph942010 at gmail.com>
Date: Thu, 16 Nov 2023 05:59:37 -0500
Subject: [PATCH 2/2] Update llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
Fix typo :)
Co-authored-by: Nikita Popov <github at npopov.com>
---
llvm/unittests/Analysis/CGSCCPassManagerTest.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp b/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
index 7c22c7074150da0..b33567dd602b0ea 100644
--- a/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
+++ b/llvm/unittests/Analysis/CGSCCPassManagerTest.cpp
@@ -1631,7 +1631,7 @@ TEST_F(CGSCCPassManagerTest, TestUpdateCGAndAnalysisManagerForPasses8) {
FnF->getEntryBlock().front().moveBefore(RI);
ASSERT_NE(FnF, nullptr);
- // Create an unsused constant that is referencing the old (=replaced)
+ // Create an unused constant that is referencing the old (=replaced)
// function.
ConstantExpr::getPtrToInt(FnF, Type::getInt64Ty(FnF->getContext()));
More information about the llvm-commits
mailing list