[flang-commits] [flang] [flang][cuda][NFC] Remove shared alloc addr space (PR #128535)
Valentin Clement バレンタイン クレメン via flang-commits
flang-commits at lists.llvm.org
Mon Feb 24 08:41:27 PST 2025
https://github.com/clementval created https://github.com/llvm/llvm-project/pull/128535
This was not intended to go upstream and actually does not work with the NVPTX lowering. The address space for alloca can only be generic or local.
This was pushed upstream with https://github.com/llvm/llvm-project/commit/726c4b9f77862d83b6e5e16c8d5a2fc4fb1589a2 that was not related to address space.
>From 612328bae3008f665a075c1d0a7fc72318f2bb16 Mon Sep 17 00:00:00 2001
From: Valentin Clement <clementval at gmail.com>
Date: Mon, 24 Feb 2025 08:40:06 -0800
Subject: [PATCH] [flang][cuda][NFC] Remove shared alloc addr space
---
flang/lib/Optimizer/Builder/IntrinsicCall.cpp | 1 -
flang/lib/Optimizer/CodeGen/CodeGen.cpp | 6 ------
2 files changed, 7 deletions(-)
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index 28fbe83defb61..a5bc762e17c06 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -2728,7 +2728,6 @@ mlir::Value IntrinsicLibrary::genAtomicOr(mlir::Type resultType,
mlir::Value IntrinsicLibrary::genAtomicCas(mlir::Type resultType,
llvm::ArrayRef<mlir::Value> args) {
assert(args.size() == 3);
- assert(args[1].getType() == args[2].getType());
auto successOrdering = mlir::LLVM::AtomicOrdering::acq_rel;
auto failureOrdering = mlir::LLVM::AtomicOrdering::monotonic;
auto llvmPtrTy = mlir::LLVM::LLVMPointerType::get(resultType.getContext());
diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index bd87215eeb179..d5dadac00a47a 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -292,12 +292,6 @@ struct AllocaOpConversion : public fir::FIROpConversion<fir::AllocaOp> {
rewriter.setInsertionPointAfter(size.getDefiningOp());
}
- if (auto dataAttr = alloc->getAttrOfType<cuf::DataAttributeAttr>(
- cuf::getDataAttrName())) {
- if (dataAttr.getValue() == cuf::DataAttribute::Shared)
- allocaAs = 3;
- }
-
// NOTE: we used to pass alloc->getAttrs() in the builder for non opaque
// pointers! Only propagate pinned and bindc_name to help debugging, but
// this should have no functional purpose (and passing the operand segment
More information about the flang-commits
mailing list