Test source: git
Source: <stdin> ---------------------------------------- define i32 @foo1(* %a) { %entry: %0 = load i32, * %a, align 4 %ptrint = ptrtoint * %a to i64 %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 assume i1 %maskcond ret i32 %0 } => define i32 @foo1(* %a) { %entry: %0 = load i32, * %a, align 32 %ptrint = ptrtoint * %a to i64 %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 assume i1 %maskcond ret i32 %0 } Transformation seems to be correct! ---------------------------------------- define i32 @foo2(* %a) { %entry: %ptrint = ptrtoint * %a to i64 %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 assume i1 %maskcond %0 = load i32, * %a, align 4 ret i32 %0 } => define i32 @foo2(* %a) { %entry: %ptrint = ptrtoint * %a to i64 %maskedptr = and i64 %ptrint, 31 %maskcond = icmp eq i64 %maskedptr, 0 assume i1 %maskcond %0 = load i32, * %a, align 32 ret i32 %0 } Transformation seems to be correct! ---------------------------------------- define i32 @simple(i32 %a) { %entry: %cmp = icmp eq i32 %a, 4 assume i1 %cmp ret i32 %a } => define i32 @simple(i32 %a) { %entry: %cmp = icmp eq i32 %a, 4 assume i1 %cmp ret i32 4 } Transformation seems to be correct! ---------------------------------------- define i32 @can1(i1 %a, i1 %b, i1 %c) { %entry: %and1 = and i1 %a, %b %and = and i1 %and1, %c assume i1 %and ret i32 5 } => define i32 @can1(i1 %a, i1 %b, i1 %c) { %entry: assume i1 %a assume i1 %b assume i1 %c ret i32 5 } Transformation seems to be correct! ---------------------------------------- define i32 @can2(i1 %a, i1 %b, i1 %c) { %entry: %v = or i1 %a, %b %w = xor i1 %v, 1 assume i1 %w ret i32 5 } => define i32 @can2(i1 %a, i1 %b, i1 %c) { %entry: %0 = xor i1 %a, 1 assume i1 %0 %1 = xor i1 %b, 1 assume i1 %1 ret i32 5 } Transformation seems to be correct! ---------------------------------------- define i32 @bar1(i32 %a) { %entry: %and1 = and i32 %a, 3 %and = and i32 %a, 7 %cmp = icmp eq i32 %and, 1 assume i1 %cmp ret i32 %and1 } => define i32 @bar1(i32 %a) { %entry: %and = and i32 %a, 7 %cmp = icmp eq i32 %and, 1 assume i1 %cmp ret i32 1 } Transformation seems to be correct! ---------------------------------------- define i32 @bar2(i32 %a) { %entry: %and = and i32 %a, 7 %cmp = icmp eq i32 %and, 1 assume i1 %cmp %and1 = and i32 %a, 3 ret i32 %and1 } => define i32 @bar2(i32 %a) { %entry: %and = and i32 %a, 7 %cmp = icmp eq i32 %and, 1 assume i1 %cmp ret i32 1 } Transformation seems to be correct! ---------------------------------------- define i32 @bar3(i32 %a, i1 %x, i1 %y) { %entry: %and1 = and i32 %a, 3 assume i1 %x %and = and i32 %a, 7 %cmp = icmp eq i32 %and, 1 assume i1 %cmp assume i1 %y ret i32 %and1 } => define i32 @bar3(i32 %a, i1 %x, i1 %y) { %entry: assume i1 %x %and = and i32 %a, 7 %cmp = icmp eq i32 %and, 1 assume i1 %cmp assume i1 %y ret i32 1 } Transformation seems to be correct! ---------------------------------------- define i32 @bar4(i32 %a, i32 %b) { %entry: %and1 = and i32 %b, 3 %and = and i32 %a, 7 %cmp = icmp eq i32 %and, 1 assume i1 %cmp %cmp2 = icmp eq i32 %a, %b assume i1 %cmp2 ret i32 %and1 } => define i32 @bar4(i32 %a, i32 %b) { %entry: %and = and i32 %a, 7 %cmp = icmp eq i32 %and, 1 assume i1 %cmp %cmp2 = icmp eq i32 %a, %b assume i1 %cmp2 ret i32 1 } Transformation seems to be correct! ---------------------------------------- define i32 @icmp1(i32 %a) { %0: %cmp = icmp sgt i32 %a, 5 assume i1 %cmp %conv = zext i1 %cmp to i32 ret i32 %conv } => define i32 @icmp1(i32 %a) { %0: %cmp = icmp sgt i32 %a, 5 assume i1 %cmp ret i32 1 } Transformation seems to be correct! ---------------------------------------- define i32 @icmp2(i32 %a) { %0: %cmp = icmp sgt i32 %a, 5 assume i1 %cmp %t0 = zext i1 %cmp to i32 %lnot.ext = xor i32 %t0, 1 ret i32 %lnot.ext } => define i32 @icmp2(i32 %a) { %0: %cmp = icmp sgt i32 %a, 5 assume i1 %cmp ret i32 0 } Transformation seems to be correct! ---------------------------------------- define i1 @assume_not(i1 %cond) { %0: %notcond = xor i1 %cond, 1 assume i1 %notcond ret i1 %cond } => define i1 @assume_not(i1 %cond) { %0: %notcond = xor i1 %cond, 1 assume i1 %notcond ret i1 0 } Transformation seems to be correct! ---------------------------------------- define i32 @bundle1(* %P) { %0: assume i1 1 %load = load i32, * %P, align 4 ret i32 %load } => define i32 @bundle1(* %P) { %0: assume i1 1 %load = load i32, * %P, align 4 ret i32 %load } Transformation seems to be correct! ---------------------------------------- define i32 @bundle2(* %P) { %0: assume i1 1 %load = load i32, * %P, align 4 ret i32 %load } => define i32 @bundle2(* %P) { %0: %load = load i32, * %P, align 4 ret i32 %load } Transformation seems to be correct! ERROR: Unsupported metadata: 11 ---------------------------------------- define i1 @nonnull2(* %a) { %0: %load = load i32, * %a, align 4 %cmp = icmp ne i32 %load, 0 assume i1 %cmp %rval = icmp eq i32 %load, 0 ret i1 %rval } => define i1 @nonnull2(* %a) { %0: %load = load i32, * %a, align 4 %cmp = icmp ne i32 %load, 0 assume i1 %cmp ret i1 0 } Transformation seems to be correct! ---------------------------------------- define i1 @nonnull3(* %a, i1 %control) { %entry: %load = load *, * %a, align 8 %cmp = icmp ne * %load, null br i1 %control, label %taken, label %not_taken %not_taken: %rval.2 = icmp sgt * %load, null ret i1 %rval.2 %taken: assume i1 %cmp %rval = icmp eq * %load, null ret i1 %rval } => define i1 @nonnull3(* %a, i1 %control) { %entry: %load = load *, * %a, align 8 %cmp = icmp ne * %load, null br i1 %control, label %taken, label %not_taken %not_taken: %rval.2 = icmp sgt * %load, null ret i1 %rval.2 %taken: assume i1 %cmp ret i1 0 } Transformation seems to be correct! ---------------------------------------- define i1 @nonnull4(* %a) { %0: %load = load *, * %a, align 8 call void @escape(* %load) %cmp = icmp ne * %load, null assume i1 %cmp %rval = icmp eq * %load, null ret i1 %rval } => define i1 @nonnull4(* %a) { %0: %load = load *, * %a, align 8 call void @escape(* %load) %cmp = icmp ne * %load, null assume i1 %cmp ret i1 0 } Transformation seems to be correct! ---------------------------------------- define i1 @nonnull5(* %a) { %0: %load = load *, * %a, align 8 call void @escape(* %load) %integral = ptrtoint * %load to i64 %cmp = icmp slt i64 %integral, 0 assume i1 %cmp %rval = icmp eq * %load, null ret i1 %rval } => define i1 @nonnull5(* %a) { %0: %load = load *, * %a, align 8 call void @escape(* %load) %cmp = icmp slt * %load, null assume i1 %cmp ret i1 0 } Transformation doesn't verify! ERROR: Source is more defined than target Example: * %a = pointer(non-local, block_id=4, offset=6016) Source: * %load = pointer(non-local, block_id=4, offset=-6852433265390433192) i64 %integral = #xa0e7544039554c58 (11594328400505162840, -6852415673204388776) i1 %cmp = #x1 (1) i1 %rval = #x0 (0) SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 64 alloc type: 0 address: 0 Block 1 > size: 1285587895544975349 align: 2 alloc type: 0 address: 1152921508901814284 Block 2 > size: 117764720342257812 align: 2 alloc type: 0 address: 39720662862849 Block 3 > size: 2323191326011486392 align: 4 alloc type: 0 address: 4683750218410229764 Block 4 > size: 32772 align: 0 alloc type: 0 address: 17592186044416 Target: * %load = pointer(non-local, block_id=4, offset=-6852433265390433192) i1 %cmp = #x0 (0) ------------------- SMT STATS ------------------- Num queries: 69 Num invalid: 0 Num skips: 0 Num trivial: 35 (33.7%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 19 (27.5%) Num UNSAT: 50 (72.5%)
+ : 'RUN: at line 2' + /home/nlopes/alive2/scripts/opt-alive.sh -instcombine -S + /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/assume.ll Alive2: Transform doesn't verify; aborting! FileCheck error: '<stdin>' is empty. FileCheck command line: /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/assume.ll