Test source: git
Source: <stdin> ---------------------------------------- define i32 @test0() { %entry: %a1 = alloca i64 4, align 4, dead %a2 = alloca i64 4, align 4, dead %a1.i8 = bitcast * %a1 to * start_lifetime * %a1.i8 store i32 0, * %a1, align 4 %v1 = load i32, * %a1, align 4 free * %a1.i8 unconstrained %a2.i8 = bitcast * %a2 to * start_lifetime * %a2.i8 store float 0.000000, * %a2, align 4 %v2 = load float, * %a2, align 4 %v2.int = bitcast float %v2 to i32 %sum1 = add i32 %v1, %v2.int free * %a2.i8 unconstrained ret i32 %sum1 } => define i32 @test0() { %entry: %v2.int = bitcast float 0.000000 to i32 %sum1 = add i32 0, %v2.int ret i32 %sum1 } Transformation seems to be correct! ---------------------------------------- define i32 @test1() { %entry: %X = alloca i64 8, align 8 %Y = gep * %X, 8 x i64 0, 1 x i64 0 store i32 0, * %Y, align 4 %Z = load i32, * %Y, align 4 ret i32 %Z } => define i32 @test1() { %entry: ret i32 0 } Transformation seems to be correct! ---------------------------------------- define i64 @test2(i64 %X) { %entry: %A = alloca i64 8, align 1 %B = bitcast * %A to * store i64 %X, * %B, align 4 br label %L2 %L2: %Z = load i64, * %B, align 4 ret i64 %Z } => define i64 @test2(i64 %X) { %entry: br label %L2 %L2: ret i64 %X } Transformation seems to be correct! ERROR: Unsupported instruction: %B = addrspacecast [8 x i8]* %A to i64 addrspace(1)* ERROR: Unsupported instruction: %B = addrspacecast [256 x i8]* %A to i64 addrspace(1)* ERROR: Unsupported instruction: %B = addrspacecast [256 x i8]* %A to i64 addrspace(1)* ERROR: Unsupported instruction: %A.sroa.0.2.gepB.sroa_cast = addrspacecast i8* %A.sroa.0.2.gepB.sroa_idx to i64 addrspace(1)* ERROR: Unsupported attribute: align 8 ERROR: Unsupported attribute: align 8 ---------------------------------------- define void @test4(* %dst, * %src) { %entry: %a = alloca i64 100, align 1 %b = gep * %a, 100 x i64 0, 1 x i64 0 memcpy * %b align 1, * %src align 1, i32 100 %a.src.1 = gep * %a, 100 x i64 0, 1 x i64 20 %a.dst.1 = gep * %a, 100 x i64 0, 1 x i64 40 memcpy * %a.dst.1 align 1, * %a.src.1 align 1, i32 10 %c = gep * %a, 100 x i64 0, 1 x i64 42 store i8 0, * %c, align 1 %a.src.2 = gep * %a, 100 x i64 0, 1 x i64 50 memmove * %a.dst.1 align 1, * %a.src.2 align 1, i32 10 memcpy * %dst align 1, * %b align 1, i32 100 ret void } => define void @test4(* %dst, * %src) { %entry: %a.sroa.0 = alloca i64 20, align 1 %a.sroa.2.sroa.4 = alloca i64 7, align 1 %a.sroa.3 = alloca i64 10, align 1 %a.sroa.34.sroa.5 = alloca i64 7, align 1 %a.sroa.6.sroa.4 = alloca i64 7, align 1 %a.sroa.7 = alloca i64 40, align 1 %a.sroa.0.0.b.sroa_idx = gep inbounds * %a.sroa.0, 20 x i64 0, 1 x i64 0 memcpy * %a.sroa.0.0.b.sroa_idx align 1, * %src align 1, i32 20 %a.sroa.2.sroa.0.0.a.sroa.2.0.src.sroa_raw_idx.sroa_idx = gep inbounds * %src, 1 x i64 20 %a.sroa.2.sroa.0.0.a.sroa.2.0.src.sroa_raw_idx.sroa_cast = bitcast * %a.sroa.2.sroa.0.0.a.sroa.2.0.src.sroa_raw_idx.sroa_idx to * %a.sroa.2.sroa.0.0.copyload = load i16, * %a.sroa.2.sroa.0.0.a.sroa.2.0.src.sroa_raw_idx.sroa_cast, align 1 %a.sroa.2.sroa.3.0.a.sroa.2.0.src.sroa_raw_idx.sroa_raw_idx = gep inbounds * %src, 1 x i64 22 %a.sroa.2.sroa.3.0.copyload = load i8, * %a.sroa.2.sroa.3.0.a.sroa.2.0.src.sroa_raw_idx.sroa_raw_idx, align 1 %a.sroa.2.sroa.4.0.a.sroa.2.0.src.sroa_raw_idx.sroa_raw_idx = gep inbounds * %src, 1 x i64 23 %a.sroa.2.sroa.4.0.b.sroa_idx = gep inbounds * %a.sroa.2.sroa.4, 7 x i64 0, 1 x i64 0 memcpy * %a.sroa.2.sroa.4.0.b.sroa_idx align 1, * %a.sroa.2.sroa.4.0.a.sroa.2.0.src.sroa_raw_idx.sroa_raw_idx align 1, i32 7 %a.sroa.3.0.src.sroa_raw_idx = gep inbounds * %src, 1 x i64 30 %a.sroa.3.0.b.sroa_idx = gep inbounds * %a.sroa.3, 10 x i64 0, 1 x i64 0 memcpy * %a.sroa.3.0.b.sroa_idx align 1, * %a.sroa.3.0.src.sroa_raw_idx align 1, i32 10 %a.sroa.34.sroa.0.0.a.sroa.34.0.src.sroa_raw_idx.sroa_idx = gep inbounds * %src, 1 x i64 40 %a.sroa.34.sroa.0.0.a.sroa.34.0.src.sroa_raw_idx.sroa_cast = bitcast * %a.sroa.34.sroa.0.0.a.sroa.34.0.src.sroa_raw_idx.sroa_idx to * %a.sroa.34.sroa.0.0.copyload = load i16, * %a.sroa.34.sroa.0.0.a.sroa.34.0.src.sroa_raw_idx.sroa_cast, align 1 %a.sroa.34.sroa.4.0.a.sroa.34.0.src.sroa_raw_idx.sroa_raw_idx = gep inbounds * %src, 1 x i64 42 %a.sroa.34.sroa.4.0.copyload = load i8, * %a.sroa.34.sroa.4.0.a.sroa.34.0.src.sroa_raw_idx.sroa_raw_idx, align 1 %a.sroa.34.sroa.5.0.a.sroa.34.0.src.sroa_raw_idx.sroa_raw_idx = gep inbounds * %src, 1 x i64 43 %a.sroa.34.sroa.5.0.b.sroa_idx = gep inbounds * %a.sroa.34.sroa.5, 7 x i64 0, 1 x i64 0 memcpy * %a.sroa.34.sroa.5.0.b.sroa_idx align 1, * %a.sroa.34.sroa.5.0.a.sroa.34.0.src.sroa_raw_idx.sroa_raw_idx align 1, i32 7 %a.sroa.6.sroa.0.0.a.sroa.6.0.src.sroa_raw_idx.sroa_idx = gep inbounds * %src, 1 x i64 50 %a.sroa.6.sroa.0.0.a.sroa.6.0.src.sroa_raw_idx.sroa_cast = bitcast * %a.sroa.6.sroa.0.0.a.sroa.6.0.src.sroa_raw_idx.sroa_idx to * %a.sroa.6.sroa.0.0.copyload = load i16, * %a.sroa.6.sroa.0.0.a.sroa.6.0.src.sroa_raw_idx.sroa_cast, align 1 %a.sroa.6.sroa.3.0.a.sroa.6.0.src.sroa_raw_idx.sroa_raw_idx = gep inbounds * %src, 1 x i64 52 %a.sroa.6.sroa.3.0.copyload = load i8, * %a.sroa.6.sroa.3.0.a.sroa.6.0.src.sroa_raw_idx.sroa_raw_idx, align 1 %a.sroa.6.sroa.4.0.a.sroa.6.0.src.sroa_raw_idx.sroa_raw_idx = gep inbounds * %src, 1 x i64 53 %a.sroa.6.sroa.4.0.b.sroa_idx = gep inbounds * %a.sroa.6.sroa.4, 7 x i64 0, 1 x i64 0 memcpy * %a.sroa.6.sroa.4.0.b.sroa_idx align 1, * %a.sroa.6.sroa.4.0.a.sroa.6.0.src.sroa_raw_idx.sroa_raw_idx align 1, i32 7 %a.sroa.7.0.src.sroa_raw_idx = gep inbounds * %src, 1 x i64 60 %a.sroa.7.0.b.sroa_idx = gep inbounds * %a.sroa.7, 40 x i64 0, 1 x i64 0 memcpy * %a.sroa.7.0.b.sroa_idx align 1, * %a.sroa.7.0.src.sroa_raw_idx align 1, i32 40 %a.sroa.2.sroa.4.3.a.sroa.34.sroa.5.0.a.dst.1.sroa_idx.sroa_idx = gep inbounds * %a.sroa.34.sroa.5, 7 x i64 0, 1 x i64 0 %a.sroa.2.sroa.4.3.a.src.1.sroa_idx = gep inbounds * %a.sroa.2.sroa.4, 7 x i64 0, 1 x i64 0 memcpy * %a.sroa.2.sroa.4.3.a.sroa.34.sroa.5.0.a.dst.1.sroa_idx.sroa_idx align 1, * %a.sroa.2.sroa.4.3.a.src.1.sroa_idx align 1, i32 7 %a.sroa.6.sroa.4.3.a.sroa.34.sroa.5.0.a.dst.1.sroa_idx16.sroa_idx = gep inbounds * %a.sroa.34.sroa.5, 7 x i64 0, 1 x i64 0 %a.sroa.6.sroa.4.3.a.src.2.sroa_idx = gep inbounds * %a.sroa.6.sroa.4, 7 x i64 0, 1 x i64 0 memcpy * %a.sroa.6.sroa.4.3.a.sroa.34.sroa.5.0.a.dst.1.sroa_idx16.sroa_idx align 1, * %a.sroa.6.sroa.4.3.a.src.2.sroa_idx align 1, i32 7 %a.sroa.0.0.b.sroa_idx1 = gep inbounds * %a.sroa.0, 20 x i64 0, 1 x i64 0 memcpy * %dst align 1, * %a.sroa.0.0.b.sroa_idx1 align 1, i32 20 %a.sroa.2.sroa.0.0.a.sroa.2.0.dst.sroa_raw_idx.sroa_idx = gep inbounds * %dst, 1 x i64 20 %a.sroa.2.sroa.0.0.a.sroa.2.0.dst.sroa_raw_idx.sroa_cast = bitcast * %a.sroa.2.sroa.0.0.a.sroa.2.0.dst.sroa_raw_idx.sroa_idx to * store i16 %a.sroa.2.sroa.0.0.copyload, * %a.sroa.2.sroa.0.0.a.sroa.2.0.dst.sroa_raw_idx.sroa_cast, align 1 %a.sroa.2.sroa.3.0.a.sroa.2.0.dst.sroa_raw_idx.sroa_raw_idx = gep inbounds * %dst, 1 x i64 22 store i8 %a.sroa.2.sroa.3.0.copyload, * %a.sroa.2.sroa.3.0.a.sroa.2.0.dst.sroa_raw_idx.sroa_raw_idx, align 1 %a.sroa.2.sroa.4.0.a.sroa.2.0.dst.sroa_raw_idx.sroa_raw_idx = gep inbounds * %dst, 1 x i64 23 %a.sroa.2.sroa.4.0.b.sroa_idx22 = gep inbounds * %a.sroa.2.sroa.4, 7 x i64 0, 1 x i64 0 memcpy * %a.sroa.2.sroa.4.0.a.sroa.2.0.dst.sroa_raw_idx.sroa_raw_idx align 1, * %a.sroa.2.sroa.4.0.b.sroa_idx22 align 1, i32 7 %a.sroa.3.0.dst.sroa_raw_idx = gep inbounds * %dst, 1 x i64 30 %a.sroa.3.0.b.sroa_idx3 = gep inbounds * %a.sroa.3, 10 x i64 0, 1 x i64 0 memcpy * %a.sroa.3.0.dst.sroa_raw_idx align 1, * %a.sroa.3.0.b.sroa_idx3 align 1, i32 10 %a.sroa.34.sroa.0.0.a.sroa.34.0.dst.sroa_raw_idx.sroa_idx = gep inbounds * %dst, 1 x i64 40 %a.sroa.34.sroa.0.0.a.sroa.34.0.dst.sroa_raw_idx.sroa_cast = bitcast * %a.sroa.34.sroa.0.0.a.sroa.34.0.dst.sroa_raw_idx.sroa_idx to * store i16 %a.sroa.6.sroa.0.0.copyload, * %a.sroa.34.sroa.0.0.a.sroa.34.0.dst.sroa_raw_idx.sroa_cast, align 1 %a.sroa.34.sroa.4.0.a.sroa.34.0.dst.sroa_raw_idx.sroa_raw_idx = gep inbounds * %dst, 1 x i64 42 store i8 %a.sroa.6.sroa.3.0.copyload, * %a.sroa.34.sroa.4.0.a.sroa.34.0.dst.sroa_raw_idx.sroa_raw_idx, align 1 %a.sroa.34.sroa.5.0.a.sroa.34.0.dst.sroa_raw_idx.sroa_raw_idx = gep inbounds * %dst, 1 x i64 43 %a.sroa.34.sroa.5.0.b.sroa_idx15 = gep inbounds * %a.sroa.34.sroa.5, 7 x i64 0, 1 x i64 0 memcpy * %a.sroa.34.sroa.5.0.a.sroa.34.0.dst.sroa_raw_idx.sroa_raw_idx align 1, * %a.sroa.34.sroa.5.0.b.sroa_idx15 align 1, i32 7 %a.sroa.6.sroa.0.0.a.sroa.6.0.dst.sroa_raw_idx.sroa_idx = gep inbounds * %dst, 1 x i64 50 %a.sroa.6.sroa.0.0.a.sroa.6.0.dst.sroa_raw_idx.sroa_cast = bitcast * %a.sroa.6.sroa.0.0.a.sroa.6.0.dst.sroa_raw_idx.sroa_idx to * store i16 %a.sroa.6.sroa.0.0.copyload, * %a.sroa.6.sroa.0.0.a.sroa.6.0.dst.sroa_raw_idx.sroa_cast, align 1 %a.sroa.6.sroa.3.0.a.sroa.6.0.dst.sroa_raw_idx.sroa_raw_idx = gep inbounds * %dst, 1 x i64 52 store i8 %a.sroa.6.sroa.3.0.copyload, * %a.sroa.6.sroa.3.0.a.sroa.6.0.dst.sroa_raw_idx.sroa_raw_idx, align 1 %a.sroa.6.sroa.4.0.a.sroa.6.0.dst.sroa_raw_idx.sroa_raw_idx = gep inbounds * %dst, 1 x i64 53 %a.sroa.6.sroa.4.0.b.sroa_idx19 = gep inbounds * %a.sroa.6.sroa.4, 7 x i64 0, 1 x i64 0 memcpy * %a.sroa.6.sroa.4.0.a.sroa.6.0.dst.sroa_raw_idx.sroa_raw_idx align 1, * %a.sroa.6.sroa.4.0.b.sroa_idx19 align 1, i32 7 %a.sroa.7.0.dst.sroa_raw_idx = gep inbounds * %dst, 1 x i64 60 %a.sroa.7.0.b.sroa_idx8 = gep inbounds * %a.sroa.7, 40 x i64 0, 1 x i64 0 memcpy * %a.sroa.7.0.dst.sroa_raw_idx align 1, * %a.sroa.7.0.b.sroa_idx8 align 1, i32 40 ret void } Transformation doesn't verify! ERROR: Timeout ---------------------------------------- define i16 @test5() { %entry: %a = alloca i64 4, align 1 %fptr = bitcast * %a to * store float 0.000000, * %fptr, align 4 %ptr = gep * %a, 4 x i32 0, 1 x i32 2 %iptr = bitcast * %ptr to * %val = load i16, * %iptr, align 2 ret i16 %val } => define i16 @test5() { %entry: %0 = bitcast float 0.000000 to i32 %a.sroa.0.2.extract.shift = lshr i32 %0, 16 %a.sroa.0.2.extract.trunc = trunc i32 %a.sroa.0.2.extract.shift to i16 ret i16 %a.sroa.0.2.extract.trunc } Transformation seems to be correct! ERROR: Unsupported instruction: %fptr.as1 = addrspacecast float* %fptr to float addrspace(1)* ERROR: Unsupported instruction: store volatile i32 707406378, i32* %a.sroa.0 ERROR: Unsupported instruction: %a.sroa.0.0.copyload = load volatile i32, i32* %a.sroa.0.0.src.sroa_cast, align 1, !tbaa !0 ---------------------------------------- define {*, *} @test8(* %s2) { %entry: %new = alloca i64 16, align 8 %s2.next.ptr = gep * %s2, 16 x i64 0, 1 x i64 8 %s2.next = load *, * %s2.next.ptr, align 8 %s2.next.s1.ptr = gep * %s2.next, 16 x i64 0, 1 x i64 0 %s2.next.s1 = load *, * %s2.next.s1.ptr, align 8 %new.s1.ptr = gep * %new, 16 x i64 0, 1 x i64 0 store * %s2.next.s1, * %new.s1.ptr, align 8 %s2.next.next.ptr = gep * %s2.next, 16 x i64 0, 1 x i64 8 %s2.next.next = load *, * %s2.next.next.ptr, align 8 %new.next.ptr = gep * %new, 16 x i64 0, 1 x i64 8 store * %s2.next.next, * %new.next.ptr, align 8 %new.s1 = load *, * %new.s1.ptr, align 8 %result1 = insertvalue {*, *} undef, * %new.s1, 0 %new.next = load *, * %new.next.ptr, align 8 %result2 = insertvalue {*, *} %result1, * %new.next, 1 ret {*, *} %result2 } => define {*, *} @test8(* %s2) { %entry: %s2.next.ptr = gep * %s2, 16 x i64 0, 1 x i64 8 %s2.next = load *, * %s2.next.ptr, align 8 %s2.next.s1.ptr = gep * %s2.next, 16 x i64 0, 1 x i64 0 %s2.next.s1 = load *, * %s2.next.s1.ptr, align 8 %s2.next.next.ptr = gep * %s2.next, 16 x i64 0, 1 x i64 8 %s2.next.next = load *, * %s2.next.next.ptr, align 8 %result1 = insertvalue {*, *} undef, * %s2.next.s1, 0 %result2 = insertvalue {*, *} %result1, * %s2.next.next, 1 ret {*, *} %result2 } Transformation seems to be correct! ---------------------------------------- define i64 @test9() { %entry: %a = alloca i64 3, align 8 %gep1 = gep inbounds * %a, 3 x i32 0, 1 x i64 0, 1 x i32 0 store i8 0, * %gep1, align 1 %gep2 = gep inbounds * %a, 3 x i32 0, 1 x i64 0, 1 x i32 1 store i8 0, * %gep2, align 1 %gep3 = gep inbounds * %a, 3 x i32 0, 1 x i64 0, 1 x i32 2 store i8 26, * %gep3, align 1 %cast = bitcast * %a to * %elt = gep inbounds * %cast, 8 x i32 0, 1 x i64 0 %load = load i64, * %elt, align 4 %result = and i64 %load, 16777215 ret i64 %result } => define i64 @test9() { %entry: %a.sroa.3.0.insert.ext = zext i8 26 to i64 %a.sroa.3.0.insert.shift = shl i64 %a.sroa.3.0.insert.ext, 16 %a.sroa.3.0.insert.mask = and i64 undef, -16711681 %a.sroa.3.0.insert.insert = or i64 %a.sroa.3.0.insert.mask, %a.sroa.3.0.insert.shift %a.sroa.2.0.insert.ext = zext i8 0 to i64 %a.sroa.2.0.insert.shift = shl i64 %a.sroa.2.0.insert.ext, 8 %a.sroa.2.0.insert.mask = and i64 %a.sroa.3.0.insert.insert, -65281 %a.sroa.2.0.insert.insert = or i64 %a.sroa.2.0.insert.mask, %a.sroa.2.0.insert.shift %a.sroa.0.0.insert.ext = zext i8 0 to i64 %a.sroa.0.0.insert.mask = and i64 %a.sroa.2.0.insert.insert, -256 %a.sroa.0.0.insert.insert = or i64 %a.sroa.0.0.insert.mask, %a.sroa.0.0.insert.ext %result = and i64 %a.sroa.0.0.insert.insert, 16777215 ret i64 %result } Transformation seems to be correct! ---------------------------------------- define * @test10() { %entry: %a = alloca i64 8, align 1 %ptr = gep * %a, 8 x i32 0, 1 x i32 0 memset * %ptr align 1, i8 0, i32 8 %s2ptrptr = bitcast * %ptr to * %s2ptr = load *, * %s2ptrptr, align 8 ret * %s2ptr } => define * @test10() { %entry: %0 = ptrtoint * null to i64 ret * null } Transformation seems to be correct! ---------------------------------------- define i32 @test11() { %entry: %X = alloca i64 4, align 4 br i1 undef, label %good, label %bad %bad: %Y2 = gep * %X, 4 x i64 1 store i32 0, * %Y2, align 4 %Z2 = load i32, * %Y2, align 4 ret i32 %Z2 %good: %Y = gep * %X, 4 x i64 0 store i32 0, * %Y, align 4 %Z = load i32, * %Y, align 4 ret i32 %Z } => define i32 @test11() { %entry: br i1 undef, label %good, label %bad %bad: ret i32 undef %good: ret i32 0 } Transformation seems to be correct! ---------------------------------------- define i8 @test12() { %entry: %a = alloca i64 3, align 1 %b = alloca i64 3, align 1 %a0ptr = gep * %a, 3 x i64 0, 1 x i32 0 store i8 0, * %a0ptr, align 1 %a1ptr = gep * %a, 3 x i64 0, 1 x i32 1 store i8 0, * %a1ptr, align 1 %a2ptr = gep * %a, 3 x i64 0, 1 x i32 2 store i8 0, * %a2ptr, align 1 %aiptr = bitcast * %a to * %ai = load i24, * %aiptr, align 4 %biptr = bitcast * %b to * store i24 %ai, * %biptr, align 4 %b0ptr = gep * %b, 3 x i64 0, 1 x i32 0 %b0 = load i8, * %b0ptr, align 1 %b1ptr = gep * %b, 3 x i64 0, 1 x i32 1 %b1 = load i8, * %b1ptr, align 1 %b2ptr = gep * %b, 3 x i64 0, 1 x i32 2 %b2 = load i8, * %b2ptr, align 1 %bsum0 = add i8 %b0, %b1 %bsum1 = add i8 %bsum0, %b2 ret i8 %bsum1 } => define i8 @test12() { %entry: %a.sroa.3.0.insert.ext = zext i8 0 to i24 %a.sroa.3.0.insert.shift = shl i24 %a.sroa.3.0.insert.ext, 16 %a.sroa.3.0.insert.mask = and i24 undef, 65535 %a.sroa.3.0.insert.insert = or i24 %a.sroa.3.0.insert.mask, %a.sroa.3.0.insert.shift %a.sroa.2.0.insert.ext = zext i8 0 to i24 %a.sroa.2.0.insert.shift = shl i24 %a.sroa.2.0.insert.ext, 8 %a.sroa.2.0.insert.mask = and i24 %a.sroa.3.0.insert.insert, 16711935 %a.sroa.2.0.insert.insert = or i24 %a.sroa.2.0.insert.mask, %a.sroa.2.0.insert.shift %a.sroa.0.0.insert.ext = zext i8 0 to i24 %a.sroa.0.0.insert.mask = and i24 %a.sroa.2.0.insert.insert, 16776960 %a.sroa.0.0.insert.insert = or i24 %a.sroa.0.0.insert.mask, %a.sroa.0.0.insert.ext %b.sroa.0.0.extract.trunc = trunc i24 %a.sroa.0.0.insert.insert to i8 %b.sroa.2.0.extract.shift = lshr i24 %a.sroa.0.0.insert.insert, 8 %b.sroa.2.0.extract.trunc = trunc i24 %b.sroa.2.0.extract.shift to i8 %b.sroa.3.0.extract.shift = lshr i24 %a.sroa.0.0.insert.insert, 16 %b.sroa.3.0.extract.trunc = trunc i24 %b.sroa.3.0.extract.shift to i8 %bsum0 = add i8 %b.sroa.0.0.extract.trunc, %b.sroa.2.0.extract.trunc %bsum1 = add i8 %bsum0, %b.sroa.3.0.extract.trunc ret i8 %bsum1 } Transformation seems to be correct! ---------------------------------------- define i32 @test13() { %entry: %a = alloca i64 3, align 2 %b0ptr = gep * %a, 3 x i64 0, 1 x i32 0 store i8 0, * %b0ptr, align 1 %b1ptr = gep * %a, 3 x i64 0, 1 x i32 1 store i8 0, * %b1ptr, align 1 %b2ptr = gep * %a, 3 x i64 0, 1 x i32 2 store i8 0, * %b2ptr, align 1 %iptrcast = bitcast * %a to * %iptrgep = gep * %iptrcast, 2 x i64 1 %i = load i16, * %iptrgep, align 2 %ret = zext i16 %i to i32 ret i32 %ret } => define i32 @test13() { %entry: %a.sroa.2.2.load.ext = zext i8 0 to i16 %ret = zext i16 %a.sroa.2.2.load.ext to i32 ret i32 %ret } Transformation seems to be correct! ---------------------------------------- define void @test14() { %entry: %a = alloca i64 12, align 8 %p = alloca i64 8, align 8 %0 = bitcast * %a to * %1 = gep * %0, 1 x i64 12 %2 = bitcast * %1 to * %3 = gep inbounds * %2, 12 x i32 0, 1 x i64 0 %4 = gep inbounds * %a, 12 x i32 0, 1 x i64 0 %5 = bitcast * %3 to * %6 = bitcast * %4 to * %7 = load i32, * %6, align 4 store i32 %7, * %5, align 4 %8 = gep inbounds * %5, 4 x i32 1 %9 = gep inbounds * %6, 4 x i32 1 %10 = load i32, * %9, align 4 store i32 %10, * %8, align 4 %11 = gep inbounds * %5, 4 x i32 2 %12 = gep inbounds * %6, 4 x i32 2 %13 = load i32, * %12, align 4 store i32 %13, * %11, align 4 ret void } => define void @test14() { %entry: ret void } Transformation seems to be correct! ---------------------------------------- define i32 @test15(i1 %flag) { %entry: %l0 = alloca i64 8, align 8 %l1 = alloca i64 8, align 8 %l2 = alloca i64 8, align 8 %l3 = alloca i64 8, align 8 br label %loop %loop: %dead3 = phi * [ null, %entry ], [ %gep3, %loop ] store i64 1879048192, * %l0, align 8 %bc0 = bitcast * %l0 to * %gep0 = gep * %bc0, 1 x i64 3 %dead0 = bitcast * %gep0 to * store i64 1879048192, * %l1, align 8 %bc1 = bitcast * %l1 to * %gep1 = gep * %bc1, 1 x i64 3 %dead1 = gep * %gep1, 1 x i64 1 store i64 1879048192, * %l2, align 8 %bc2 = bitcast * %l2 to * %gep2.1 = gep * %bc2, 1 x i64 1 %gep2.2 = gep * %bc2, 1 x i64 3 %dead2 = select i1 %flag, * %gep2.1, * %gep2.2 store i64 1879048192, * %l3, align 8 %bc3 = bitcast * %l3 to * %gep3 = gep * %bc3, 1 x i64 3 br label %loop } => define i32 @test15(i1 %flag) { %entry: br label %loop %loop: br label %loop } Transformation doesn't verify! ERROR: Precondition is always false ---------------------------------------- define void @test16(* %src, * %dst) { %entry: %a = alloca i64 3, align 1 %ptr = gep * %a, 3 x i32 0, 1 x i32 0 memcpy * %ptr align 1, * %src align 1, i32 4 %cast = bitcast * %ptr to * store i24 0, * %cast, align 4 memcpy * %dst align 1, * %ptr align 1, i32 4 ret void } => define void @test16(* %src, * %dst) { %entry: %a.sroa.0.0.src.sroa_cast = bitcast * %src to * %a.sroa.0.0.copyload = load i24, * %a.sroa.0.0.src.sroa_cast, align 1 %a.sroa.0.0.dst.sroa_cast = bitcast * %dst to * store i24 0, * %a.sroa.0.0.dst.sroa_cast, align 1 ret void } Transformation seems to be correct! ---------------------------------------- define void @test17(* %src, * %dst) { %entry: %a = alloca i64 3, align 1 %ptr = gep * %a, 3 x i32 0, 1 x i32 0 memcpy * %ptr align 1, * %src align 1, i32 4 memcpy * %dst align 1, * %ptr align 1, i32 4 ret void } => define void @test17(* %src, * %dst) { %entry: %a = alloca i64 3, align 1 %ptr = gep * %a, 3 x i32 0, 1 x i32 0 memcpy * %ptr align 1, * %src align 1, i32 4 memcpy * %dst align 1, * %ptr align 1, i32 4 ret void } Transformation seems to be correct! ---------------------------------------- define void @test18(* %src, * %dst, i32 %size) { %entry: %a = alloca i64 42, align 1 %ptr = gep * %a, 42 x i32 0, 1 x i32 0 memcpy * %ptr align 1, * %src align 1, i32 8 %ptr2 = gep * %a, 42 x i32 0, 1 x i32 8 memcpy * %ptr2 align 1, * %src align 1, i32 %size memset * %ptr2 align 1, i8 42, i32 %size %cast = bitcast * %ptr to * store i32 42, * %cast, align 4 memcpy * %dst align 1, * %ptr align 1, i32 8 memcpy * %dst align 1, * %ptr2 align 1, i32 %size ret void } => define void @test18(* %src, * %dst, i32 %size) { %entry: %a.sroa.33 = alloca i64 34, align 1 %a.sroa.0.0.src.sroa_cast = bitcast * %src to * %a.sroa.0.0.copyload = load i32, * %a.sroa.0.0.src.sroa_cast, align 1 %a.sroa.3.0.src.sroa_idx = gep inbounds * %src, 1 x i64 4 %a.sroa.3.0.src.sroa_cast = bitcast * %a.sroa.3.0.src.sroa_idx to * %a.sroa.3.0.copyload = load i32, * %a.sroa.3.0.src.sroa_cast, align 1 %a.sroa.33.0.ptr2.sroa_idx = gep inbounds * %a.sroa.33, 34 x i64 0, 1 x i64 0 memcpy * %a.sroa.33.0.ptr2.sroa_idx align 1, * %src align 1, i32 %size %a.sroa.33.0.ptr2.sroa_idx6 = gep inbounds * %a.sroa.33, 34 x i64 0, 1 x i64 0 memset * %a.sroa.33.0.ptr2.sroa_idx6 align 1, i8 42, i32 %size %a.sroa.0.0.dst.sroa_cast = bitcast * %dst to * store i32 42, * %a.sroa.0.0.dst.sroa_cast, align 1 %a.sroa.3.0.dst.sroa_idx = gep inbounds * %dst, 1 x i64 4 %a.sroa.3.0.dst.sroa_cast = bitcast * %a.sroa.3.0.dst.sroa_idx to * store i32 %a.sroa.3.0.copyload, * %a.sroa.3.0.dst.sroa_cast, align 1 %a.sroa.33.0.ptr2.sroa_idx7 = gep inbounds * %a.sroa.33, 34 x i64 0, 1 x i64 0 memcpy * %dst align 1, * %a.sroa.33.0.ptr2.sroa_idx7 align 1, i32 %size ret void } Transformation seems to be correct! ---------------------------------------- define i32 @test19(* %x) { %entry: %a = alloca i64 16, align 8 %cast1 = bitcast * %x to * %cast2 = bitcast * %a to * memcpy * %cast2 align 1, * %cast1 align 1, i32 16 %gep = gep inbounds * %a, 16 x i32 0, 1 x i64 0 %val = load i64, * %gep, align 4 ret i32 undef } => define i32 @test19(* %x) { %entry: %cast1 = bitcast * %x to * %a.sroa.0.0.cast1.sroa_cast = bitcast * %cast1 to * %a.sroa.0.0.copyload = load i64, * %a.sroa.0.0.cast1.sroa_cast, align 1 %a.sroa.2.0.cast1.sroa_idx = gep inbounds * %cast1, 1 x i64 8 %a.sroa.2.0.cast1.sroa_cast = bitcast * %a.sroa.2.0.cast1.sroa_idx to * %a.sroa.2.0.copyload = load *, * %a.sroa.2.0.cast1.sroa_cast, align 1 ret i32 undef } Transformation seems to be correct! ERROR: Unsupported instruction: %cast1 = addrspacecast %opaque* %x to i8 addrspace(1)* ERROR: Unsupported instruction: %cast1 = addrspacecast %opaque* %x to i8 addrspace(1)* ---------------------------------------- define i32 @test20() { %entry: %a = alloca i64 12, align 4 %gep1 = gep * %a, 12 x i32 0, 4 x i32 0 store i32 1, * %gep1, align 4 %gep2.1 = gep * %a, 12 x i32 0, 4 x i32 4294967294 %gep2.2 = gep * %gep2.1, 4 x i32 3 store i32 2, * %gep2.2, align 4 %gep3.1 = gep * %a, 12 x i32 0, 4 x i32 14 %gep3.2 = gep * %gep3.1, 4 x i32 4294967284 store i32 3, * %gep3.2, align 4 %load1 = load i32, * %gep1, align 4 %load2 = load i32, * %gep2.2, align 4 %load3 = load i32, * %gep3.2, align 4 %sum1 = add i32 %load1, %load2 %sum2 = add i32 %sum1, %load3 ret i32 %sum2 } => define i32 @test20() { %entry: %sum1 = add i32 1, 2 %sum2 = add i32 %sum1, 3 ret i32 %sum2 } Transformation seems to be correct! ---------------------------------------- define i8 @test21() { %entry: %a = alloca i64 2305843009213693951, align 1 %gep0 = gep * %a, 4294967295 x i64 0, 1 x i64 2305843009213693949 store i8 255, * %gep0, align 1 %gep1 = gep * %a, 4294967295 x i64 0, 1 x i64 -9223372036854775807 %gep2 = gep * %gep1, 1 x i64 -1 memset * %gep2 align 1, i8 0, i64 -1 %gep3 = gep * %gep1, 1 x i64 9223372036854775807 %gep4 = gep * %gep3, 1 x i64 9223372036854775807 %gep5 = gep * %gep4, 1 x i64 -6917529027641081857 store i8 255, * %gep5, align 1 %cast1 = bitcast * %gep4 to * store i32 0, * %cast1, align 4 %load = load i8, * %gep0, align 1 %gep6 = gep * %gep0, 1 x i32 1 %load2 = load i8, * %gep6, align 1 %result = or i8 %load, %load2 ret i8 %result } => define i8 @test21() { %entry: %result = or i8 255, 255 ret i8 %result } Transformation seems to be correct! ---------------------------------------- define void @PR13916.1() { %entry: %a = alloca i64 1, align 1 memcpy * %a align 1, * %a align 1, i32 1 %tmp2 = load i8, * %a, align 1 ret void } => define void @PR13916.1() { %entry: ret void } Transformation seems to be correct! ---------------------------------------- define void @PR13916.2() { %entry: %a = alloca i64 1, align 1 br i1 undef, label %if.then, label %if.end %if.then: %tmp0 = bitcast * %a to * %tmp1 = bitcast * %a to * memcpy * %tmp0 align 1, * %tmp1 align 1, i32 1 br label %if.end %if.end: %gep = gep * %a, 1 x i32 0, 1 x i64 0 %tmp2 = load i8, * %gep, align 1 ret void } => define void @PR13916.2() { %entry: br i1 undef, label %if.then, label %if.end %if.then: br label %if.end %if.end: ret void } Transformation seems to be correct! ---------------------------------------- define void @PR13990() { %entry: %tmp1 = alloca i64 8, align 8 %tmp2 = alloca i64 8, align 8 br i1 undef, label %bb1, label %bb2 %bb1: store * undef, * %tmp2, align 8 br i1 undef, label %bb2, label %bb3 %bb2: %tmp50 = select i1 undef, * %tmp2, * %tmp1 br i1 undef, label %bb3, label %bb4 %bb4: assume i1 0 %bb3: assume i1 0 } => define void @PR13990() { %entry: br i1 undef, label %bb1, label %bb2 %bb1: br i1 undef, label %bb2, label %bb3 %bb2: br i1 undef, label %bb3, label %bb4 %bb4: assume i1 0 %bb3: assume i1 0 } Transformation seems to be correct! ---------------------------------------- define double @PR13969(double %x) { %entry: %a = alloca i64 8, align 8 %b = alloca i64 8, align 8 %c = alloca i64 8, align 8 store double %x, * %a, align 8 store * %c, * %b, align 8 store * %a, * %b, align 8 store double %x, * %c, align 8 %ret = load double, * %a, align 8 ret double %ret } => define double @PR13969(double %x) { %entry: ret double %x } Transformation seems to be correct! ---------------------------------------- define void @PR14034() { %entry: %a = alloca i64 24, align 8 %list = gep * %a, 24 x i32 0, 1 x i64 8 %prev = gep * %list, 16 x i32 0, 1 x i64 8 store * undef, * %prev, align 8 %cast0 = bitcast * undef to * %cast1 = bitcast * %a to * memcpy * %cast0 align 1, * %cast1 align 1, i32 12 ret void } => define void @PR14034() { %entry: %a.sroa.0 = alloca i64 12, align 8 %a.sroa.0.0.cast1.sroa_idx = gep inbounds * %a.sroa.0, 12 x i64 0, 1 x i64 0 memcpy * undef align 1, * %a.sroa.0.0.cast1.sroa_idx align 8, i32 12 ret void } Transformation seems to be correct! ---------------------------------------- define i32 @test22(i32 %x) { %entry: %a1 = alloca i64 4, align 8 %a2 = alloca i64 4, align 8 %a3 = alloca i64 8, align 8 %wrap1 = insertvalue [1 x {i32}] undef, i32 %x, 0, 0 %gep1 = gep * %a1, 4 x i32 0, 1 x i64 0, 1 x i64 0 store [1 x {i32}] %wrap1, * %gep1, align 4 %gep2 = gep * %a1, 4 x i32 0, 1 x i64 0 %ptrcast1 = bitcast * %gep2 to * %load1 = load {[1 x {float}]}, * %ptrcast1, align 4 %unwrap1 = extractvalue {[1 x {float}]} %load1, 0, 0 %wrap2 = insertvalue {, {float}, (empty array)} undef, {float} %unwrap1, 1 store {, {float}, (empty array)} %wrap2, * %a2, align 4 %gep3 = gep * %a2, 4 x i32 0, 1 x i64 0, 1 x i64 0 %ptrcast2 = bitcast * %gep3 to * %load3 = load <4 x i8>, * %ptrcast2, align 4 %valcast1 = bitcast <4 x i8> %load3 to i32 %wrap3 = insertvalue [1 x [1 x i32]] undef, i32 %valcast1, 0, 0 %wrap4 = insertvalue {[1 x [1 x i32]], } undef, [1 x [1 x i32]] %wrap3, 0 %gep4 = gep * %a3, 8 x i32 0, 1 x i64 0 %ptrcast3 = bitcast * %gep4 to * store {[1 x [1 x i32]], } %wrap4, * %ptrcast3, align 4 %gep5 = gep * %a3, 8 x i32 0, 1 x i64 0, 1 x i64 0, 4 x i32 0 %ptrcast4 = bitcast * %gep5 to * %load4 = load {, float, }, * %ptrcast4, align 4 %unwrap2 = extractvalue {, float, } %load4, 1 %valcast2 = bitcast float %unwrap2 to i32 ret i32 %valcast2 } => define i32 @test22(i32 %x) { %entry: %wrap1 = insertvalue [1 x {i32}] undef, i32 %x, 0, 0 %wrap1.fca.0.0.extract = extractvalue [1 x {i32}] %wrap1, 0, 0 %0 = bitcast i32 %wrap1.fca.0.0.extract to float %load1.fca.0.0.0.insert = insertvalue {[1 x {float}]} undef, float %0, 0, 0, 0 %unwrap1 = extractvalue {[1 x {float}]} %load1.fca.0.0.0.insert, 0, 0 %wrap2 = insertvalue {, {float}, (empty array)} undef, {float} %unwrap1, 1 %wrap2.fca.1.0.extract = extractvalue {, {float}, (empty array)} %wrap2, 1, 0 %1 = bitcast float %wrap2.fca.1.0.extract to <4 x i8> %valcast1 = bitcast <4 x i8> %1 to i32 %wrap3 = insertvalue [1 x [1 x i32]] undef, i32 %valcast1, 0, 0 %wrap4 = insertvalue {[1 x [1 x i32]], } undef, [1 x [1 x i32]] %wrap3, 0 %wrap4.fca.0.0.0.extract = extractvalue {[1 x [1 x i32]], } %wrap4, 0, 0, 0 %2 = bitcast i32 %wrap4.fca.0.0.0.extract to float %load4.fca.1.insert = insertvalue {, float, } undef, float %2, 1 %unwrap2 = extractvalue {, float, } %load4.fca.1.insert, 1 %valcast2 = bitcast float %unwrap2 to i32 ret i32 %valcast2 } Transformation seems to be correct! ---------------------------------------- define void @PR14059.1(* %d) { %entry: %X.sroa.0.i = alloca i64 8, align 8, dead %0 = bitcast * %X.sroa.0.i to * start_lifetime * %0 %X.sroa.0.0.cast2.i = bitcast * %X.sroa.0.i to * store i32 0, * %X.sroa.0.0.cast2.i, align 8 %X.sroa.0.2.raw_idx2.i = gep inbounds * %0, 1 x i32 2 memset * %X.sroa.0.2.raw_idx2.i align 1, i8 0, i64 4 memset * %0 align 1, i8 0, i64 8 %X.sroa.0.4.raw_idx4.i = gep inbounds * %0, 1 x i32 4 %d.raw = bitcast * %d to * memcpy * %X.sroa.0.4.raw_idx4.i align 1, * %d.raw align 1, i32 4 %X.sroa.0.4.cast5.i = bitcast * %X.sroa.0.4.raw_idx4.i to * store i32 1072693248, * %X.sroa.0.4.cast5.i, align 4 %X.sroa.0.0.load1.i = load double, * %X.sroa.0.i, align 8 %accum.real.i = load double, * %d, align 8 %add.r.i = fadd double %accum.real.i, %X.sroa.0.0.load1.i store double %add.r.i, * %d, align 8 free * %0 unconstrained ret void } => define void @PR14059.1(* %d) { %entry: %0 = bitcast double undef to i64 %X.sroa.0.i.0.insert.mask = and i64 %0, -4294967296 %1 = bitcast i64 %X.sroa.0.i.0.insert.mask to double %2 = bitcast double %1 to i64 %X.sroa.0.i.2.insert.mask = and i64 %2, -281474976645121 %3 = bitcast i64 %X.sroa.0.i.2.insert.mask to double %4 = bitcast double %3 to i64 %X.sroa.0.i.4.d.raw.sroa_cast = bitcast * %d to * %X.sroa.0.i.4.copyload = load i32, * %X.sroa.0.i.4.d.raw.sroa_cast, align 1 %5 = bitcast double 0.000000 to i64 %X.sroa.0.i.4.insert.ext = zext i32 %X.sroa.0.i.4.copyload to i64 %X.sroa.0.i.4.insert.shift = shl i64 %X.sroa.0.i.4.insert.ext, 32 %X.sroa.0.i.4.insert.mask4 = and i64 %5, 4294967295 %X.sroa.0.i.4.insert.insert5 = or i64 %X.sroa.0.i.4.insert.mask4, %X.sroa.0.i.4.insert.shift %6 = bitcast i64 %X.sroa.0.i.4.insert.insert5 to double %7 = bitcast double %6 to i64 %X.sroa.0.i.4.insert.mask = and i64 %7, 4294967295 %X.sroa.0.i.4.insert.insert = or i64 %X.sroa.0.i.4.insert.mask, 4607182418800017408 %8 = bitcast i64 %X.sroa.0.i.4.insert.insert to double %accum.real.i = load double, * %d, align 8 %add.r.i = fadd double %accum.real.i, %8 store double %add.r.i, * %d, align 8 ret void } Transformation doesn't verify! ERROR: Mismatch in memory Example: * %d = pointer(non-local, block_id=1, offset=0) Source: * %X.sroa.0.i = pointer(local, block_id=2, offset=0) * %0 = pointer(local, block_id=2, offset=0) * %X.sroa.0.0.cast2.i = pointer(local, block_id=2, offset=0) * %X.sroa.0.2.raw_idx2.i = pointer(local, block_id=2, offset=2) * %X.sroa.0.4.raw_idx4.i = pointer(local, block_id=2, offset=4) * %d.raw = pointer(non-local, block_id=1, offset=0) * %X.sroa.0.4.cast5.i = pointer(local, block_id=2, offset=4) double %X.sroa.0.0.load1.i = #x3ff0000000000000 (1) double %accum.real.i = #x3f7104807ff00880 (0.004154684021?) double %add.r.i = #x3ff01104807ff008 (1.004154684021?) SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 64 alloc type: 0 Block 1 > size: 132 align: 0 alloc type: 0 LOCAL BLOCKS: Block 2 > size: 8 align: 8 alloc type: 1 Target: i64 %0 = #x7fffffffffffffff (9223372036854775807) [based on undef value] i64 %X.sroa.0.i.0.insert.mask = #x7fffffff00000000 (9223372032559808512) double %1 = NaN i64 %2 = #x7fffffffffffffff (9223372036854775807) i64 %X.sroa.0.i.2.insert.mask = #x7fff00000000ffff (9223090561878130687) double %3 = NaN i64 %4 = #x7fffffffffffffff (9223372036854775807) * %X.sroa.0.i.4.d.raw.sroa_cast = pointer(non-local, block_id=1, offset=0) i32 %X.sroa.0.i.4.copyload = #x7ff00880 (2146437248) i64 %5 = #x0000000000000000 (0) i64 %X.sroa.0.i.4.insert.ext = #x000000007ff00880 (2146437248) i64 %X.sroa.0.i.4.insert.shift = #x7ff0088000000000 (9218877783076241408) i64 %X.sroa.0.i.4.insert.mask4 = #x0000000000000000 (0) i64 %X.sroa.0.i.4.insert.insert5 = #x7ff0088000000000 (9218877783076241408) double %6 = NaN i64 %7 = #x7ff00000020000f8 (9218868437260959992) i64 %X.sroa.0.i.4.insert.mask = #x00000000020000f8 (33554680) i64 %X.sroa.0.i.4.insert.insert = #x3ff00000020000f8 (4607182418833572088) double %8 = #x3ff00000020000f8 (1.000000007450?) double %accum.real.i = #x3f7104807ff00880 (0.004154684021?) double %add.r.i = #x3ff01104827ff100 (1.004154691471?) TARGET MEMORY STATE =================== LOCAL BLOCKS: Block 2 > size: 0 align: 64 alloc type: 0 Mismatch in pointer(non-local, block_id=1, offset=0) Source value: #x08 Target value: #x00 ------------------- SMT STATS ------------------- Num queries: 40 Num invalid: 0 Num skips: 0 Num trivial: 87 (68.5%) Num timeout: 2 (5.0%) Num errors: 0 (0.0%) Num SAT: 26 (65.0%) Num UNSAT: 12 (30.0%)
+ : 'RUN: at line 1' + /home/nlopes/alive2/scripts/opt-alive.sh -sroa -S + /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SROA/basictest.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/SROA/basictest.ll