diff --git a/circom/tests/subcmps/subcmps3.circom b/circom/tests/subcmps/subcmps3.circom index 29607be83..ef16fa6e9 100644 --- a/circom/tests/subcmps/subcmps3.circom +++ b/circom/tests/subcmps/subcmps3.circom @@ -1,6 +1,7 @@ pragma circom 2.0.0; // REQUIRES: circom // RUN: rm -rf %t && mkdir %t && %circom --llvm -o %t %s | sed -n 's/.*Written successfully:.* \(.*\)/\1/p' | xargs cat | FileCheck %s --enable-var-scope +// XFAIL: .* // pending https://veridise.atlassian.net/browse/VAN-798 template Sum(n) { signal input inp[n]; @@ -31,32 +32,32 @@ template SubCmps3() { component main = SubCmps3(); -//COM:CHECK-LABEL: define{{.*}} void @..generated..loop.body.{{[0-9]+}}([0 x i256]* %lvars, [0 x i256]* %signals, -//COM:CHECK-SAME: i256* %fix_[[X1:[0-9]+]]){{.*}} { -//COM:CHECK-NEXT: ..generated..loop.body.[[$F_ID_1:[0-9]+]]: -//COM:CHECK-NEXT: br label %store1 -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: store1: -//COM:CHECK-NEXT: %0 = getelementptr [0 x i256], [0 x i256]* %lvars, i32 0, i32 1 -//COM:CHECK-NEXT: %1 = load i256, i256* %0, align 4 -//COM:CHECK-NEXT: %2 = getelementptr i256, i256* %fix_[[X1]], i32 0 -//COM:CHECK-NEXT: %3 = load i256, i256* %2, align 4 -//COM:CHECK-NEXT: %call.fr_add = call i256 @fr_add(i256 %1, i256 %3) -//COM:CHECK-NEXT: %4 = getelementptr [0 x i256], [0 x i256]* %lvars, i32 0, i32 1 -//COM:CHECK-NEXT: store i256 %call.fr_add, i256* %4, align 4 -//COM:CHECK-NEXT: br label %store2 -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: store2: -//COM:CHECK-NEXT: %5 = getelementptr [0 x i256], [0 x i256]* %lvars, i32 0, i32 2 -//COM:CHECK-NEXT: %6 = load i256, i256* %5, align 4 -//COM:CHECK-NEXT: %call.fr_add1 = call i256 @fr_add(i256 %6, i256 1) -//COM:CHECK-NEXT: %7 = getelementptr [0 x i256], [0 x i256]* %lvars, i32 0, i32 2 -//COM:CHECK-NEXT: store i256 %call.fr_add1, i256* %7, align 4 -//COM:CHECK-NEXT: br label %return3 -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: return3: -//COM:CHECK-NEXT: ret void -//COM:CHECK-NEXT: } +//CHECK-LABEL: define{{.*}} void @..generated..loop.body.{{[0-9]+}}([0 x i256]* %lvars, [0 x i256]* %signals, +//CHECK-SAME: i256* %fix_[[X1:[0-9]+]]){{.*}} { +//CHECK-NEXT: ..generated..loop.body.[[$F_ID_1:[0-9]+]]: +//CHECK-NEXT: br label %store1 +//CHECK-EMPTY: +//CHECK-NEXT: store1: +//CHECK-NEXT: %0 = getelementptr [0 x i256], [0 x i256]* %lvars, i32 0, i32 1 +//CHECK-NEXT: %1 = load i256, i256* %0, align 4 +//CHECK-NEXT: %2 = getelementptr i256, i256* %fix_[[X1]], i32 0 +//CHECK-NEXT: %3 = load i256, i256* %2, align 4 +//CHECK-NEXT: %call.fr_add = call i256 @fr_add(i256 %1, i256 %3) +//CHECK-NEXT: %4 = getelementptr [0 x i256], [0 x i256]* %lvars, i32 0, i32 1 +//CHECK-NEXT: store i256 %call.fr_add, i256* %4, align 4 +//CHECK-NEXT: br label %store2 +//CHECK-EMPTY: +//CHECK-NEXT: store2: +//CHECK-NEXT: %5 = getelementptr [0 x i256], [0 x i256]* %lvars, i32 0, i32 2 +//CHECK-NEXT: %6 = load i256, i256* %5, align 4 +//CHECK-NEXT: %call.fr_add1 = call i256 @fr_add(i256 %6, i256 1) +//CHECK-NEXT: %7 = getelementptr [0 x i256], [0 x i256]* %lvars, i32 0, i32 2 +//CHECK-NEXT: store i256 %call.fr_add1, i256* %7, align 4 +//CHECK-NEXT: br label %return3 +//CHECK-EMPTY: +//CHECK-NEXT: return3: +//CHECK-NEXT: ret void +//CHECK-NEXT: } // //CHECK-LABEL: define{{.*}} void @..generated..loop.body.{{[0-9]+\.F}}([0 x i256]* %lvars, [0 x i256]* %signals, //CHECK-SAME: i256* %fix_[[X1:[0-9]+]], i256* %fix_[[X2:[0-9]+]], i256* %fix_[[X3:[0-9]+]]){{.*}} { @@ -125,55 +126,55 @@ component main = SubCmps3(); //CHECK-NEXT: ret void //CHECK-NEXT: } // -//COM:CHECK-LABEL: define{{.*}} void @Sum_0_run([0 x i256]* %0){{.*}} { -//COM:CHECK-NEXT: prelude: -//COM:CHECK-NEXT: %lvars = alloca [3 x i256], align 8 -//COM:CHECK-NEXT: %subcmps = alloca [0 x { [0 x i256]*, i32 }], align 8 -//COM:CHECK-NEXT: br label %store1 -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: store1: -//COM:CHECK-NEXT: %1 = getelementptr [3 x i256], [3 x i256]* %lvars, i32 0, i32 0 -//COM:CHECK-NEXT: store i256 4, i256* %1, align 4 -//COM:CHECK-NEXT: br label %store2 -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: store2: -//COM:CHECK-NEXT: %2 = getelementptr [3 x i256], [3 x i256]* %lvars, i32 0, i32 1 -//COM:CHECK-NEXT: store i256 0, i256* %2, align 4 -//COM:CHECK-NEXT: br label %store3 -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: store3: -//COM:CHECK-NEXT: %3 = getelementptr [3 x i256], [3 x i256]* %lvars, i32 0, i32 2 -//COM:CHECK-NEXT: store i256 0, i256* %3, align 4 -//COM:CHECK-NEXT: br label %unrolled_loop4 -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: unrolled_loop4: -//COM:CHECK-NEXT: %4 = bitcast [3 x i256]* %lvars to [0 x i256]* -//COM:CHECK-NEXT: %5 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i256 1 -//COM:CHECK-NEXT: call void @..generated..loop.body.[[$F_ID_1]]([0 x i256]* %4, [0 x i256]* %0, i256* %5) -//COM:CHECK-NEXT: %6 = bitcast [3 x i256]* %lvars to [0 x i256]* -//COM:CHECK-NEXT: %7 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i256 2 -//COM:CHECK-NEXT: call void @..generated..loop.body.[[$F_ID_1]]([0 x i256]* %6, [0 x i256]* %0, i256* %7) -//COM:CHECK-NEXT: %8 = bitcast [3 x i256]* %lvars to [0 x i256]* -//COM:CHECK-NEXT: %9 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i256 3 -//COM:CHECK-NEXT: call void @..generated..loop.body.[[$F_ID_1]]([0 x i256]* %8, [0 x i256]* %0, i256* %9) -//COM:CHECK-NEXT: %10 = bitcast [3 x i256]* %lvars to [0 x i256]* -//COM:CHECK-NEXT: %11 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i256 4 -//COM:CHECK-NEXT: call void @..generated..loop.body.[[$F_ID_1]]([0 x i256]* %10, [0 x i256]* %0, i256* %11) -//COM:CHECK-NEXT: br label %store5 -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: store5: -//COM:CHECK-NEXT: %12 = getelementptr [3 x i256], [3 x i256]* %lvars, i32 0, i32 1 -//COM:CHECK-NEXT: %13 = load i256, i256* %12, align 4 -//COM:CHECK-NEXT: %14 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i32 0 -//COM:CHECK-NEXT: store i256 %13, i256* %14, align 4 -//COM:CHECK-NEXT: %15 = load i256, i256* %14, align 4 -//COM:CHECK-NEXT: %constraint = alloca i1, align 1 -//COM:CHECK-NEXT: call void @__constraint_values(i256 %13, i256 %15, i1* %constraint) -//COM:CHECK-NEXT: br label %prologue -//COM:CHECK-EMPTY: -//COM:CHECK-NEXT: prologue: -//COM:CHECK-NEXT: ret void -//COM:CHECK-NEXT: } +//CHECK-LABEL: define{{.*}} void @Sum_0_run([0 x i256]* %0){{.*}} { +//CHECK-NEXT: prelude: +//CHECK-NEXT: %lvars = alloca [3 x i256], align 8 +//CHECK-NEXT: %subcmps = alloca [0 x { [0 x i256]*, i32 }], align 8 +//CHECK-NEXT: br label %store1 +//CHECK-EMPTY: +//CHECK-NEXT: store1: +//CHECK-NEXT: %1 = getelementptr [3 x i256], [3 x i256]* %lvars, i32 0, i32 0 +//CHECK-NEXT: store i256 4, i256* %1, align 4 +//CHECK-NEXT: br label %store2 +//CHECK-EMPTY: +//CHECK-NEXT: store2: +//CHECK-NEXT: %2 = getelementptr [3 x i256], [3 x i256]* %lvars, i32 0, i32 1 +//CHECK-NEXT: store i256 0, i256* %2, align 4 +//CHECK-NEXT: br label %store3 +//CHECK-EMPTY: +//CHECK-NEXT: store3: +//CHECK-NEXT: %3 = getelementptr [3 x i256], [3 x i256]* %lvars, i32 0, i32 2 +//CHECK-NEXT: store i256 0, i256* %3, align 4 +//CHECK-NEXT: br label %unrolled_loop4 +//CHECK-EMPTY: +//CHECK-NEXT: unrolled_loop4: +//CHECK-NEXT: %4 = bitcast [3 x i256]* %lvars to [0 x i256]* +//CHECK-NEXT: %5 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i256 1 +//CHECK-NEXT: call void @..generated..loop.body.[[$F_ID_1]]([0 x i256]* %4, [0 x i256]* %0, i256* %5) +//CHECK-NEXT: %6 = bitcast [3 x i256]* %lvars to [0 x i256]* +//CHECK-NEXT: %7 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i256 2 +//CHECK-NEXT: call void @..generated..loop.body.[[$F_ID_1]]([0 x i256]* %6, [0 x i256]* %0, i256* %7) +//CHECK-NEXT: %8 = bitcast [3 x i256]* %lvars to [0 x i256]* +//CHECK-NEXT: %9 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i256 3 +//CHECK-NEXT: call void @..generated..loop.body.[[$F_ID_1]]([0 x i256]* %8, [0 x i256]* %0, i256* %9) +//CHECK-NEXT: %10 = bitcast [3 x i256]* %lvars to [0 x i256]* +//CHECK-NEXT: %11 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i256 4 +//CHECK-NEXT: call void @..generated..loop.body.[[$F_ID_1]]([0 x i256]* %10, [0 x i256]* %0, i256* %11) +//CHECK-NEXT: br label %store5 +//CHECK-EMPTY: +//CHECK-NEXT: store5: +//CHECK-NEXT: %12 = getelementptr [3 x i256], [3 x i256]* %lvars, i32 0, i32 1 +//CHECK-NEXT: %13 = load i256, i256* %12, align 4 +//CHECK-NEXT: %14 = getelementptr [0 x i256], [0 x i256]* %0, i32 0, i32 0 +//CHECK-NEXT: store i256 %13, i256* %14, align 4 +//CHECK-NEXT: %15 = load i256, i256* %14, align 4 +//CHECK-NEXT: %constraint = alloca i1, align 1 +//CHECK-NEXT: call void @__constraint_values(i256 %13, i256 %15, i1* %constraint) +//CHECK-NEXT: br label %prologue +//CHECK-EMPTY: +//CHECK-NEXT: prologue: +//CHECK-NEXT: ret void +//CHECK-NEXT: } // //CHECK-LABEL: define{{.*}} void @SubCmps3_1_run([0 x i256]* %0){{.*}} { //CHECK-NEXT: prelude: