Skip to content

Commit 493b72a

Browse files
author
Razvan Lupusoru
committed
Remove symbol table lookup
1 parent 2d4e9ba commit 493b72a

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,9 @@ def OpenACC_PrivateRecipeOp
13231323
/// PointerLikeType interface. If a type implements both, the MappableType
13241324
/// API will be preferred. Returns std::nullopt if the recipe cannot be
13251325
/// created or populated. The builder's current insertion point will be used
1326-
/// and it must be a valid place for this operation to be inserted.
1326+
/// and it must be a valid place for this operation to be inserted. The
1327+
/// `recipeName` must be a unique name to prevent "redefinition of symbol"
1328+
/// IR errors.
13271329
static std::optional<PrivateRecipeOp> createAndPopulate(
13281330
::mlir::OpBuilder &builder,
13291331
::mlir::Location loc,
@@ -1433,7 +1435,9 @@ def OpenACC_FirstprivateRecipeOp
14331435
/// PointerLikeType interface. If a type implements both, the MappableType
14341436
/// API will be preferred. Returns std::nullopt if the recipe cannot be
14351437
/// created or populated. The builder's current insertion point will be used
1436-
/// and it must be a valid place for this operation to be inserted.
1438+
/// and it must be a valid place for this operation to be inserted. The
1439+
/// `recipeName` must be a unique name to prevent "redefinition of symbol"
1440+
/// IR errors.
14371441
static std::optional<FirstprivateRecipeOp> createAndPopulate(
14381442
::mlir::OpBuilder &builder,
14391443
::mlir::Location loc,

mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,15 +1201,6 @@ std::optional<PrivateRecipeOp>
12011201
PrivateRecipeOp::createAndPopulate(OpBuilder &builder, Location loc,
12021202
StringRef recipeName, Type varType,
12031203
StringRef varName, ValueRange bounds) {
1204-
1205-
// Check if a symbol with this name already exists in the symbol table.
1206-
// If it does - don't assume that we can just reuse the existing one.
1207-
Operation *parentOp = builder.getInsertionBlock()->getParentOp();
1208-
if (parentOp &&
1209-
SymbolTable::lookupNearestSymbolFrom(
1210-
parentOp, mlir::StringAttr::get(builder.getContext(), varName)))
1211-
return std::nullopt;
1212-
12131204
// First, validate that we can handle this variable type
12141205
bool isMappable = isa<MappableType>(varType);
12151206
bool isPointerLike = isa<PointerLikeType>(varType);
@@ -1289,15 +1280,6 @@ std::optional<FirstprivateRecipeOp>
12891280
FirstprivateRecipeOp::createAndPopulate(OpBuilder &builder, Location loc,
12901281
StringRef recipeName, Type varType,
12911282
StringRef varName, ValueRange bounds) {
1292-
1293-
// Check if a symbol with this name already exists in the symbol table.
1294-
// If it does - don't assume that we can just reuse the existing one.
1295-
Operation *parentOp = builder.getInsertionBlock()->getParentOp();
1296-
if (parentOp &&
1297-
SymbolTable::lookupNearestSymbolFrom(
1298-
parentOp, mlir::StringAttr::get(builder.getContext(), varName)))
1299-
return std::nullopt;
1300-
13011283
// First, validate that we can handle this variable type
13021284
bool isMappable = isa<MappableType>(varType);
13031285
bool isPointerLike = isa<PointerLikeType>(varType);

0 commit comments

Comments
 (0)