Skip to content

OMPIRBuilder: Cleanup checking for GlobalValue #134583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Apr 7, 2025

GlobalValue already subsumes GlobalObject and GlobalVariable,
plus make use of the std::get<0> already copied to a variable
above.

Copy link
Contributor Author

arsenm commented Apr 7, 2025

@arsenm arsenm added the llvm:openmpirbuilder Issues related to problems in the llvm-project/lib/Frontend/OpenMP/OMPIRBuilder.cpp label Apr 7, 2025 — with Graphite App
@arsenm arsenm marked this pull request as ready for review April 7, 2025 06:05
@llvmbot llvmbot added flang:openmp clang:openmp OpenMP related changes to Clang labels Apr 7, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 7, 2025

@llvm/pr-subscribers-flang-openmp

Author: Matt Arsenault (arsenm)

Changes

GlobalValue already subsumes GlobalObject and GlobalVariable,
plus make use of the std::get<0> already copied to a variable
above.


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

1 Files Affected:

  • (modified) llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp (+1-3)
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index 68b1fa42934ad..bbb44288d0d0d 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -7027,9 +7027,7 @@ static Expected<Function *> createOutlinedFunction(
     // preceding mapped arguments that refer to the same global that may be
     // seperate segments. To prevent this, we defer global processing until all
     // other processing has been performed.
-    if (llvm::isa<llvm::GlobalValue>(std::get<0>(InArg)) ||
-        llvm::isa<llvm::GlobalObject>(std::get<0>(InArg)) ||
-        llvm::isa<llvm::GlobalVariable>(std::get<0>(InArg))) {
+    if (isa<GlobalValue>(Input)) {
       DeferredReplacement.push_back(std::make_pair(Input, InputCopy));
       continue;
     }

Copy link
Contributor Author

arsenm commented Apr 8, 2025

Merge activity

  • Apr 7, 8:19 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 7, 8:22 PM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 7, 8:25 PM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 7, 8:28 PM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 7, 8:31 PM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 7, 8:33 PM EDT: A user merged this pull request with Graphite.

@arsenm arsenm force-pushed the users/arsenm/ompirbuilder-cleanup-globalvalue-check branch 3 times, most recently from d702db5 to 711096a Compare April 8, 2025 00:27
GlobalValue already subsumes GlobalObject and GlobalVariable,
plus make use of the std::get<0> already copied to a variable
above.
@arsenm arsenm force-pushed the users/arsenm/ompirbuilder-cleanup-globalvalue-check branch from 711096a to 5a633f4 Compare April 8, 2025 00:31
@arsenm arsenm merged commit 87afe4d into main Apr 8, 2025
4 of 5 checks passed
@arsenm arsenm deleted the users/arsenm/ompirbuilder-cleanup-globalvalue-check branch April 8, 2025 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:openmp OpenMP related changes to Clang flang:openmp llvm:openmpirbuilder Issues related to problems in the llvm-project/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants