Skip to content

Commit 3174c94

Browse files
authored
Revert "[flang][cuda] Preserve fir.rebox captured by cuf.kernel in SimplifyArrayCoorOp" (#193855)
Reverts #193837
1 parent 9473873 commit 3174c94

3 files changed

Lines changed: 0 additions & 78 deletions

File tree

flang/lib/Optimizer/Dialect/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ add_flang_library(FIRDialect
2020
FIROpsIncGen
2121
FIRSafeTempArrayCopyAttrInterfaceIncGen
2222
CUFAttrsIncGen
23-
CUFOpsIncGen
2423
intrinsics_gen
2524

2625
LINK_LIBS

flang/lib/Optimizer/Dialect/FIROps.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "flang/Optimizer/Dialect/FIROps.h"
14-
#include "flang/Optimizer/Dialect/CUF/CUFOps.h"
1514
#include "flang/Optimizer/Dialect/FIRAttr.h"
1615
#include "flang/Optimizer/Dialect/FIRDialect.h"
1716
#include "flang/Optimizer/Dialect/FIROpsSupport.h"
@@ -588,15 +587,6 @@ struct SimplifyArrayCoorOp : public mlir::OpRewritePattern<fir::ArrayCoorOp> {
588587
return mlir::isa<ACC_DATA_ENTRY_OPS>(u);
589588
}))
590589
return mlir::failure();
591-
// Don't pull in rebox defined outside a cuf.kernel when the array_coor
592-
// is inside that kernel. CUF codegen converts such a rebox into a
593-
// managed-memory descriptor (via _FortranACUFAllocDescriptor) that the
594-
// kernel needs to receive as its argument; folding the rebox away would
595-
// leave the kernel capturing the host-side descriptor directly, causing
596-
// illegal device dereferences at runtime.
597-
if (auto kernel = op->getParentOfType<cuf::KernelOp>())
598-
if (reboxOp->getParentOfType<cuf::KernelOp>() != kernel)
599-
return mlir::failure();
600590
boxedMemref = reboxOp.getBox();
601591
boxedShape = reboxOp.getShape();
602592
// Avoid pulling in rebox that performs reshaping.

flang/test/Fir/array-coor-canonicalization-cuf.fir

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)