Skip to content

Instantly share code, notes, and snippets.

@nikic

nikic/alive.ll Secret

Created Jul 2, 2020
Embed
What would you like to do?
----------------------------------------
define i1 @zext_uge_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp uge i64 %zext, %sext
ret i1 %cmp
}
=>
define i1 @zext_uge_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp uge i64 %zext, %sext
ret i1 %cmp
}
Transformation seems to be correct!
----------------------------------------
define i1 @zext_ugt_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ugt i64 %zext, %sext
ret i1 %cmp
}
=>
define i1 @zext_ugt_sext(i32 %x) {
%0:
ret i1 0
}
Transformation seems to be correct!
----------------------------------------
define i1 @zext_ult_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ult i64 %zext, %sext
ret i1 %cmp
}
=>
define i1 @zext_ult_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ult i64 %zext, %sext
ret i1 %cmp
}
Transformation seems to be correct!
----------------------------------------
define i1 @zext_ule_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ule i64 %zext, %sext
ret i1 %cmp
}
=>
define i1 @zext_ule_sext(i32 %x) {
%0:
ret i1 1
}
Transformation seems to be correct!
----------------------------------------
define i1 @zext_sge_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sge i64 %zext, %sext
ret i1 %cmp
}
=>
define i1 @zext_sge_sext(i32 %x) {
%0:
ret i1 1
}
Transformation seems to be correct!
----------------------------------------
define i1 @zext_sgt_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sgt i64 %zext, %sext
ret i1 %cmp
}
=>
define i1 @zext_sgt_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sgt i64 %zext, %sext
ret i1 %cmp
}
Transformation seems to be correct!
----------------------------------------
define i1 @zext_slt_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp slt i64 %zext, %sext
ret i1 %cmp
}
=>
define i1 @zext_slt_sext(i32 %x) {
%0:
ret i1 0
}
Transformation seems to be correct!
----------------------------------------
define i1 @zext_sle_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sle i64 %zext, %sext
ret i1 %cmp
}
=>
define i1 @zext_sle_sext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sle i64 %zext, %sext
ret i1 %cmp
}
Transformation seems to be correct!
----------------------------------------
define i1 @sext_uge_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp uge i64 %sext, %zext
ret i1 %cmp
}
=>
define i1 @sext_uge_zext(i32 %x) {
%0:
ret i1 1
}
Transformation seems to be correct!
----------------------------------------
define i1 @sext_ugt_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ugt i64 %sext, %zext
ret i1 %cmp
}
=>
define i1 @sext_ugt_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ugt i64 %sext, %zext
ret i1 %cmp
}
Transformation seems to be correct!
----------------------------------------
define i1 @sext_ult_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ult i64 %sext, %zext
ret i1 %cmp
}
=>
define i1 @sext_ult_zext(i32 %x) {
%0:
ret i1 0
}
Transformation seems to be correct!
----------------------------------------
define i1 @sext_ule_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ule i64 %sext, %zext
ret i1 %cmp
}
=>
define i1 @sext_ule_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp ule i64 %sext, %zext
ret i1 %cmp
}
Transformation seems to be correct!
----------------------------------------
define i1 @sext_sge_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sge i64 %sext, %zext
ret i1 %cmp
}
=>
define i1 @sext_sge_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sge i64 %sext, %zext
ret i1 %cmp
}
Transformation seems to be correct!
----------------------------------------
define i1 @sext_sgt_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sgt i64 %sext, %zext
ret i1 %cmp
}
=>
define i1 @sext_sgt_zext(i32 %x) {
%0:
ret i1 0
}
Transformation seems to be correct!
----------------------------------------
define i1 @sext_slt_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp slt i64 %sext, %zext
ret i1 %cmp
}
=>
define i1 @sext_slt_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp slt i64 %sext, %zext
ret i1 %cmp
}
Transformation seems to be correct!
----------------------------------------
define i1 @sext_sle_zext(i32 %x) {
%0:
%sext = sext i32 %x to i64
%zext = zext i32 %x to i64
%cmp = icmp sle i64 %sext, %zext
ret i1 %cmp
}
=>
define i1 @sext_sle_zext(i32 %x) {
%0:
ret i1 1
}
Transformation seems to be correct!
Summary:
16 correct transformations
0 incorrect transformations
0 Alive2 errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment