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
22 changes: 11 additions & 11 deletions third_party/intel/lib/Analysis/AxisInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ class BinaryOpVisitorImpl : public AxisInfoVisitorImpl<OpTy> {
AxisInfo
getAxisInfo(OpTy op,
ArrayRef<const dataflow::Lattice<AxisInfo> *> operands) override {
auto lhsInfo = operands[0]->getValue();
auto rhsInfo = operands[1]->getValue();
const auto &lhsInfo = operands[0]->getValue();
const auto &rhsInfo = operands[1]->getValue();
auto rank = lhsInfo.getRank();
assert(operands.size() == 2 && "Expected two operands");
AxisInfo::DimVectorT contiguity;
Expand Down Expand Up @@ -658,8 +658,8 @@ class CmpOpAxisInfoVisitor final : public AxisInfoVisitorImpl<OpTy> {
return AxisInfo();
auto shape = resTy.getShape();
short rank = resTy.getRank();
auto lhsInfo = operands[0]->getValue();
auto rhsInfo = operands[1]->getValue();
const auto &lhsInfo = operands[0]->getValue();
const auto &rhsInfo = operands[1]->getValue();

AxisInfo::DimVectorT contiguity, divisibility, constancy;
std::optional<int64_t> constantValue;
Expand Down Expand Up @@ -782,8 +782,8 @@ class SelectOpAxisInfoVisitor final : public AxisInfoVisitorImpl<OpTy> {
getAxisInfo(OpTy op,
ArrayRef<const dataflow::Lattice<AxisInfo> *> operands) override {
auto condConstancy = operands[0]->getValue().getConstancy();
auto lhsInfo = operands[1]->getValue();
auto rhsInfo = operands[2]->getValue();
const auto &lhsInfo = operands[1]->getValue();
const auto &rhsInfo = operands[2]->getValue();
auto rank = lhsInfo.getRank();

AxisInfo::DimVectorT contiguity, divisibility, constancy;
Expand Down Expand Up @@ -967,8 +967,8 @@ class MaxMinOpAxisInfoVisitor final : public AxisInfoVisitorImpl<OpTy> {
AxisInfo
getAxisInfo(OpTy op,
ArrayRef<const dataflow::Lattice<AxisInfo> *> operands) override {
auto lhsInfo = operands[0]->getValue();
auto rhsInfo = operands[1]->getValue();
const auto &lhsInfo = operands[0]->getValue();
const auto &rhsInfo = operands[1]->getValue();
auto rank = lhsInfo.getRank();
std::optional<int64_t> constantValue;
if (lhsInfo.getConstantValue().has_value() &&
Expand Down Expand Up @@ -1140,8 +1140,8 @@ LogicalResult AxisInfoAnalysis::visitOperation(

void AxisInfoAnalysis::visitForOpInductionVar(
scf::ForOp op, ArrayRef<dataflow::Lattice<AxisInfo> *> argLattices) {
auto lb = getLatticeElementFor(op, op.getLowerBound())->getValue();
auto step = getLatticeElementFor(op, op.getStep())->getValue();
const auto &lb = getLatticeElementFor(op, op.getLowerBound())->getValue();
const auto &step = getLatticeElementFor(op, op.getStep())->getValue();

AxisInfo::DimVectorT knownContiguity(1, 1);
AxisInfo::DimVectorT knownDivisibility(1, 1);
Expand Down Expand Up @@ -1337,7 +1337,7 @@ void ModuleAxisInfoAnalysis::initialize(FunctionOpInterface funcOp) {
return;
auto *axisInfoMap = getFuncData(funcOp);
auto updateAxisInfoMap = [&](Value value) {
auto axisInfo = analysis->getLatticeElement(value)->getValue();
const auto &axisInfo = analysis->getLatticeElement(value)->getValue();
AxisInfo curAxisInfo;
if (axisInfoMap->count(value)) {
curAxisInfo = AxisInfo::join(axisInfo, axisInfoMap->lookup(value));
Expand Down