Test Failure: Transforms/SROA/basictest-opaque-ptrs.ll

Test source: git

Comments: LLVM bug: memcpy -> load/store

Log:

Source: <stdin>
ERROR: Unsupported instruction:   %B = addrspacecast ptr %A to ptr addrspace(1)
ERROR: Unsupported instruction:   %B = addrspacecast ptr %A to ptr addrspace(1)
ERROR: Unsupported instruction:   %B = addrspacecast ptr %A to ptr addrspace(1)
ERROR: Unsupported instruction:   %fptr.as1 = addrspacecast ptr %fptr to ptr addrspace(1)
ERROR: Unsupported instruction:   %cast1 = addrspacecast ptr %x to ptr addrspace(1)
ERROR: Unsupported instruction:   %cond.in = select i1 undef, ptr %c, ptr %p.0.c
ERROR: Unsupported instruction:   store volatile i16 42, ptr %a.cast, align 2
ERROR: Unsupported instruction:   store volatile i16 42, ptr %a.cast2, align 2
ERROR: Unsupported instruction:   store atomic volatile i64 0, ptr %ptr seq_cst, align 8

----------------------------------------
define i32 @test0() {
%entry:
  %a1 = alloca i64 4, align 4, dead
  %a2 = alloca i64 4, align 4, dead
  %a1.i8 = bitcast ptr %a1 to ptr
  start_lifetime ptr %a1.i8
  store i32 0, ptr %a1, align 4
  %v1 = load i32, ptr %a1, align 4
  free ptr %a1.i8 unconstrained
  %a2.i8 = bitcast ptr %a2 to ptr
  start_lifetime ptr %a2.i8
  store float 0.000000, ptr %a2, align 4
  %v2 = load float, ptr %a2, align 4
  %v2.int = bitcast float %v2 to i32
  %sum1 = add i32 %v1, %v2.int
  free ptr %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 ptr %X, 8 x i64 0, 1 x i64 0
  store i32 0, ptr %Y, align 4
  %Z = load i32, ptr %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 ptr %A to ptr
  store i64 %X, ptr %B, align 4
  br label %L2

%L2:
  %Z = load i64, ptr %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:   %A.sroa.0.2.gepB.sroa_cast = addrspacecast ptr %A.sroa.0.2.gepB.sroa_idx to ptr addrspace(1)

----------------------------------------
define void @test3(ptr %dst, ptr align(8) %src) {
%entry:
  %a = alloca i64 300, align 1
  %b = gep ptr %a, 300 x i64 0, 1 x i64 0
  memcpy ptr %b align 1, ptr align(8) %src align 8, i32 300
  %c = gep ptr %a, 300 x i64 0, 1 x i64 42
  store i8 0, ptr %c, align 1
  %overlap.1.i8 = gep ptr %a, 300 x i64 0, 1 x i64 142
  %overlap.2.i8 = gep ptr %a, 300 x i64 0, 1 x i64 143
  %overlap.3.i8 = gep ptr %a, 300 x i64 0, 1 x i64 144
  %overlap.4.i8 = gep ptr %a, 300 x i64 0, 1 x i64 145
  %overlap.5.i8 = gep ptr %a, 300 x i64 0, 1 x i64 146
  %overlap.6.i8 = gep ptr %a, 300 x i64 0, 1 x i64 147
  %overlap.7.i8 = gep ptr %a, 300 x i64 0, 1 x i64 148
  %overlap.8.i8 = gep ptr %a, 300 x i64 0, 1 x i64 149
  %overlap.9.i8 = gep ptr %a, 300 x i64 0, 1 x i64 150
  %overlap.1.i16 = bitcast ptr %overlap.1.i8 to ptr
  %overlap.1.i32 = bitcast ptr %overlap.1.i8 to ptr
  %overlap.1.i64 = bitcast ptr %overlap.1.i8 to ptr
  %overlap.2.i64 = bitcast ptr %overlap.2.i8 to ptr
  %overlap.3.i64 = bitcast ptr %overlap.3.i8 to ptr
  %overlap.4.i64 = bitcast ptr %overlap.4.i8 to ptr
  %overlap.5.i64 = bitcast ptr %overlap.5.i8 to ptr
  %overlap.6.i64 = bitcast ptr %overlap.6.i8 to ptr
  %overlap.7.i64 = bitcast ptr %overlap.7.i8 to ptr
  %overlap.8.i64 = bitcast ptr %overlap.8.i8 to ptr
  %overlap.9.i64 = bitcast ptr %overlap.9.i8 to ptr
  store i8 1, ptr %overlap.1.i8, align 1
  store i16 1, ptr %overlap.1.i16, align 2
  store i32 1, ptr %overlap.1.i32, align 4
  store i64 1, ptr %overlap.1.i64, align 4
  store i64 2, ptr %overlap.2.i64, align 4
  store i64 3, ptr %overlap.3.i64, align 4
  store i64 4, ptr %overlap.4.i64, align 4
  store i64 5, ptr %overlap.5.i64, align 4
  store i64 6, ptr %overlap.6.i64, align 4
  store i64 7, ptr %overlap.7.i64, align 4
  store i64 8, ptr %overlap.8.i64, align 4
  store i64 9, ptr %overlap.9.i64, align 4
  %overlap2.1.0.i8 = gep ptr %a, 300 x i64 0, 1 x i64 200
  %overlap2.1.1.i8 = gep ptr %a, 300 x i64 0, 1 x i64 201
  %overlap2.1.2.i8 = gep ptr %a, 300 x i64 0, 1 x i64 202
  %overlap2.1.3.i8 = gep ptr %a, 300 x i64 0, 1 x i64 203
  %overlap2.2.0.i8 = gep ptr %a, 300 x i64 0, 1 x i64 208
  %overlap2.2.1.i8 = gep ptr %a, 300 x i64 0, 1 x i64 209
  %overlap2.2.2.i8 = gep ptr %a, 300 x i64 0, 1 x i64 210
  %overlap2.2.3.i8 = gep ptr %a, 300 x i64 0, 1 x i64 211
  %overlap2.1.0.i16 = bitcast ptr %overlap2.1.0.i8 to ptr
  %overlap2.1.0.i32 = bitcast ptr %overlap2.1.0.i8 to ptr
  %overlap2.1.1.i32 = bitcast ptr %overlap2.1.1.i8 to ptr
  %overlap2.1.2.i32 = bitcast ptr %overlap2.1.2.i8 to ptr
  %overlap2.1.3.i32 = bitcast ptr %overlap2.1.3.i8 to ptr
  store i8 1, ptr %overlap2.1.0.i8, align 1
  store i16 1, ptr %overlap2.1.0.i16, align 2
  store i32 1, ptr %overlap2.1.0.i32, align 4
  store i32 2, ptr %overlap2.1.1.i32, align 4
  store i32 3, ptr %overlap2.1.2.i32, align 4
  store i32 4, ptr %overlap2.1.3.i32, align 4
  %overlap2.2.0.i32 = bitcast ptr %overlap2.2.0.i8 to ptr
  %overlap2.2.1.i16 = bitcast ptr %overlap2.2.1.i8 to ptr
  %overlap2.2.1.i32 = bitcast ptr %overlap2.2.1.i8 to ptr
  %overlap2.2.2.i32 = bitcast ptr %overlap2.2.2.i8 to ptr
  %overlap2.2.3.i32 = bitcast ptr %overlap2.2.3.i8 to ptr
  store i32 1, ptr %overlap2.2.0.i32, align 4
  store i8 1, ptr %overlap2.2.1.i8, align 1
  store i16 1, ptr %overlap2.2.1.i16, align 2
  store i32 1, ptr %overlap2.2.1.i32, align 4
  store i32 3, ptr %overlap2.2.2.i32, align 4
  store i32 4, ptr %overlap2.2.3.i32, align 4
  %overlap2.prefix = gep ptr %overlap2.1.1.i8, 1 x i64 -4
  memcpy ptr %overlap2.prefix align 1, ptr align(8) %src align 1, i32 8
  memset ptr %overlap2.1.2.i8 align 1, i8 42, i32 8
  memcpy ptr %overlap2.2.1.i8 align 1, ptr align(8) %src align 1, i32 5
  memcpy ptr %overlap2.2.2.i8 align 1, ptr align(8) %src align 1, i32 8
  memcpy ptr %dst align 1, ptr %b align 1, i32 300
  ret void
}
=>
define void @test3(ptr %dst, ptr align(8) %src) {
%entry:
  %a.sroa.0 = alloca i64 42, align 1
  %a.sroa.3 = alloca i64 99, align 1
  %a.sroa.32 = alloca i64 16, align 1
  %a.sroa.15 = alloca i64 42, align 1
  %a.sroa.16 = alloca i64 7, align 1
  %a.sroa.234 = alloca i64 7, align 1
  %a.sroa.31 = alloca i64 85, align 1
  memcpy ptr %a.sroa.0 align 1, ptr align(8) %src align 8, i32 42
  %a.sroa.2.0.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 42
  %a.sroa.2.0.copyload = load i8, ptr %a.sroa.2.0.src.sroa_idx, align 2
  %a.sroa.3.0.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 43
  memcpy ptr %a.sroa.3 align 1, ptr %a.sroa.3.0.src.sroa_idx align 1, i32 99
  %a.sroa.32.0.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 142
  memcpy ptr %a.sroa.32 align 1, ptr %a.sroa.32.0.src.sroa_idx align 2, i32 16
  %a.sroa.15.0.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 158
  memcpy ptr %a.sroa.15 align 1, ptr %a.sroa.15.0.src.sroa_idx align 2, i32 42
  %a.sroa.16.0.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 200
  memcpy ptr %a.sroa.16 align 1, ptr %a.sroa.16.0.src.sroa_idx align 8, i32 7
  %a.sroa.23.0.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 207
  %a.sroa.23.0.copyload = load i8, ptr %a.sroa.23.0.src.sroa_idx, align 1
  %a.sroa.234.0.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 208
  memcpy ptr %a.sroa.234 align 1, ptr %a.sroa.234.0.src.sroa_idx align 8, i32 7
  %a.sroa.31.0.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 215
  memcpy ptr %a.sroa.31 align 1, ptr %a.sroa.31.0.src.sroa_idx align 1, i32 85
  store i8 1, ptr %a.sroa.32, align 1
  store i16 1, ptr %a.sroa.32, align 1
  store i32 1, ptr %a.sroa.32, align 1
  store i64 1, ptr %a.sroa.32, align 1
  %a.sroa.32.1.overlap.2.i64.sroa_idx = gep inbounds ptr %a.sroa.32, 1 x i64 1
  store i64 2, ptr %a.sroa.32.1.overlap.2.i64.sroa_idx, align 1
  %a.sroa.32.2.overlap.3.i64.sroa_idx = gep inbounds ptr %a.sroa.32, 1 x i64 2
  store i64 3, ptr %a.sroa.32.2.overlap.3.i64.sroa_idx, align 1
  %a.sroa.32.3.overlap.4.i64.sroa_idx = gep inbounds ptr %a.sroa.32, 1 x i64 3
  store i64 4, ptr %a.sroa.32.3.overlap.4.i64.sroa_idx, align 1
  %a.sroa.32.4.overlap.5.i64.sroa_idx = gep inbounds ptr %a.sroa.32, 1 x i64 4
  store i64 5, ptr %a.sroa.32.4.overlap.5.i64.sroa_idx, align 1
  %a.sroa.32.5.overlap.6.i64.sroa_idx = gep inbounds ptr %a.sroa.32, 1 x i64 5
  store i64 6, ptr %a.sroa.32.5.overlap.6.i64.sroa_idx, align 1
  %a.sroa.32.6.overlap.7.i64.sroa_idx = gep inbounds ptr %a.sroa.32, 1 x i64 6
  store i64 7, ptr %a.sroa.32.6.overlap.7.i64.sroa_idx, align 1
  %a.sroa.32.7.overlap.8.i64.sroa_idx = gep inbounds ptr %a.sroa.32, 1 x i64 7
  store i64 8, ptr %a.sroa.32.7.overlap.8.i64.sroa_idx, align 1
  %a.sroa.32.8.overlap.9.i64.sroa_idx = gep inbounds ptr %a.sroa.32, 1 x i64 8
  store i64 9, ptr %a.sroa.32.8.overlap.9.i64.sroa_idx, align 1
  store i8 1, ptr %a.sroa.16, align 1
  store i16 1, ptr %a.sroa.16, align 1
  store i32 1, ptr %a.sroa.16, align 1
  %a.sroa.16.1.overlap2.1.1.i32.sroa_idx = gep inbounds ptr %a.sroa.16, 1 x i64 1
  store i32 2, ptr %a.sroa.16.1.overlap2.1.1.i32.sroa_idx, align 1
  %a.sroa.16.2.overlap2.1.2.i32.sroa_idx = gep inbounds ptr %a.sroa.16, 1 x i64 2
  store i32 3, ptr %a.sroa.16.2.overlap2.1.2.i32.sroa_idx, align 1
  %a.sroa.16.3.overlap2.1.3.i32.sroa_idx = gep inbounds ptr %a.sroa.16, 1 x i64 3
  store i32 4, ptr %a.sroa.16.3.overlap2.1.3.i32.sroa_idx, align 1
  store i32 1, ptr %a.sroa.234, align 1
  %a.sroa.234.1.overlap2.2.1.i8.sroa_idx = gep inbounds ptr %a.sroa.234, 1 x i64 1
  store i8 1, ptr %a.sroa.234.1.overlap2.2.1.i8.sroa_idx, align 1
  %a.sroa.234.1.overlap2.2.1.i16.sroa_idx = gep inbounds ptr %a.sroa.234, 1 x i64 1
  store i16 1, ptr %a.sroa.234.1.overlap2.2.1.i16.sroa_idx, align 1
  %a.sroa.234.1.overlap2.2.1.i32.sroa_idx = gep inbounds ptr %a.sroa.234, 1 x i64 1
  store i32 1, ptr %a.sroa.234.1.overlap2.2.1.i32.sroa_idx, align 1
  %a.sroa.234.2.overlap2.2.2.i32.sroa_idx = gep inbounds ptr %a.sroa.234, 1 x i64 2
  store i32 3, ptr %a.sroa.234.2.overlap2.2.2.i32.sroa_idx, align 1
  %a.sroa.234.3.overlap2.2.3.i32.sroa_idx = gep inbounds ptr %a.sroa.234, 1 x i64 3
  store i32 4, ptr %a.sroa.234.3.overlap2.2.3.i32.sroa_idx, align 1
  %a.sroa.15.197.overlap2.prefix.sroa_idx = gep inbounds ptr %a.sroa.15, 1 x i64 39
  memcpy ptr %a.sroa.15.197.overlap2.prefix.sroa_idx align 1, ptr align(8) %src align 1, i32 3
  %a.sroa.16.197.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 3
  memcpy ptr %a.sroa.16 align 1, ptr %a.sroa.16.197.src.sroa_idx align 1, i32 5
  %a.sroa.16.2.overlap2.1.2.i8.sroa_idx = gep inbounds ptr %a.sroa.16, 1 x i64 2
  memset ptr %a.sroa.16.2.overlap2.1.2.i8.sroa_idx align 1, i8 42, i32 5
  memset ptr %a.sroa.234 align 1, i8 42, i32 2
  %a.sroa.234.209.overlap2.2.1.i8.sroa_idx5 = gep inbounds ptr %a.sroa.234, 1 x i64 1
  memcpy ptr %a.sroa.234.209.overlap2.2.1.i8.sroa_idx5 align 1, ptr align(8) %src align 1, i32 5
  %a.sroa.234.210.overlap2.2.2.i8.sroa_idx = gep inbounds ptr %a.sroa.234, 1 x i64 2
  memcpy ptr %a.sroa.234.210.overlap2.2.2.i8.sroa_idx align 1, ptr align(8) %src align 1, i32 5
  %a.sroa.31.210.src.sroa_idx = gep inbounds ptr align(8) %src, 1 x i64 5
  memcpy ptr %a.sroa.31 align 1, ptr %a.sroa.31.210.src.sroa_idx align 1, i32 3
  memcpy ptr %dst align 1, ptr %a.sroa.0 align 1, i32 42
  %a.sroa.2.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 42
  store i8 0, ptr %a.sroa.2.0.dst.sroa_idx, align 1
  %a.sroa.3.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 43
  memcpy ptr %a.sroa.3.0.dst.sroa_idx align 1, ptr %a.sroa.3 align 1, i32 99
  %a.sroa.32.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 142
  memcpy ptr %a.sroa.32.0.dst.sroa_idx align 1, ptr %a.sroa.32 align 1, i32 16
  %a.sroa.15.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 158
  memcpy ptr %a.sroa.15.0.dst.sroa_idx align 1, ptr %a.sroa.15 align 1, i32 42
  %a.sroa.16.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 200
  memcpy ptr %a.sroa.16.0.dst.sroa_idx align 1, ptr %a.sroa.16 align 1, i32 7
  %a.sroa.23.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 207
  store i8 42, ptr %a.sroa.23.0.dst.sroa_idx, align 1
  %a.sroa.234.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 208
  memcpy ptr %a.sroa.234.0.dst.sroa_idx align 1, ptr %a.sroa.234 align 1, i32 7
  %a.sroa.31.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 215
  memcpy ptr %a.sroa.31.0.dst.sroa_idx align 1, ptr %a.sroa.31 align 1, i32 85
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test4(ptr %dst, ptr %src) {
%entry:
  %a = alloca i64 100, align 1
  %b = gep ptr %a, 100 x i64 0, 1 x i64 0
  memcpy ptr %b align 1, ptr %src align 1, i32 100
  %a.src.1 = gep ptr %a, 100 x i64 0, 1 x i64 20
  %a.dst.1 = gep ptr %a, 100 x i64 0, 1 x i64 40
  memcpy ptr %a.dst.1 align 1, ptr %a.src.1 align 1, i32 10
  %c = gep ptr %a, 100 x i64 0, 1 x i64 42
  store i8 0, ptr %c, align 1
  %a.src.2 = gep ptr %a, 100 x i64 0, 1 x i64 50
  memmove ptr %a.dst.1 align 1, ptr %a.src.2 align 1, i32 10
  memcpy ptr %dst align 1, ptr %b align 1, i32 100
  ret void
}
=>
define void @test4(ptr %dst, ptr %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.31.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
  memcpy ptr %a.sroa.0 align 1, ptr %src align 1, i32 20
  %a.sroa.2.0.src.sroa_idx = gep inbounds ptr %src, 1 x i64 20
  %a.sroa.2.sroa.0.0.copyload = load i16, ptr %a.sroa.2.0.src.sroa_idx, align 1
  %a.sroa.2.sroa.3.0.a.sroa.2.0.src.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.2.0.src.sroa_idx, 1 x i64 2
  %a.sroa.2.sroa.3.0.copyload = load i8, ptr %a.sroa.2.sroa.3.0.a.sroa.2.0.src.sroa_idx.sroa_idx, align 1
  %a.sroa.2.sroa.4.0.a.sroa.2.0.src.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.2.0.src.sroa_idx, 1 x i64 3
  memcpy ptr %a.sroa.2.sroa.4 align 1, ptr %a.sroa.2.sroa.4.0.a.sroa.2.0.src.sroa_idx.sroa_idx align 1, i32 7
  %a.sroa.3.0.src.sroa_idx = gep inbounds ptr %src, 1 x i64 30
  memcpy ptr %a.sroa.3 align 1, ptr %a.sroa.3.0.src.sroa_idx align 1, i32 10
  %a.sroa.31.0.src.sroa_idx = gep inbounds ptr %src, 1 x i64 40
  %a.sroa.31.sroa.0.0.copyload = load i16, ptr %a.sroa.31.0.src.sroa_idx, align 1
  %a.sroa.31.sroa.4.0.a.sroa.31.0.src.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.31.0.src.sroa_idx, 1 x i64 2
  %a.sroa.31.sroa.4.0.copyload = load i8, ptr %a.sroa.31.sroa.4.0.a.sroa.31.0.src.sroa_idx.sroa_idx, align 1
  %a.sroa.31.sroa.5.0.a.sroa.31.0.src.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.31.0.src.sroa_idx, 1 x i64 3
  memcpy ptr %a.sroa.31.sroa.5 align 1, ptr %a.sroa.31.sroa.5.0.a.sroa.31.0.src.sroa_idx.sroa_idx align 1, i32 7
  %a.sroa.6.0.src.sroa_idx = gep inbounds ptr %src, 1 x i64 50
  %a.sroa.6.sroa.0.0.copyload = load i16, ptr %a.sroa.6.0.src.sroa_idx, align 1
  %a.sroa.6.sroa.3.0.a.sroa.6.0.src.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.6.0.src.sroa_idx, 1 x i64 2
  %a.sroa.6.sroa.3.0.copyload = load i8, ptr %a.sroa.6.sroa.3.0.a.sroa.6.0.src.sroa_idx.sroa_idx, align 1
  %a.sroa.6.sroa.4.0.a.sroa.6.0.src.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.6.0.src.sroa_idx, 1 x i64 3
  memcpy ptr %a.sroa.6.sroa.4 align 1, ptr %a.sroa.6.sroa.4.0.a.sroa.6.0.src.sroa_idx.sroa_idx align 1, i32 7
  %a.sroa.7.0.src.sroa_idx = gep inbounds ptr %src, 1 x i64 60
  memcpy ptr %a.sroa.7 align 1, ptr %a.sroa.7.0.src.sroa_idx align 1, i32 40
  memcpy ptr %a.sroa.31.sroa.5 align 1, ptr %a.sroa.2.sroa.4 align 1, i32 7
  memcpy ptr %a.sroa.31.sroa.5 align 1, ptr %a.sroa.6.sroa.4 align 1, i32 7
  memcpy ptr %dst align 1, ptr %a.sroa.0 align 1, i32 20
  %a.sroa.2.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 20
  store i16 %a.sroa.2.sroa.0.0.copyload, ptr %a.sroa.2.0.dst.sroa_idx, align 1
  %a.sroa.2.sroa.3.0.a.sroa.2.0.dst.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.2.0.dst.sroa_idx, 1 x i64 2
  store i8 %a.sroa.2.sroa.3.0.copyload, ptr %a.sroa.2.sroa.3.0.a.sroa.2.0.dst.sroa_idx.sroa_idx, align 1
  %a.sroa.2.sroa.4.0.a.sroa.2.0.dst.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.2.0.dst.sroa_idx, 1 x i64 3
  memcpy ptr %a.sroa.2.sroa.4.0.a.sroa.2.0.dst.sroa_idx.sroa_idx align 1, ptr %a.sroa.2.sroa.4 align 1, i32 7
  %a.sroa.3.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 30
  memcpy ptr %a.sroa.3.0.dst.sroa_idx align 1, ptr %a.sroa.3 align 1, i32 10
  %a.sroa.31.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 40
  store i16 %a.sroa.6.sroa.0.0.copyload, ptr %a.sroa.31.0.dst.sroa_idx, align 1
  %a.sroa.31.sroa.4.0.a.sroa.31.0.dst.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.31.0.dst.sroa_idx, 1 x i64 2
  store i8 %a.sroa.6.sroa.3.0.copyload, ptr %a.sroa.31.sroa.4.0.a.sroa.31.0.dst.sroa_idx.sroa_idx, align 1
  %a.sroa.31.sroa.5.0.a.sroa.31.0.dst.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.31.0.dst.sroa_idx, 1 x i64 3
  memcpy ptr %a.sroa.31.sroa.5.0.a.sroa.31.0.dst.sroa_idx.sroa_idx align 1, ptr %a.sroa.31.sroa.5 align 1, i32 7
  %a.sroa.6.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 50
  store i16 %a.sroa.6.sroa.0.0.copyload, ptr %a.sroa.6.0.dst.sroa_idx, align 1
  %a.sroa.6.sroa.3.0.a.sroa.6.0.dst.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.6.0.dst.sroa_idx, 1 x i64 2
  store i8 %a.sroa.6.sroa.3.0.copyload, ptr %a.sroa.6.sroa.3.0.a.sroa.6.0.dst.sroa_idx.sroa_idx, align 1
  %a.sroa.6.sroa.4.0.a.sroa.6.0.dst.sroa_idx.sroa_idx = gep inbounds ptr %a.sroa.6.0.dst.sroa_idx, 1 x i64 3
  memcpy ptr %a.sroa.6.sroa.4.0.a.sroa.6.0.dst.sroa_idx.sroa_idx align 1, ptr %a.sroa.6.sroa.4 align 1, i32 7
  %a.sroa.7.0.dst.sroa_idx = gep inbounds ptr %dst, 1 x i64 60
  memcpy ptr %a.sroa.7.0.dst.sroa_idx align 1, ptr %a.sroa.7 align 1, i32 40
  ret void
}
Transformation doesn't verify!
ERROR: Mismatch in memory

Example:
ptr %dst = pointer(non-local, block_id=1, offset=512)
ptr %src = pointer(non-local, block_id=2, offset=2)

Source:
ptr %a = pointer(local, block_id=8, offset=0)
ptr %b = pointer(local, block_id=8, offset=0)
ptr %a.src.1 = pointer(local, block_id=8, offset=20)
ptr %a.dst.1 = pointer(local, block_id=8, offset=40)
ptr %c = pointer(local, block_id=8, offset=42)
ptr %a.src.2 = pointer(local, block_id=8, offset=50)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0
Block 1 >	size: 2565	align: 2	alloc type: 0
Block 2 >	size: 2048	align: 17179869184	alloc type: 0

LOCAL BLOCKS:
Block 8 >	size: 100	align: 1	alloc type: 1

Target:
ptr %a.sroa.0 = pointer(local, block_id=8, offset=0)
ptr %a.sroa.2.sroa.4 = pointer(local, block_id=9, offset=0)
ptr %a.sroa.3 = pointer(local, block_id=10, offset=0)
ptr %a.sroa.31.sroa.5 = pointer(local, block_id=11, offset=0)
ptr %a.sroa.6.sroa.4 = pointer(local, block_id=12, offset=0)
ptr %a.sroa.7 = pointer(local, block_id=13, offset=0)
ptr %a.sroa.2.0.src.sroa_idx = pointer(non-local, block_id=2, offset=22)
i16 %a.sroa.2.sroa.0.0.copyload = poison
ptr %a.sroa.2.sroa.3.0.a.sroa.2.0.src.sroa_idx.sroa_idx = pointer(non-local, block_id=2, offset=24)
i8 %a.sroa.2.sroa.3.0.copyload = poison
ptr %a.sroa.2.sroa.4.0.a.sroa.2.0.src.sroa_idx.sroa_idx = pointer(non-local, block_id=2, offset=25)
ptr %a.sroa.3.0.src.sroa_idx = pointer(non-local, block_id=2, offset=32)
ptr %a.sroa.31.0.src.sroa_idx = pointer(non-local, block_id=2, offset=42)
i16 %a.sroa.31.sroa.0.0.copyload = poison
ptr %a.sroa.31.sroa.4.0.a.sroa.31.0.src.sroa_idx.sroa_idx = pointer(non-local, block_id=2, offset=44)
i8 %a.sroa.31.sroa.4.0.copyload = poison
ptr %a.sroa.31.sroa.5.0.a.sroa.31.0.src.sroa_idx.sroa_idx = pointer(non-local, block_id=2, offset=45)
ptr %a.sroa.6.0.src.sroa_idx = pointer(non-local, block_id=2, offset=52)
i16 %a.sroa.6.sroa.0.0.copyload = poison
ptr %a.sroa.6.sroa.3.0.a.sroa.6.0.src.sroa_idx.sroa_idx = pointer(non-local, block_id=2, offset=54)
i8 %a.sroa.6.sroa.3.0.copyload = poison
ptr %a.sroa.6.sroa.4.0.a.sroa.6.0.src.sroa_idx.sroa_idx = pointer(non-local, block_id=2, offset=55)
ptr %a.sroa.7.0.src.sroa_idx = pointer(non-local, block_id=2, offset=62)
ptr %a.sroa.2.0.dst.sroa_idx = pointer(non-local, block_id=1, offset=532)
ptr %a.sroa.2.sroa.3.0.a.sroa.2.0.dst.sroa_idx.sroa_idx = pointer(non-local, block_id=1, offset=534)
ptr %a.sroa.2.sroa.4.0.a.sroa.2.0.dst.sroa_idx.sroa_idx = pointer(non-local, block_id=1, offset=535)
ptr %a.sroa.3.0.dst.sroa_idx = pointer(non-local, block_id=1, offset=542)
ptr %a.sroa.31.0.dst.sroa_idx = pointer(non-local, block_id=1, offset=552)
ptr %a.sroa.31.sroa.4.0.a.sroa.31.0.dst.sroa_idx.sroa_idx = pointer(non-local, block_id=1, offset=554)
ptr %a.sroa.31.sroa.5.0.a.sroa.31.0.dst.sroa_idx.sroa_idx = pointer(non-local, block_id=1, offset=555)
ptr %a.sroa.6.0.dst.sroa_idx = pointer(non-local, block_id=1, offset=562)
ptr %a.sroa.6.sroa.3.0.a.sroa.6.0.dst.sroa_idx.sroa_idx = pointer(non-local, block_id=1, offset=564)
ptr %a.sroa.6.sroa.4.0.a.sroa.6.0.dst.sroa_idx.sroa_idx = pointer(non-local, block_id=1, offset=565)
ptr %a.sroa.7.0.dst.sroa_idx = pointer(non-local, block_id=1, offset=572)

TARGET MEMORY STATE
===================
LOCAL BLOCKS:
Block 8 >	size: 20	align: 1	alloc type: 1
Block 9 >	size: 7	align: 1	alloc type: 1
Block 10 >	size: 10	align: 1	alloc type: 1
Block 11 >	size: 7	align: 1	alloc type: 1
Block 12 >	size: 7	align: 1	alloc type: 1
Block 13 >	size: 40	align: 1	alloc type: 1

Mismatch in pointer(non-local, block_id=1, offset=564)
Source value: pointer(non-local, block_id=0, offset=32), byte offset=-4
Target value: poison


------------------- SMT STATS -------------------
Num queries: 17
Num invalid: 0
Num skips:   0
Num trivial: 64 (79.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     16 (94.1%)
Num UNSAT:   1 (5.9%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nuno/alive2/build/opt-alive.sh -passes=sroa -opaque-pointers -S
+ /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/SROA/basictest-opaque-ptrs.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/SROA/basictest-opaque-ptrs.ll

 

<-- Back