[Mlir-commits] [mlir] [mlir][affine] Remove redundant check in LoopAnalysis (PR #75950)

Rik Huijzer llvmlistbot at llvm.org
Wed Dec 20 02:40:38 PST 2023


rikhuijzer wrote:

> We do not support vectorization across conditionals. We already check it in the beginning of isVectorizableLoopBodyWithOpCond(). There should be no need to check AffineIfOp when checking regions in a loop.

Because at line 277:
```cpp
auto conditionals = matcher::If();
  SmallVector<NestedMatch, 8> conditionalsMatched;
  conditionals.match(forOp, &conditionalsMatched);
  if (!conditionalsMatched.empty()) {
    return false;
  }
```
the if-case is already handled?

In general I do see the point of this PR but I'm also a bit hesitant with approving it. The main risk I see is that this PR changes the line, but then the code before that is changed later and we possibly end up with a bug which then means that this PR has to be reverted. In other words, this PR makes the code less robust. If there is an elegant way to simplify the checks while keeping robust code, then I think that I could probably approve that.

https://github.com/llvm/llvm-project/pull/75950


More information about the Mlir-commits mailing list