mirror of https://github.com/llvm/circt.git
86 lines
2.5 KiB
MLIR
86 lines
2.5 KiB
MLIR
// NOTE: Assertions have been autogenerated by utils/update_mlir_test_checks.py
|
|
// RUN: circt-opt -handshake-insert-buffers=strategy=all %s | circt-opt -handshake-insert-buffers=strategy=all | FileCheck %s -check-prefix=CHECK
|
|
module {
|
|
handshake.func @simple_loop(%arg0: none, ...) -> none {
|
|
// CHECK: buffer
|
|
%0 = br %arg0 : none
|
|
// CHECK: buffer
|
|
%1:2 = control_merge %0 : none, index
|
|
// CHECK: buffer
|
|
%2:3 = fork [3] %1#0 : none
|
|
// CHECK: buffer
|
|
sink %1#1 : index
|
|
// CHECK: buffer
|
|
%3 = constant %2#1 {value = 1 : index} : index
|
|
// CHECK: buffer
|
|
%4 = constant %2#0 {value = 42 : index} : index
|
|
// CHECK: buffer
|
|
%5 = br %2#2 : none
|
|
// CHECK: buffer
|
|
%6 = br %3 : index
|
|
// CHECK: buffer
|
|
%7 = br %4 : index
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
%8 = mux %11#1 [%22, %7] : index, index
|
|
// CHECK: buffer
|
|
%9:2 = fork [2] %8 : index
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
%10:2 = control_merge %23, %5 : none, index
|
|
// CHECK: buffer
|
|
%11:2 = fork [2] %10#1 : index
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
%12 = mux %9#0 [%24, %6] : index, index
|
|
// CHECK: buffer
|
|
%13:2 = fork [2] %12 : index
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
%14 = arith.cmpi slt, %13#1, %9#1 : index
|
|
// CHECK: buffer
|
|
%15:3 = fork [3] %14 : i1
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
%trueResult, %falseResult = cond_br %15#2, %9#0 : index
|
|
// CHECK: buffer
|
|
sink %falseResult : index
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
%trueResult_0, %falseResult_1 = cond_br %15#1, %10#0 : none
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
%trueResult_2, %falseResult_3 = cond_br %15#0, %13#0 : index
|
|
// CHECK: buffer
|
|
sink %falseResult_3 : index
|
|
// CHECK: buffer
|
|
%16 = merge %trueResult_2 : index
|
|
// CHECK: buffer
|
|
%17 = merge %trueResult : index
|
|
// CHECK: buffer
|
|
%18:2 = control_merge %trueResult_0 : none, index
|
|
// CHECK: buffer
|
|
%19:2 = fork [2] %18#0 : none
|
|
// CHECK: buffer
|
|
sink %18#1 : index
|
|
// CHECK: buffer
|
|
%20 = constant %19#0 {value = 1 : index} : index
|
|
// CHECK: buffer
|
|
// CHECK: buffer
|
|
%21 = arith.addi %16, %20 : index
|
|
// CHECK: buffer
|
|
%22 = br %17 : index
|
|
// CHECK: buffer
|
|
%23 = br %19#1 : none
|
|
// CHECK: buffer
|
|
%24 = br %21 : index
|
|
// CHECK: buffer
|
|
%25:2 = control_merge %falseResult_1 : none, index
|
|
// CHECK: buffer
|
|
sink %25#1 : index
|
|
return %25#0 : none
|
|
}
|
|
}
|