[flang-commits] [flang] [flang][cuda] Remove extra managed spelling from bbc (PR #175803)
via flang-commits
flang-commits at lists.llvm.org
Tue Jan 13 09:47:10 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-fir-hlfir
Author: Valentin Clement (バレンタイン クレメン) (clementval)
<details>
<summary>Changes</summary>
`bbc` is just a testing tool so we don't need to support multiple option spelling. Keep it simple.
---
Full diff: https://github.com/llvm/llvm-project/pull/175803.diff
3 Files Affected:
- (modified) flang/lib/Semantics/resolve-names.cpp (+1-1)
- (modified) flang/test/Lower/CUDA/cuda-gpu-managed.cuf (+1-1)
- (modified) flang/tools/bbc/bbc.cpp (+2-3)
``````````diff
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index d2a3331710dba..310f7ab97e9a0 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -9913,7 +9913,7 @@ void ResolveNamesVisitor::FinishSpecificationPart(
SetBindNameOn(symbol);
}
}
- // -gpu=mem:managed: implicitly treat allocatable arrays as managed.
+ // Implicitly treat allocatable arrays as managed when feature is enabled.
// This is done after all explicit CUDA attributes have been processed.
if (context().languageFeatures().IsEnabled(
common::LanguageFeature::CudaManaged))
diff --git a/flang/test/Lower/CUDA/cuda-gpu-managed.cuf b/flang/test/Lower/CUDA/cuda-gpu-managed.cuf
index b015b470b921b..6c69f4d71674c 100644
--- a/flang/test/Lower/CUDA/cuda-gpu-managed.cuf
+++ b/flang/test/Lower/CUDA/cuda-gpu-managed.cuf
@@ -1,4 +1,4 @@
-! RUN: bbc -emit-hlfir -fcuda -gpu=mem:managed %s -o - | FileCheck %s
+! RUN: bbc -emit-hlfir -fcuda -gpu=managed %s -o - | FileCheck %s
! Test -gpu=managed flag: allocatable arrays without explicit CUDA attributes
! should be implicitly treated as managed.
diff --git a/flang/tools/bbc/bbc.cpp b/flang/tools/bbc/bbc.cpp
index aefb4369fc761..0b87dd634af1e 100644
--- a/flang/tools/bbc/bbc.cpp
+++ b/flang/tools/bbc/bbc.cpp
@@ -638,11 +638,10 @@ int main(int argc, char **argv) {
Fortran::common::LanguageFeature::CudaWarpMatchFunction, false);
}
- if (enableGPUMode == "managed" || enableGPUMode == "mem:managed") {
+ if (enableGPUMode == "managed")
options.features.Enable(Fortran::common::LanguageFeature::CudaManaged);
- } else if (enableGPUMode == "unified" || enableGPUMode == "mem:unified") {
+ else if (enableGPUMode == "unified")
options.features.Enable(Fortran::common::LanguageFeature::CudaUnified);
- }
if (fixedForm) {
options.isFixedForm = fixedForm;
``````````
</details>
https://github.com/llvm/llvm-project/pull/175803
More information about the flang-commits
mailing list