[ANALYSIS] initializing operand axisinfo state (if necessary) before visiting operation (#1259)

Feels very wrong, and probably not the right way to do this. But
otherwise `scf.if` doesn't get initialized since the merge to llvm-head.
Suggestions are welcome 😅
This commit is contained in:
Philippe Tillet
2023-02-27 19:32:19 -08:00
committed by GitHub
parent 5376fe9443
commit f8c92c3d17

View File

@@ -846,10 +846,14 @@ AxisInfoAnalysis::AxisInfoAnalysis(DataFlowSolver &solver)
void AxisInfoAnalysis::visitOperation(
Operation *op, ArrayRef<const dataflow::Lattice<AxisInfo> *> operands,
ArrayRef<dataflow::Lattice<AxisInfo> *> results) {
// TODO: For sure not the right way to do this
// but why is scf.if not initialized otherwise?
for (auto op : operands)
if (op->getValue().getRank() == 0)
setToEntryState((dataflow::Lattice<AxisInfo> *)op);
AxisInfo curr = visitors.apply(op, operands);
if (curr.getRank() == 0) {
if (curr.getRank() == 0)
return setAllToEntryStates(results);
}
// override with hint
auto newContiguity = curr.getContiguity();
auto newDivisibility = curr.getDivisibility();