mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
[OPTIMIZER][BACKEND] switch the TritonGPU dialect to use MLIR Properties (NFC) (#1696)
Also try to switch APIs access to the new upstream APIs that separate explicitly the access to "discardable" and "inherent" attributes (the latter being stored in properties now). Generic accessors like `getAttr()` `setAttr()` `setAttrs()` are much more expensive and to be avoided.
This commit is contained in:
@@ -111,15 +111,15 @@ AxisInfo AxisInfo::getPessimisticValueState(Value value) {
|
||||
}
|
||||
}
|
||||
} else if (Operation *op = value.getDefiningOp()) {
|
||||
if (Attribute attr = op->getAttr("tt.divisibility")) {
|
||||
if (Attribute attr = op->getDiscardableAttr("tt.divisibility")) {
|
||||
auto vals = attr.cast<DenseElementsAttr>().getValues<int>();
|
||||
knownDivisibility = DimVectorT(vals.begin(), vals.end());
|
||||
}
|
||||
if (Attribute attr = op->getAttr("tt.contiguity")) {
|
||||
if (Attribute attr = op->getDiscardableAttr("tt.contiguity")) {
|
||||
auto vals = attr.cast<DenseElementsAttr>().getValues<int>();
|
||||
knownContiguity = DimVectorT(vals.begin(), vals.end());
|
||||
}
|
||||
if (Attribute attr = op->getAttr("tt.constancy")) {
|
||||
if (Attribute attr = op->getDiscardableAttr("tt.constancy")) {
|
||||
auto vals = attr.cast<DenseElementsAttr>().getValues<int>();
|
||||
knownConstancy = DimVectorT(vals.begin(), vals.end());
|
||||
}
|
||||
@@ -888,15 +888,15 @@ void AxisInfoAnalysis::visitOperation(
|
||||
auto newContiguity = curr.getContiguity();
|
||||
auto newDivisibility = curr.getDivisibility();
|
||||
auto newConstancy = curr.getConstancy();
|
||||
if (Attribute attr = op->getAttr("tt.contiguity")) {
|
||||
if (Attribute attr = op->getDiscardableAttr("tt.contiguity")) {
|
||||
auto vals = attr.cast<DenseElementsAttr>().getValues<int>();
|
||||
newContiguity = AxisInfo::DimVectorT(vals.begin(), vals.end());
|
||||
}
|
||||
if (Attribute attr = op->getAttr("tt.divisibility")) {
|
||||
if (Attribute attr = op->getDiscardableAttr("tt.divisibility")) {
|
||||
auto vals = attr.cast<DenseElementsAttr>().getValues<int>();
|
||||
newDivisibility = AxisInfo::DimVectorT(vals.begin(), vals.end());
|
||||
}
|
||||
if (Attribute attr = op->getAttr("tt.constancy")) {
|
||||
if (Attribute attr = op->getDiscardableAttr("tt.constancy")) {
|
||||
auto vals = attr.cast<DenseElementsAttr>().getValues<int>();
|
||||
newConstancy = AxisInfo::DimVectorT(vals.begin(), vals.end());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user