[flang-commits] [flang] [flang][cuda][NFC] Remove shared alloc addr space (PR #128535)

via flang-commits flang-commits at lists.llvm.org
Mon Feb 24 08:42:00 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-fir-hlfir

Author: Valentin Clement (バレンタイン クレメン) (clementval)

<details>
<summary>Changes</summary>

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. 

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


2 Files Affected:

- (modified) flang/lib/Optimizer/Builder/IntrinsicCall.cpp (-1) 
- (modified) flang/lib/Optimizer/CodeGen/CodeGen.cpp (-6) 


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

``````````

</details>


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


More information about the flang-commits mailing list