Skip to content
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