[llvm] [CGSCCPassManagerTest] Replace no-op bitcast to create constant using the old function (PR #72460)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 17:10:07 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: Youngsuk Kim (JOE1994)

<details>
<summary>Changes</summary>

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).

---
Full diff: https://github.com/llvm/llvm-project/pull/72460.diff


1 Files Affected:

- (modified) llvm/unittests/Analysis/CGSCCPassManagerTest.cpp (+1-2) 


``````````diff
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;

``````````

</details>


https://github.com/llvm/llvm-project/pull/72460


More information about the llvm-commits mailing list