Skip to content

Commit

Permalink
test(compiler): Ensure that ForLoopToParallelPass does not trigger fo…
Browse files Browse the repository at this point in the history
…r scf.for with parallel = false

This ensures that the regression fixed by
3cd3dff is not reintroduced, which
caused the compiler to abort in `ForLoopToParallelPass` for `scf.for`
loops with iteration arguments, even if these were marked with the
attribute `parallel` set to `false`.
  • Loading branch information
andidr authored and BourgerieQuentin committed Jul 30, 2024
1 parent bda9199 commit 9b034d9
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: concretecompiler --split-input-file --action=dump-std --parallelize --parallelize-loops --skip-program-info --passes=for-loop-to-parallel --skip-program-info %s 2>&1| FileCheck %s

func.func @bar() -> () {
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c4 = arith.constant 4 : index
%i0 = arith.constant 0 : i32
%i1 = arith.constant 1 : i32

// CHECK-NOT: scf.parallel
%0 = scf.for %iv = %c0 to %c4 step %c1 iter_args(%ia = %i0) -> i32 {
"Tracing.trace_plaintext"(%i0) : (i32) -> ()
%yld = arith.addi %ia, %i1 : i32
scf.yield %yld : i32
} {"parallel" = false }

return
}

0 comments on commit 9b034d9

Please sign in to comment.