Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compiler): Convert scf.for to scf.parallel only if parallel attri…
…bute is true The pattern converting `scf.for` operations to `scf.parallel` operations from `lib/Transforms/ForLoopToParallel.cpp` contains an assertion that ensures that the source operation does not have any iteration arguments in order to keep the conversion as simple as possible. However, if the attribute `parallel` of the source operation is `false`, the operation is replaced with an identical clone and the conversion could be treated as a no-op. This change modifies the pattern, such that it simply fails if `parallel` is `false`, making the check for the absence of iteration arguments unnecessary and avoiding unnecessary bailouts by the compiler.
- Loading branch information