diff --git a/circom/tests/subcmps/subcmps0A.circom b/circom/tests/subcmps/subcmps0A.circom index 80e497bc3..85b66d0e2 100644 --- a/circom/tests/subcmps/subcmps0A.circom +++ b/circom/tests/subcmps/subcmps0A.circom @@ -45,7 +45,6 @@ component main = SubCmps0A(2); //CHECK-NEXT: br label %fold_true3 //CHECK-EMPTY: //CHECK-NEXT: fold_true3: -//CHECK-NEXT: call void @llvm.donothing() //CHECK-NEXT: call void @IsZero_0_run([0 x i256]* %sub_[[X4]]) //CHECK-NEXT: br label %store4 //CHECK-EMPTY: diff --git a/circom/tests/subcmps/subcmps0B.circom b/circom/tests/subcmps/subcmps0B.circom index c73f889ab..dde20729a 100644 --- a/circom/tests/subcmps/subcmps0B.circom +++ b/circom/tests/subcmps/subcmps0B.circom @@ -46,7 +46,6 @@ component main = SubCmps0B(2); //CHECK-NEXT: br label %fold_true3 //CHECK-EMPTY: //CHECK-NEXT: fold_true3: -//CHECK-NEXT: call void @llvm.donothing() //CHECK-NEXT: call void @IsZero_0_run([0 x i256]* %sub_[[X5]]) //CHECK-NEXT: br label %store4 //CHECK-EMPTY: diff --git a/circom/tests/subcmps/subcmps0C.circom b/circom/tests/subcmps/subcmps0C.circom index ecf098e96..18fdacac1 100644 --- a/circom/tests/subcmps/subcmps0C.circom +++ b/circom/tests/subcmps/subcmps0C.circom @@ -44,7 +44,6 @@ component main = SubCmps0C(2); //CHECK-NEXT: br label %fold_true3 //CHECK-EMPTY: //CHECK-NEXT: fold_true3: -//CHECK-NEXT: call void @llvm.donothing() //CHECK-NEXT: call void @IsZero_0_run([0 x i256]* %sub_[[X4]]) //CHECK-NEXT: br label %store4 //CHECK-EMPTY: diff --git a/circom/tests/subcmps/subcmps0D.circom b/circom/tests/subcmps/subcmps0D.circom index c9dee689b..89d898aea 100644 --- a/circom/tests/subcmps/subcmps0D.circom +++ b/circom/tests/subcmps/subcmps0D.circom @@ -62,7 +62,6 @@ component main = SubCmps0D(3); //CHECK-NEXT: br label %fold_true6 //CHECK-EMPTY: //CHECK-NEXT: fold_true6: -//CHECK-NEXT: call void @llvm.donothing() //CHECK-NEXT: call void @Add_0_run([0 x i256]* %sub_[[X6]]) //CHECK-NEXT: br label %store7 //CHECK-EMPTY: diff --git a/circom/tests/subcmps/subcmps1.circom b/circom/tests/subcmps/subcmps1.circom index a38ddc024..7945748b8 100644 --- a/circom/tests/subcmps/subcmps1.circom +++ b/circom/tests/subcmps/subcmps1.circom @@ -58,7 +58,6 @@ component main = SubCmps1(3); //CHECK-NEXT: br label %fold_true3 //CHECK-EMPTY: //CHECK-NEXT: fold_true3: -//CHECK-NEXT: call void @llvm.donothing() //CHECK-NEXT: call void @IsZero_0_run([0 x i256]* %sub_[[X4]]) //CHECK-NEXT: br label %store4 //CHECK-EMPTY: diff --git a/circom/tests/subcmps/subcmps2.circom b/circom/tests/subcmps/subcmps2.circom index faf7d0dbf..22fa83ff8 100644 --- a/circom/tests/subcmps/subcmps2.circom +++ b/circom/tests/subcmps/subcmps2.circom @@ -131,7 +131,6 @@ component main = Caller(); //CHECK-NEXT: br label %fold_true3 //CHECK-EMPTY: //CHECK-NEXT: fold_true3: -//CHECK-NEXT: call void @llvm.donothing() //CHECK-NEXT: call void @Sum_0_run([0 x i256]* %sub_[[X3]]) //CHECK-NEXT: br label %store4 //CHECK-EMPTY: diff --git a/compiler/src/intermediate_representation/store_bucket.rs b/compiler/src/intermediate_representation/store_bucket.rs index fa0e8def6..002e8f460 100644 --- a/compiler/src/intermediate_representation/store_bucket.rs +++ b/compiler/src/intermediate_representation/store_bucket.rs @@ -112,8 +112,7 @@ impl StoreBucket { Some(name) => { assert_eq!(1, context.size, "unhandled array store"); if name == LLVM_DONOTHING_FN_NAME { - //LLVM equivalent of a "nop" instruction - create_call(producer, LLVM_DONOTHING_FN_NAME, &[]) + None } else { let arr_ptr = match &dest_address_type { AddressType::Variable => producer.body_ctx().get_variable_array(producer), @@ -128,11 +127,11 @@ impl StoreBucket { } .into_pointer_value(); let arr_ptr = pointer_cast(producer, arr_ptr, array_ptr_ty(producer)); - create_call( + Some(create_call( producer, name.as_str(), &[arr_ptr.into(), dest_index.into(), source.into_int_value().into()], - ) + )) } } None => { @@ -181,7 +180,7 @@ impl StoreBucket { }; } } - create_call( + Some(create_call( producer, FR_ARRAY_COPY_FN_NAME, &[ @@ -189,10 +188,10 @@ impl StoreBucket { dest_gep.into(), create_literal_u32(producer, context.size as u64).into(), ], - ) + )) } else { // In the scalar case, just produce a store from the source value that was given - create_store(producer, dest_gep, source) + Some(create_store(producer, dest_gep, source)) } } }; @@ -256,7 +255,7 @@ impl StoreBucket { } } } - Some(store) + store } }