Test Failure: Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll

Test source: git

Log:

Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. SeparateConstOffsetFromGEPPass

----------------------------------------
@struct_array = global 16384 bytes, align 16

define ptr @struct(i32 %i) {
entry:
  %add = add nsw i32 %i, 5
  %idxprom = sext i32 %add to i64
  %p = gep inbounds ptr @struct_array, 16384 x i64 0, 16 x i64 %idxprom, 1 x i64 8
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 3. SeparateConstOffsetFromGEPPass

----------------------------------------
@struct_array = global 16384 bytes, align 16

define ptr @struct(i32 %i) {
entry:
  %add = add nsw i32 %i, 5
  %idxprom = sext i32 %add to i64
  %p = gep inbounds ptr @struct_array, 16384 x i64 0, 16 x i64 %idxprom, 1 x i64 8
  ret ptr %p
}
=>
@struct_array = global 16384 bytes, align 16

define ptr @struct(i32 %i) {
entry:
  %#0 = sext i32 %i to i64
  %#1 = gep ptr @struct_array, 16384 x i64 0, 16 x i64 %#0, 1 x i64 8
  %p2 = gep ptr %#1, 1 x i64 80
  ret ptr %p2
}
Transformation seems to be correct!

-- 4. PassManager<Function> : Skipping NOP
-- 5. PassManager<Function> : Skipping NOP
-- 6. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_add(i32 %i, i32 %j) {
entry:
  %#0 = add i32 %i, 1
  %#1 = sext i32 %#0 to i64
  %#2 = add i32 %j, 4294967294
  %#3 = sext i32 %#2 to i64
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#1, 4 x i64 %#3
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 7. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_add(i32 %i, i32 %j) {
entry:
  %#0 = add i32 %i, 1
  %#1 = sext i32 %#0 to i64
  %#2 = add i32 %j, 4294967294
  %#3 = sext i32 %#2 to i64
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#1, 4 x i64 %#3
  ret ptr %p
}
=>
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_add(i32 %i, i32 %j) {
entry:
  %#0 = add i32 %j, 4294967294
  %#1 = sext i32 %#0 to i64
  %#2 = sext i32 %i to i64
  %#3 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#2, 4 x i64 %#1
  %p1 = gep ptr %#3, 1 x i64 128
  ret ptr %p1
}
Transformation seems to be correct!

-- 8. PassManager<Function> : Skipping NOP
-- 9. PassManager<Function> : Skipping NOP
-- 10. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @ext_add_no_overflow(i64 %a, i32 %b, i64 %c, i32 %d) {
#0:
  %b1 = add nsw i32 %b, 1
  %b2 = sext i32 %b1 to i64
  %i = add i64 %a, %b2
  %d1 = add nuw i32 %d, 1
  %d2 = zext i32 %d1 to i64
  %j = add i64 %c, %d2
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i, 4 x i64 %j
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 11. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @ext_add_no_overflow(i64 %a, i32 %b, i64 %c, i32 %d) {
#0:
  %b1 = add nsw i32 %b, 1
  %b2 = sext i32 %b1 to i64
  %i = add i64 %a, %b2
  %d1 = add nuw i32 %d, 1
  %d2 = zext i32 %d1 to i64
  %j = add i64 %c, %d2
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i, 4 x i64 %j
  ret ptr %p
}
=>
@float_2d_array = global 4096 bytes, align 4

define ptr @ext_add_no_overflow(i64 %a, i32 %b, i64 %c, i32 %d) {
#0:
  %#1 = sext i32 %b to i64
  %i2 = add i64 %a, %#1
  %#2 = zext i32 %d to i64
  %j4 = add i64 %c, %#2
  %#3 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i2, 4 x i64 %j4
  %p5 = gep ptr %#3, 1 x i64 132
  ret ptr %p5
}
Transformation seems to be correct!

-- 12. PassManager<Function> : Skipping NOP
-- 13. PassManager<Function> : Skipping NOP
-- 14. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define void @sext_zext(i32 %a, i32 %b, ptr %out1, ptr %out2) {
entry:
  %#0 = add nsw nuw i32 %a, 1
  %#1 = sext i32 %#0 to i48
  %#2 = zext i48 %#1 to i64
  %#3 = add nsw i32 %b, 2
  %#4 = sext i32 %#3 to i48
  %#5 = zext i48 %#4 to i64
  %p1 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#2, 4 x i64 %#5
  store ptr %p1, ptr %out1, align 8
  %#6 = add nuw i32 %a, 3
  %#7 = zext i32 %#6 to i48
  %#8 = sext i48 %#7 to i64
  %#9 = add nsw i32 %b, 4
  %#10 = zext i32 %#9 to i48
  %#11 = sext i48 %#10 to i64
  %p2 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#8, 4 x i64 %#11
  store ptr %p2, ptr %out2, align 8
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 15. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define void @sext_zext(i32 %a, i32 %b, ptr %out1, ptr %out2) {
entry:
  %#0 = add nsw nuw i32 %a, 1
  %#1 = sext i32 %#0 to i48
  %#2 = zext i48 %#1 to i64
  %#3 = add nsw i32 %b, 2
  %#4 = sext i32 %#3 to i48
  %#5 = zext i48 %#4 to i64
  %p1 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#2, 4 x i64 %#5
  store ptr %p1, ptr %out1, align 8
  %#6 = add nuw i32 %a, 3
  %#7 = zext i32 %#6 to i48
  %#8 = sext i48 %#7 to i64
  %#9 = add nsw i32 %b, 4
  %#10 = zext i32 %#9 to i48
  %#11 = sext i48 %#10 to i64
  %p2 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#8, 4 x i64 %#11
  store ptr %p2, ptr %out2, align 8
  ret void
}
=>
@float_2d_array = global 4096 bytes, align 4

define void @sext_zext(i32 %a, i32 %b, ptr %out1, ptr %out2) {
entry:
  %#0 = add nsw i32 %b, 2
  %#1 = sext i32 %#0 to i48
  %#2 = zext i48 %#1 to i64
  %#3 = sext i32 %a to i48
  %#4 = zext i48 %#3 to i64
  %#5 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#4, 4 x i64 %#2
  %p11 = gep ptr %#5, 1 x i64 128
  store ptr %p11, ptr %out1, align 8
  %#6 = add nsw i32 %b, 4
  %#7 = zext i32 %#6 to i48
  %#8 = sext i48 %#7 to i64
  %#9 = zext i32 %a to i48
  %#10 = sext i48 %#9 to i64
  %#11 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %#10, 4 x i64 %#8
  %p22 = gep ptr %#11, 1 x i64 384
  store ptr %p22, ptr %out2, align 8
  ret void
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 16. PassManager<Function> : Skipping NOP
-- 17. PassManager<Function> : Skipping NOP
-- 18. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_or(i64 %a, i32 %b) {
entry:
  %b1 = shl i32 %b, 2
  %b2 = or disjoint i32 %b1, 1
  %b3 = or i32 %b1, 4
  %b2.ext = zext i32 %b2 to i64
  %b3.ext = sext i32 %b3 to i64
  %i = add i64 %a, %b2.ext
  %j = add i64 %a, %b3.ext
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i, 4 x i64 %j
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 19. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_or(i64 %a, i32 %b) {
entry:
  %b1 = shl i32 %b, 2
  %b2 = or disjoint i32 %b1, 1
  %b3 = or i32 %b1, 4
  %b2.ext = zext i32 %b2 to i64
  %b3.ext = sext i32 %b3 to i64
  %i = add i64 %a, %b2.ext
  %j = add i64 %a, %b3.ext
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i, 4 x i64 %j
  ret ptr %p
}
=>
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_or(i64 %a, i32 %b) {
entry:
  %b1 = shl i32 %b, 2
  %b3 = or i32 %b1, 4
  %b3.ext = sext i32 %b3 to i64
  %j = add i64 %a, %b3.ext
  %#0 = zext i32 %b1 to i64
  %i2 = add i64 %a, %#0
  %#1 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i2, 4 x i64 %j
  %p3 = gep ptr %#1, 1 x i64 128
  ret ptr %p3
}
Transformation seems to be correct!

-- 20. PassManager<Function> : Skipping NOP
-- 21. PassManager<Function> : Skipping NOP
-- 22. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @expr(i64 %a, i64 %b, ptr %out) {
entry:
  %b5 = add i64 %b, 5
  %i = add i64 %b5, %a
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i, 4 x i64 0
  store i64 %b5, ptr %out, align 8
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 23. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @expr(i64 %a, i64 %b, ptr %out) {
entry:
  %b5 = add i64 %b, 5
  %i = add i64 %b5, %a
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i, 4 x i64 0
  store i64 %b5, ptr %out, align 8
  ret ptr %p
}
=>
@float_2d_array = global 4096 bytes, align 4

define ptr @expr(i64 %a, i64 %b, ptr %out) {
entry:
  %b5 = add i64 %b, 5
  %i2 = add i64 %b, %a
  %#0 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i2, 4 x i64 0
  %p3 = gep ptr %#0, 1 x i64 640
  store i64 %b5, ptr %out, align 8
  ret ptr %p3
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 24. PassManager<Function> : Skipping NOP
-- 25. PassManager<Function> : Skipping NOP
-- 26. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_expr(i32 %a, i32 %b, i32 %c, i64 %d) {
entry:
  %#0 = add nsw i32 %c, 8
  %#1 = add nsw i32 %b, %#0
  %#2 = add nsw i32 %a, %#1
  %#3 = sext i32 %#2 to i64
  %i = add i64 %d, %#3
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %i
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 27. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_expr(i32 %a, i32 %b, i32 %c, i64 %d) {
entry:
  %#0 = add nsw i32 %c, 8
  %#1 = add nsw i32 %b, %#0
  %#2 = add nsw i32 %a, %#1
  %#3 = sext i32 %#2 to i64
  %i = add i64 %d, %#3
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %i
  ret ptr %p
}
=>
@float_2d_array = global 4096 bytes, align 4

define ptr @sext_expr(i32 %a, i32 %b, i32 %c, i64 %d) {
entry:
  %#0 = sext i32 %a to i64
  %#1 = sext i32 %b to i64
  %#2 = sext i32 %c to i64
  %#3 = add i64 %#1, %#2
  %#4 = add i64 %#0, %#3
  %i1 = add i64 %d, %#4
  %#5 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %i1
  %p2 = gep ptr %#5, 1 x i64 32
  ret ptr %p2
}
Transformation seems to be correct!

-- 28. PassManager<Function> : Skipping NOP
-- 29. PassManager<Function> : Skipping NOP
-- 30. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @sub(i64 %i, i64 %j) {
#0:
  %i2 = sub i64 %i, 5
  %j2 = sub i64 5, %j
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i2, 4 x i64 %j2
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 31. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @sub(i64 %i, i64 %j) {
#0:
  %i2 = sub i64 %i, 5
  %j2 = sub i64 5, %j
  %p = gep inbounds ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i2, 4 x i64 %j2
  ret ptr %p
}
=>
@float_2d_array = global 4096 bytes, align 4

define ptr @sub(i64 %i, i64 %j) {
#0:
  %j22 = sub i64 0, %j
  %#1 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 %i, 4 x i64 %j22
  %p3 = gep ptr %#1, 1 x i64 -620
  ret ptr %p3
}
Transformation seems to be correct!

-- 32. PassManager<Function> : Skipping NOP
-- 33. PassManager<Function> : Skipping NOP
-- 34. SeparateConstOffsetFromGEPPass

----------------------------------------
define ptr @packed_struct(i32 %i, i32 %j) {
entry:
  %s = alloca i64 77824, align 16
  %add = add nsw i32 %j, 3
  %idxprom = sext i32 %add to i64
  %add1 = add nsw i32 %i, 1
  %idxprom2 = sext i32 %add1 to i64
  %arrayidx3 = gep inbounds ptr %s, 77824 x i64 0, 76 x i64 %idxprom2, 1 x i64 12, 8 x i64 %idxprom
  ret ptr %arrayidx3
}
Transformation seems to be correct! (syntactically equal)

-- 35. SeparateConstOffsetFromGEPPass

----------------------------------------
define ptr @packed_struct(i32 %i, i32 %j) {
entry:
  %s = alloca i64 77824, align 16
  %add = add nsw i32 %j, 3
  %idxprom = sext i32 %add to i64
  %add1 = add nsw i32 %i, 1
  %idxprom2 = sext i32 %add1 to i64
  %arrayidx3 = gep inbounds ptr %s, 77824 x i64 0, 76 x i64 %idxprom2, 1 x i64 12, 8 x i64 %idxprom
  ret ptr %arrayidx3
}
=>
define ptr @packed_struct(i32 %i, i32 %j) {
entry:
  %s = alloca i64 77824, align 16
  %#0 = sext i32 %i to i64
  %#1 = sext i32 %j to i64
  %#2 = gep ptr %s, 77824 x i64 0, 76 x i64 %#0, 1 x i64 12, 8 x i64 %#1
  %arrayidx33 = gep ptr %#2, 1 x i64 100
  ret ptr %arrayidx33
}
Transformation seems to be correct!

-- 36. PassManager<Function> : Skipping NOP
-- 37. PassManager<Function> : Skipping NOP
-- 38. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @zext_expr(i32 %a, i32 %b) {
entry:
  %#0 = add i32 %b, 8
  %#1 = add nuw i32 %a, %#0
  %i = zext i32 %#1 to i64
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %i
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 39. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @zext_expr(i32 %a, i32 %b) {
entry:
  %#0 = add i32 %b, 8
  %#1 = add nuw i32 %a, %#0
  %i = zext i32 %#1 to i64
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %i
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 40. PassManager<Function> : Skipping NOP
-- 41. PassManager<Function> : Skipping NOP
-- 42. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @i32_add(i32 %a) {
entry:
  %i = add i32 %a, 8
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i32 %i
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 43. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @i32_add(i32 %a) {
entry:
  %i = add i32 %a, 8
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i32 %i
  ret ptr %p
}
=>
@float_2d_array = global 4096 bytes, align 4

define ptr @i32_add(i32 %a) {
entry:
  %i = add i32 %a, 8
  %idxprom = sext i32 %i to i64
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %idxprom
  ret ptr %p
}
Transformation seems to be correct!

-- 44. PassManager<Function> : Skipping NOP
-- 45. PassManager<Function> : Skipping NOP
-- 46. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @apint(i1 %a) {
entry:
  %#0 = add nsw nuw i1 %a, 1
  %#1 = sext i1 %#0 to i4
  %#2 = zext i4 %#1 to i64
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %#2
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 47. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @apint(i1 %a) {
entry:
  %#0 = add nsw nuw i1 %a, 1
  %#1 = sext i1 %#0 to i4
  %#2 = zext i4 %#1 to i64
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %#2
  ret ptr %p
}
=>
@float_2d_array = global 4096 bytes, align 4

define ptr @apint(i1 %a) {
entry:
  %#0 = sext i1 %a to i4
  %#1 = zext i4 %#0 to i64
  %#2 = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %#1
  %p1 = gep ptr %#2, 1 x i64 60
  ret ptr %p1
}
Transformation seems to be correct!

-- 48. PassManager<Function> : Skipping NOP
-- 49. PassManager<Function> : Skipping NOP
-- 50. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @and(i64 %a) {
entry:
  %#0 = shl i64 %a, 2
  %#1 = and i64 %#0, 1
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %#1
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 51. SeparateConstOffsetFromGEPPass

----------------------------------------
@float_2d_array = global 4096 bytes, align 4

define ptr @and(i64 %a) {
entry:
  %#0 = shl i64 %a, 2
  %#1 = and i64 %#0, 1
  %p = gep ptr @float_2d_array, 4096 x i64 0, 128 x i64 0, 4 x i64 %#1
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 52. PassManager<Function> : Skipping NOP
-- 53. PassManager<Function> : Skipping NOP
-- 54. SeparateConstOffsetFromGEPPass

----------------------------------------
define ptr @shl_add_or(i64 %a, ptr %ptr) {
entry:
  %shl = shl i64 %a, 2
  %add = add i64 %shl, 12
  %or = or disjoint i64 %add, 1
  %p = gep ptr %ptr, 4 x i64 %or
  ret ptr %p
}
Transformation seems to be correct! (syntactically equal)

-- 55. SeparateConstOffsetFromGEPPass

----------------------------------------
define ptr @shl_add_or(i64 %a, ptr %ptr) {
entry:
  %shl = shl i64 %a, 2
  %add = add i64 %shl, 12
  %or = or disjoint i64 %add, 1
  %p = gep ptr %ptr, 4 x i64 %or
  ret ptr %p
}
=>
define ptr @shl_add_or(i64 %a, ptr %ptr) {
entry:
  %shl = shl i64 %a, 2
  %or2 = add i64 %shl, 1
  %#0 = gep ptr %ptr, 4 x i64 %or2
  %p3 = gep ptr %#0, 1 x i64 48
  ret ptr %p3
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 56. PassManager<Function> : Skipping NOP
-- 57. PassManager<Function> : Skipping NOP
-- 58. SeparateConstOffsetFromGEPPass

----------------------------------------
define ptr @sign_mod_unsign(ptr %ptr, i64 %idx) {
entry:
  %arrayidx = add nsw i64 %idx, -2
  %ptr2 = gep inbounds ptr %ptr, 3216 x i64 0, 1 x i64 16, 32 x i64 %arrayidx, 1 x i64 8
  ret ptr %ptr2
}
Transformation seems to be correct! (syntactically equal)

-- 59. SeparateConstOffsetFromGEPPass

----------------------------------------
define ptr @sign_mod_unsign(ptr %ptr, i64 %idx) {
entry:
  %arrayidx = add nsw i64 %idx, -2
  %ptr2 = gep inbounds ptr %ptr, 3216 x i64 0, 1 x i64 16, 32 x i64 %arrayidx, 1 x i64 8
  ret ptr %ptr2
}
=>
define ptr @sign_mod_unsign(ptr %ptr, i64 %idx) {
entry:
  %#0 = gep ptr %ptr, 3216 x i64 0, 1 x i64 16, 32 x i64 %idx, 1 x i64 8
  %ptr22 = gep ptr %#0, 1 x i64 -64
  ret ptr %ptr22
}
Transformation seems to be correct!

-- 60. PassManager<Function> : Skipping NOP
-- 61. PassManager<Function> : Skipping NOP
-- 62. SeparateConstOffsetFromGEPPass

----------------------------------------
define ptr @trunk_explicit(ptr %ptr, i64 %idx) {
entry:
  %idx0 = trunc i64 1 to i32
  %ptr2 = gep inbounds ptr %ptr, 3216 x i32 %idx0, 1 x i64 16, 32 x i64 %idx, 1 x i64 8
  ret ptr %ptr2
}
Transformation seems to be correct! (syntactically equal)

-- 63. SeparateConstOffsetFromGEPPass

----------------------------------------
define ptr @trunk_explicit(ptr %ptr, i64 %idx) {
entry:
  %idx0 = trunc i64 1 to i32
  %ptr2 = gep inbounds ptr %ptr, 3216 x i32 %idx0, 1 x i64 16, 32 x i64 %idx, 1 x i64 8
  ret ptr %ptr2
}
=>
define ptr @trunk_explicit(ptr %ptr, i64 %idx) {
entry:
  %#0 = gep inbounds ptr %ptr, 3216 x i64 0, 1 x i64 16, 32 x i64 %idx, 1 x i64 8
  %ptr21 = gep inbounds ptr %#0, 1 x i64 3216
  ret ptr %ptr21
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source

Example:
ptr %ptr = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000001
i64 %idx = #xfffffffffffffffe (18446744073709551614, -2)

Source:
i32 %idx0 = #x00000001 (1)
ptr %ptr2 = pointer(non-local, block_id=1, offset=3176) / Address=#x0000000000000c69

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: 0
Block 1 >	size: 4611686018427387904	align: 1	alloc type: 0	alive: true	address: 1

Target:
ptr %#0 = poison
ptr %ptr21 = poison
Source value: pointer(non-local, block_id=1, offset=3176) / Address=#x0000000000000c69
Target value: poison

Pass: SeparateConstOffsetFromGEPPass
Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-load-pass-plugin=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-mtriple=nvptx64-nvidia-cuda' '-passes=separate-const-offset-from-gep' '-reassociate-geps-verify-no-dead-code' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_ei4LBU8L_igqL.bc"


------------------- SMT STATS -------------------
Num queries: 91
Num invalid: 0
Num skips:   0
Num trivial: 48 (34.5%)
Num timeout: 3 (3.3%)
Num errors:  0 (0.0%)
Num SAT:     44 (48.4%)
Num UNSAT:   44 (48.4%)
Alive2: Transform doesn't verify; aborting!

stderr:

/home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll -mtriple=nvptx64-nvidia-cuda -passes=separate-const-offset-from-gep        -reassociate-geps-verify-no-dead-code -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll # RUN: at line 2
+ /home/nlopes/alive2/build/opt-alive.sh -mtriple=nvptx64-nvidia-cuda -passes=separate-const-offset-from-gep -reassociate-geps-verify-no-dead-code -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll

 

<-- Back