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

Hsiangkai Wang llvmlistbot at llvm.org
Thu Jan 4 02:46:30 PST 2024


Hsiangkai 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:
> 
> ```c++
> 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.

I got your point. Thanks for your comment. Let's keep it as it is.

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


More information about the Mlir-commits mailing list