You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated code for the first example is correct, but because of an optimization it makes vector comparison first, and then extracts the first element of the result vector. It means that the cost model considers vector comparison and field comparison relatively the same. I think we need to disable this optimization for our target.
; Function Attrs: circuit mustprogress nounwind
define dso_local noundef zeroext i1 @_Z14sha256_exampleDv2_u26__zkllvm_field_pallas_baseS_(<2 x __zkllvm_field_pallas_base> noundef %block0, <2 x __zkllvm_field_pallas_base> noundef %block1) local_unnamed_addr #0 {
entry:
%0 = icmp ult <2 x __zkllvm_field_pallas_base> %block0, %block1
%cmp = extractelement <2 x i1> %0, i32 0
ret i1 %cmp
}
The second example fails inside another optimization, but passes with O0 level.
in this example
handle_vector_cmp is being called despite that we are comparing fields.
If trying to extract field elements and compare explicitly
then circifier fails:
The text was updated successfully, but these errors were encountered: