Skip to content

[mlir][acc] Remove declare attribute verification #137676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2910,32 +2910,6 @@ checkDeclareOperands(Op &op, const mlir::ValueRange &operands,
assert(dataClauseOptional.has_value() &&
"declare operands can only be data entry operations which must have "
"dataClause");

// If varPtr has no defining op - there is nothing to check further.
if (!var.getDefiningOp())
continue;

// Check that the varPtr has a declare attribute.
auto declareAttribute{
var.getDefiningOp()->getAttr(mlir::acc::getDeclareAttrName())};
if (!declareAttribute)
return op.emitError(
"expect declare attribute on variable in declare operation");

auto declAttr = mlir::cast<mlir::acc::DeclareAttr>(declareAttribute);
if (declAttr.getDataClause().getValue() != dataClauseOptional.value())
return op.emitError(
"expect matching declare attribute on variable in declare operation");

// If the variable is marked with implicit attribute, the matching declare
// data action must also be marked implicit. The reverse is not checked
// since implicit data action may be inserted to do actions like updating
// device copy, in which case the variable is not necessarily implicitly
// declare'd.
if (declAttr.getImplicit() &&
declAttr.getImplicit() != acc::getImplicitFlag(operand.getDefiningOp()))
return op.emitError(
"implicitness must match between declare op and flag on variable");
}

return success();
Expand Down