Test source: git
Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
ERROR: Unsupported instruction: %p1 = getelementptr inbounds i32, ptr addrspace(1) @X_as1, i64 %i
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(3)
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(1)
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(3)
-- 1. PassManager<Function> : Skipping NOP
-- 2. InstCombinePass
----------------------------------------
define i1 @eq_base(ptr %x, i64 %y) {
#0:
%g = gep ptr %x, 1 x i64 %y
%r = icmp eq ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 3. InstCombinePass
----------------------------------------
define i1 @eq_base(ptr %x, i64 %y) {
#0:
%g = gep ptr %x, 1 x i64 %y
%r = icmp eq ptr %g, %x, offsetonly
ret i1 %r
}
=>
define i1 @eq_base(ptr %x, i64 %y) {
#0:
%r = icmp eq i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 4. PassManager<Function> : Skipping NOP
-- 5. PassManager<Function> : Skipping NOP
-- 6. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @ne_base_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep ptr %x, 1 x i64 %y
%r = icmp ne ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 7. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @ne_base_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep ptr %x, 1 x i64 %y
%r = icmp ne ptr %x, %g, offsetonly
ret i1 %r
}
=>
declare ptr @getptr()
define i1 @ne_base_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%r = icmp ne i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 8. PassManager<Function> : Skipping NOP
-- 9. PassManager<Function> : Skipping NOP
-- 10. InstCombinePass
----------------------------------------
define i1 @ne_base_inbounds(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp ne ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 11. InstCombinePass
----------------------------------------
define i1 @ne_base_inbounds(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp ne ptr %g, %x, offsetonly
ret i1 %r
}
=>
define i1 @ne_base_inbounds(ptr %x, i64 %y) {
#0:
%r = icmp ne i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 12. PassManager<Function> : Skipping NOP
-- 13. PassManager<Function> : Skipping NOP
-- 14. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @eq_base_inbounds_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp eq ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 15. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @eq_base_inbounds_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp eq ptr %x, %g, offsetonly
ret i1 %r
}
=>
declare ptr @getptr()
define i1 @eq_base_inbounds_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%r = icmp eq i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 16. PassManager<Function> : Skipping NOP
-- 17. PassManager<Function> : Skipping NOP
-- 18. InstCombinePass
----------------------------------------
define i1 @slt_base(ptr %x, i64 %y) {
#0:
%g = gep ptr %x, 1 x i64 %y
%r = icmp slt ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 19. InstCombinePass
----------------------------------------
define i1 @slt_base(ptr %x, i64 %y) {
#0:
%g = gep ptr %x, 1 x i64 %y
%r = icmp slt ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 20. PassManager<Function> : Skipping NOP
-- 21. PassManager<Function> : Skipping NOP
-- 22. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @sgt_base_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep ptr %x, 1 x i64 %y
%r = icmp sgt ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 23. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @sgt_base_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep ptr %x, 1 x i64 %y
%r = icmp sgt ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 24. PassManager<Function> : Skipping NOP
-- 25. PassManager<Function> : Skipping NOP
-- 26. InstCombinePass
----------------------------------------
define i1 @slt_base_inbounds(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp slt ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 27. InstCombinePass
----------------------------------------
define i1 @slt_base_inbounds(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp slt ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 28. PassManager<Function> : Skipping NOP
-- 29. PassManager<Function> : Skipping NOP
-- 30. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @sgt_base_inbounds_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp sgt ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 31. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @sgt_base_inbounds_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp sgt ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 32. PassManager<Function> : Skipping NOP
-- 33. PassManager<Function> : Skipping NOP
-- 34. InstCombinePass
----------------------------------------
define i1 @ult_base(ptr %x, i64 %y) {
#0:
%g = gep ptr %x, 1 x i64 %y
%r = icmp ult ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 35. InstCombinePass
----------------------------------------
define i1 @ult_base(ptr %x, i64 %y) {
#0:
%g = gep ptr %x, 1 x i64 %y
%r = icmp ult ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 36. PassManager<Function> : Skipping NOP
-- 37. PassManager<Function> : Skipping NOP
-- 38. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @ugt_base_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep ptr %x, 1 x i64 %y
%r = icmp ugt ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 39. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @ugt_base_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep ptr %x, 1 x i64 %y
%r = icmp ugt ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 40. PassManager<Function> : Skipping NOP
-- 41. PassManager<Function> : Skipping NOP
-- 42. InstCombinePass
----------------------------------------
define i1 @ult_base_inbounds(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp ult ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 43. InstCombinePass
----------------------------------------
define i1 @ult_base_inbounds(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp ult ptr %g, %x
ret i1 %r
}
=>
define i1 @ult_base_inbounds(ptr %x, i64 %y) {
#0:
%r = icmp slt i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 44. PassManager<Function> : Skipping NOP
-- 45. PassManager<Function> : Skipping NOP
-- 46. InstCombinePass
----------------------------------------
define i1 @ult_base_nusw(ptr %x, i64 %y) {
#0:
%g = gep nusw ptr %x, 1 x i64 %y
%r = icmp ult ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 47. InstCombinePass
----------------------------------------
define i1 @ult_base_nusw(ptr %x, i64 %y) {
#0:
%g = gep nusw ptr %x, 1 x i64 %y
%r = icmp ult ptr %g, %x
ret i1 %r
}
=>
define i1 @ult_base_nusw(ptr %x, i64 %y) {
#0:
%r = icmp slt i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 48. PassManager<Function> : Skipping NOP
-- 49. PassManager<Function> : Skipping NOP
-- 50. InstCombinePass
----------------------------------------
define i1 @ugt_base_nuw(ptr %x, i64 %y) {
#0:
%g = gep nuw ptr %x, 1 x i64 %y
%r = icmp ugt ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 51. InstCombinePass
----------------------------------------
define i1 @ugt_base_nuw(ptr %x, i64 %y) {
#0:
%g = gep nuw ptr %x, 1 x i64 %y
%r = icmp ugt ptr %g, %x
ret i1 %r
}
=>
define i1 @ugt_base_nuw(ptr %x, i64 %y) {
#0:
%r = icmp ne i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 52. PassManager<Function> : Skipping NOP
-- 53. PassManager<Function> : Skipping NOP
-- 54. InstCombinePass
----------------------------------------
define i1 @ugt_base_nusw_nuw(ptr %x, i64 %y) {
#0:
%g = gep nusw nuw ptr %x, 1 x i64 %y
%r = icmp ugt ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 55. InstCombinePass
----------------------------------------
define i1 @ugt_base_nusw_nuw(ptr %x, i64 %y) {
#0:
%g = gep nusw nuw ptr %x, 1 x i64 %y
%r = icmp ugt ptr %g, %x
ret i1 %r
}
=>
define i1 @ugt_base_nusw_nuw(ptr %x, i64 %y) {
#0:
%r = icmp ne i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 56. PassManager<Function> : Skipping NOP
-- 57. PassManager<Function> : Skipping NOP
-- 58. InstCombinePass
----------------------------------------
define i1 @uge_base_nuw(ptr %x, i64 %y) {
#0:
%g = gep nuw ptr %x, 1 x i64 %y
%r = icmp uge ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 59. InstCombinePass
----------------------------------------
define i1 @uge_base_nuw(ptr %x, i64 %y) {
#0:
%g = gep nuw ptr %x, 1 x i64 %y
%r = icmp uge ptr %g, %x
ret i1 %r
}
=>
define i1 @uge_base_nuw(ptr %x, i64 %y) {
#0:
ret i1 1
}
Transformation seems to be correct!
-- 60. PassManager<Function> : Skipping NOP
-- 61. PassManager<Function> : Skipping NOP
-- 62. InstCombinePass
----------------------------------------
define i1 @uge_base_nusw_nuw(ptr %x, i64 %y) {
#0:
%g = gep nusw nuw ptr %x, 1 x i64 %y
%r = icmp uge ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 63. InstCombinePass
----------------------------------------
define i1 @uge_base_nusw_nuw(ptr %x, i64 %y) {
#0:
%g = gep nusw nuw ptr %x, 1 x i64 %y
%r = icmp uge ptr %g, %x
ret i1 %r
}
=>
define i1 @uge_base_nusw_nuw(ptr %x, i64 %y) {
#0:
ret i1 1
}
Transformation seems to be correct!
-- 64. PassManager<Function> : Skipping NOP
-- 65. PassManager<Function> : Skipping NOP
-- 66. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @ugt_base_inbounds_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp ugt ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 67. InstCombinePass
----------------------------------------
declare ptr @getptr()
define i1 @ugt_base_inbounds_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
%r = icmp ugt ptr %x, %g
ret i1 %r
}
=>
declare ptr @getptr()
define i1 @ugt_base_inbounds_commute(i64 %y) {
#0:
%x = call ptr @getptr()
%r = icmp slt i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 68. PassManager<Function> : Skipping NOP
-- 69. PassManager<Function> : Skipping NOP
-- 70. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @ne_base_inbounds_use(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
call void @use(ptr %g)
%r = icmp ne ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 71. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @ne_base_inbounds_use(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
call void @use(ptr %g)
%r = icmp ne ptr %g, %x, offsetonly
ret i1 %r
}
=>
declare void @use(ptr)
define i1 @ne_base_inbounds_use(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 1 x i64 %y
call void @use(ptr %g)
%r = icmp ne i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 72. PassManager<Function> : Skipping NOP
-- 73. PassManager<Function> : Skipping NOP
-- 74. InstCombinePass
----------------------------------------
declare ptr @getptr()
declare void @use(ptr)
define i1 @eq_base_inbounds_commute_use(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
call void @use(ptr %g)
%r = icmp eq ptr %x, %g
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 75. InstCombinePass
----------------------------------------
declare ptr @getptr()
declare void @use(ptr)
define i1 @eq_base_inbounds_commute_use(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
call void @use(ptr %g)
%r = icmp eq ptr %x, %g, offsetonly
ret i1 %r
}
=>
declare ptr @getptr()
declare void @use(ptr)
define i1 @eq_base_inbounds_commute_use(i64 %y) {
#0:
%x = call ptr @getptr()
%g = gep inbounds ptr %x, 1 x i64 %y
call void @use(ptr %g)
%r = icmp eq i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 76. PassManager<Function> : Skipping NOP
-- 77. PassManager<Function> : Skipping NOP
-- 78. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @ne_base_inbounds_use_scaled(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 8 x i64 %y
call void @use(ptr %g)
%r = icmp ne ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 79. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @ne_base_inbounds_use_scaled(ptr %x, i64 %y) {
#0:
%g = gep inbounds ptr %x, 8 x i64 %y
call void @use(ptr %g)
%r = icmp ne ptr %g, %x, offsetonly
ret i1 %r
}
=>
declare void @use(ptr)
define i1 @ne_base_inbounds_use_scaled(ptr %x, i64 %y) {
#0:
%g.idx = shl nsw i64 %y, 3
%g = gep inbounds ptr %x, 1 x i64 %g.idx
call void @use(ptr %g)
%r = icmp ne i64 %y, 0
ret i1 %r
}
Transformation seems to be correct!
-- 80. PassManager<Function> : Skipping NOP
-- 81. PassManager<Function> : Skipping NOP
-- 82. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @ne_base_use_scaled(ptr %x, i64 %y) {
#0:
%g = gep ptr %x, 8 x i64 %y
call void @use(ptr %g)
%r = icmp ne ptr %g, %x
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 83. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @ne_base_use_scaled(ptr %x, i64 %y) {
#0:
%g = gep ptr %x, 8 x i64 %y
call void @use(ptr %g)
%r = icmp ne ptr %g, %x, offsetonly
ret i1 %r
}
=>
declare void @use(ptr)
define i1 @ne_base_use_scaled(ptr %x, i64 %y) {
#0:
%g.idx = shl i64 %y, 3
%g = gep ptr %x, 1 x i64 %g.idx
call void @use(ptr %g)
%r = icmp ne i64 %g.idx, 0
ret i1 %r
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 84. PassManager<Function> : Skipping NOP
-- 85. PassManager<Function> : Skipping NOP
-- 86. InstCombinePass
----------------------------------------
define i1 @eq_bitcast_base(ptr %p, i64 %x) {
#0:
%gep = gep ptr %p, 2 x i64 %x, 1 x i64 0
%r = icmp eq ptr %gep, %p
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 87. InstCombinePass
----------------------------------------
define i1 @eq_bitcast_base(ptr %p, i64 %x) {
#0:
%gep = gep ptr %p, 2 x i64 %x, 1 x i64 0
%r = icmp eq ptr %gep, %p, offsetonly
ret i1 %r
}
=>
define i1 @eq_bitcast_base(ptr %p, i64 %x) {
#0:
%gep.idx.mask = and i64 %x, 9223372036854775807
%r = icmp eq i64 %gep.idx.mask, 0
ret i1 %r
}
Transformation seems to be correct!
-- 88. PassManager<Function> : Skipping NOP
-- 89. PassManager<Function> : Skipping NOP
-- 90. InstCombinePass
----------------------------------------
define i1 @eq_bitcast_base_inbounds(ptr %p, i64 %x) {
#0:
%gep = gep inbounds ptr %p, 2 x i64 %x, 1 x i64 0
%r = icmp eq ptr %gep, %p
ret i1 %r
}
Transformation seems to be correct! (syntactically equal)
-- 91. InstCombinePass
----------------------------------------
define i1 @eq_bitcast_base_inbounds(ptr %p, i64 %x) {
#0:
%gep = gep inbounds ptr %p, 2 x i64 %x, 1 x i64 0
%r = icmp eq ptr %gep, %p, offsetonly
ret i1 %r
}
=>
define i1 @eq_bitcast_base_inbounds(ptr %p, i64 %x) {
#0:
%r = icmp eq i64 %x, 0
ret i1 %r
}
Transformation seems to be correct!
-- 92. PassManager<Function> : Skipping NOP
-- 93. PassManager<Function> : Skipping NOP
-- 94. InstCombinePass
----------------------------------------
@X = global 4000 bytes, align 16
define i1 @PR8882(i64 %i) {
#0:
%p1 = gep inbounds ptr @X, 4 x i64 %i
%__constexpr_0 = gep inbounds ptr @X, 4000 x i64 1, 4 x i64 0
%cmp = icmp eq ptr %p1, %__constexpr_0
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 95. InstCombinePass
----------------------------------------
@X = global 4000 bytes, align 16
define i1 @PR8882(i64 %i) {
#0:
%p1 = gep inbounds ptr @X, 4 x i64 %i
%__constexpr_0 = gep inbounds ptr @X, 4000 x i64 1, 4 x i64 0
%cmp = icmp eq ptr %p1, %__constexpr_0, offsetonly
ret i1 %cmp
}
=>
@X = global 4000 bytes, align 16
define i1 @PR8882(i64 %i) {
#0:
%cmp = icmp eq i64 %i, 1000
ret i1 %cmp
}
Transformation seems to be correct!
-- 96. PassManager<Function> : Skipping NOP
-- 97. PassManager<Function> : Skipping NOP
ERROR: Unsupported instruction: %p1 = getelementptr inbounds i32, ptr addrspace(1) @X_as1, i64 %i
-- 98. InstCombinePass
ERROR: Unsupported instruction: %p1 = getelementptr inbounds i32, ptr addrspace(1) @X_as1, i64 %i
-- 99. InstCombinePass
-- 100. PassManager<Function> : Skipping NOP
-- 101. PassManager<Function> : Skipping NOP
-- 102. InstCombinePass
----------------------------------------
define i1 @test71(ptr %x) {
#0:
%a = gep ptr %x, 1 x i64 8
%b = gep inbounds ptr %x, 1 x i64 8
%c = icmp ugt ptr %a, %b
ret i1 %c
}
Transformation seems to be correct! (syntactically equal)
-- 103. InstCombinePass
----------------------------------------
define i1 @test71(ptr %x) {
#0:
%a = gep ptr %x, 1 x i64 8
%b = gep inbounds ptr %x, 1 x i64 8
%c = icmp ugt ptr %a, %b
ret i1 %c
}
=>
define i1 @test71(ptr %x) {
#0:
ret i1 0
}
Transformation seems to be correct!
-- 104. PassManager<Function> : Skipping NOP
-- 105. PassManager<Function> : Skipping NOP
-- 106. InstCombinePass
-- 107. InstCombinePass
-- 108. PassManager<Function> : Skipping NOP
-- 109. PassManager<Function> : Skipping NOP
-- 110. InstCombinePass
----------------------------------------
declare i32 @test58_d(i64)
define i1 @test59(ptr %foo) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 2
%gep2 = gep inbounds ptr %foo, 1 x i64 10
%cmp = icmp ult ptr %gep1, %gep2
%use = ptrtoint ptr %gep1 to i64
%call = call i32 @test58_d(i64 %use)
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 111. InstCombinePass
----------------------------------------
declare i32 @test58_d(i64)
define i1 @test59(ptr %foo) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 2
%gep2 = gep inbounds ptr %foo, 1 x i64 10
%cmp = icmp ult ptr %gep1, %gep2, offsetonly
%use = ptrtoint ptr %gep1 to i64
%call = call i32 @test58_d(i64 %use)
ret i1 %cmp
}
=>
declare i32 @test58_d(i64)
define i1 @test59(ptr %foo) {
#0:
%gep1 = gep inbounds nuw ptr %foo, 1 x i64 8
%use = ptrtoint ptr %gep1 to i64
%call = call i32 @test58_d(i64 %use)
ret i1 1
}
Transformation seems to be correct!
-- 112. PassManager<Function> : Skipping NOP
-- 113. PassManager<Function> : Skipping NOP
-- 114. InstCombinePass
-- 115. InstCombinePass
-- 116. PassManager<Function> : Skipping NOP
-- 117. PassManager<Function> : Skipping NOP
-- 118. InstCombinePass
----------------------------------------
define i1 @test60(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 %i
%gep2 = gep inbounds ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 119. InstCombinePass
----------------------------------------
define i1 @test60(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 %i
%gep2 = gep inbounds ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
define i1 @test60(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1.idx = shl nsw i64 %i, 2
%cmp = icmp slt i64 %gep1.idx, %j
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 120. PassManager<Function> : Skipping NOP
-- 121. PassManager<Function> : Skipping NOP
-- 122. InstCombinePass
----------------------------------------
define i1 @test60_nusw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nusw ptr %foo, 4 x i64 %i
%gep2 = gep nusw ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 123. InstCombinePass
----------------------------------------
define i1 @test60_nusw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nusw ptr %foo, 4 x i64 %i
%gep2 = gep nusw ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
define i1 @test60_nusw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1.idx = shl nsw i64 %i, 2
%cmp = icmp slt i64 %gep1.idx, %j
ret i1 %cmp
}
Transformation seems to be correct!
-- 124. PassManager<Function> : Skipping NOP
-- 125. PassManager<Function> : Skipping NOP
-- 126. InstCombinePass
----------------------------------------
define i1 @test60_nusw_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nusw ptr %foo, 4 x i64 %i
%gep2 = gep inbounds ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 127. InstCombinePass
----------------------------------------
define i1 @test60_nusw_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nusw ptr %foo, 4 x i64 %i
%gep2 = gep inbounds ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
define i1 @test60_nusw_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1.idx = shl nsw i64 %i, 2
%cmp = icmp slt i64 %gep1.idx, %j
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 128. PassManager<Function> : Skipping NOP
-- 129. PassManager<Function> : Skipping NOP
-- 130. InstCombinePass
----------------------------------------
define i1 @test60_nuw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nuw ptr %foo, 4 x i64 %i
%gep2 = gep nuw ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 131. InstCombinePass
----------------------------------------
define i1 @test60_nuw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nuw ptr %foo, 4 x i64 %i
%gep2 = gep nuw ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
define i1 @test60_nuw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1.idx = shl nuw i64 %i, 2
%cmp = icmp ult i64 %gep1.idx, %j
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 132. PassManager<Function> : Skipping NOP
-- 133. PassManager<Function> : Skipping NOP
-- 134. InstCombinePass
----------------------------------------
define i1 @test60_nusw_nuw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nusw nuw ptr %foo, 4 x i64 %i
%gep2 = gep nusw nuw ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 135. InstCombinePass
----------------------------------------
define i1 @test60_nusw_nuw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nusw nuw ptr %foo, 4 x i64 %i
%gep2 = gep nusw nuw ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
define i1 @test60_nusw_nuw(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1.idx = shl nsw nuw i64 %i, 2
%cmp = icmp samesign ult i64 %gep1.idx, %j
ret i1 %cmp
}
Transformation seems to be correct!
-- 136. PassManager<Function> : Skipping NOP
-- 137. PassManager<Function> : Skipping NOP
-- 138. InstCombinePass
----------------------------------------
define i1 @test60_nusw_nuw_mix(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nuw ptr %foo, 4 x i64 %i
%gep2 = gep nusw ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 139. InstCombinePass
----------------------------------------
define i1 @test60_nusw_nuw_mix(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep nuw ptr %foo, 4 x i64 %i
%gep2 = gep nusw ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 140. PassManager<Function> : Skipping NOP
-- 141. PassManager<Function> : Skipping NOP
-- 142. InstCombinePass
----------------------------------------
define i1 @test_gep_ult_no_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 4 x i64 %i
%gep2 = gep ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 143. InstCombinePass
----------------------------------------
define i1 @test_gep_ult_no_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 4 x i64 %i
%gep2 = gep ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 144. PassManager<Function> : Skipping NOP
-- 145. PassManager<Function> : Skipping NOP
-- 146. InstCombinePass
----------------------------------------
define i1 @test_gep_eq_no_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 4 x i64 %i
%gep2 = gep ptr %foo, 1 x i64 %j
%cmp = icmp eq ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 147. InstCombinePass
----------------------------------------
define i1 @test_gep_eq_no_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 4 x i64 %i
%gep2 = gep ptr %foo, 1 x i64 %j
%cmp = icmp eq ptr %gep1, %gep2, offsetonly
ret i1 %cmp
}
=>
define i1 @test_gep_eq_no_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1.idx = shl i64 %i, 2
%cmp = icmp eq i64 %gep1.idx, %j
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 148. PassManager<Function> : Skipping NOP
-- 149. PassManager<Function> : Skipping NOP
-- 150. InstCombinePass
-- 151. InstCombinePass
-- 152. PassManager<Function> : Skipping NOP
-- 153. PassManager<Function> : Skipping NOP
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(3)
-- 154. InstCombinePass
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(3)
-- 155. InstCombinePass
-- 156. PassManager<Function> : Skipping NOP
-- 157. PassManager<Function> : Skipping NOP
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(1)
-- 158. InstCombinePass
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(1)
-- 159. InstCombinePass
-- 160. PassManager<Function> : Skipping NOP
-- 161. PassManager<Function> : Skipping NOP
-- 162. InstCombinePass
-- 163. InstCombinePass
-- 164. PassManager<Function> : Skipping NOP
-- 165. PassManager<Function> : Skipping NOP
-- 166. InstCombinePass
----------------------------------------
define i1 @test61(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 4 x i64 %i
%gep2 = gep ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 167. InstCombinePass
----------------------------------------
define i1 @test61(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 4 x i64 %i
%gep2 = gep ptr %foo, 1 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 168. PassManager<Function> : Skipping NOP
-- 169. PassManager<Function> : Skipping NOP
-- 170. InstCombinePass
-- 171. InstCombinePass
-- 172. PassManager<Function> : Skipping NOP
-- 173. PassManager<Function> : Skipping NOP
-- 174. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @test60_extra_use(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 %i
%gep2 = gep inbounds ptr %foo, 2 x i64 %j
call void @use(ptr %gep1)
call void @use(ptr %gep2)
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 175. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @test60_extra_use(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 %i
%gep2 = gep inbounds ptr %foo, 2 x i64 %j
call void @use(ptr %gep1)
call void @use(ptr %gep2)
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
declare void @use(ptr)
define i1 @test60_extra_use(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1.idx = shl nsw i64 %i, 2
%gep1 = gep inbounds ptr %foo, 1 x i64 %gep1.idx
%gep2.idx = shl nsw i64 %j, 1
%gep2 = gep inbounds ptr %foo, 1 x i64 %gep2.idx
call void @use(ptr %gep1)
call void @use(ptr %gep2)
%cmp = icmp slt i64 %gep1.idx, %gep2.idx
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 176. PassManager<Function> : Skipping NOP
-- 177. PassManager<Function> : Skipping NOP
-- 178. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @test60_extra_use_const_operands_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 1
%gep2 = gep inbounds ptr %foo, 2 x i64 %j
call void @use(ptr %gep1)
%cmp = icmp eq ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 179. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @test60_extra_use_const_operands_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 1
%gep2 = gep inbounds ptr %foo, 2 x i64 %j
call void @use(ptr %gep1)
%cmp = icmp eq ptr %gep1, %gep2, offsetonly
ret i1 %cmp
}
=>
declare void @use(ptr)
define i1 @test60_extra_use_const_operands_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds nuw ptr %foo, 1 x i64 4
call void @use(nonnull ptr %gep1)
%cmp = icmp eq i64 %j, 2
ret i1 %cmp
}
Transformation seems to be correct!
-- 180. PassManager<Function> : Skipping NOP
-- 181. PassManager<Function> : Skipping NOP
-- 182. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @test60_extra_use_const_operands_no_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 4 x i64 1
%gep2 = gep ptr %foo, 2 x i64 %j
call void @use(ptr %gep1)
%cmp = icmp eq ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 183. InstCombinePass
----------------------------------------
declare void @use(ptr)
define i1 @test60_extra_use_const_operands_no_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 4 x i64 1
%gep2 = gep ptr %foo, 2 x i64 %j
call void @use(ptr %gep1)
%cmp = icmp eq ptr %gep1, %gep2, offsetonly
ret i1 %cmp
}
=>
declare void @use(ptr)
define i1 @test60_extra_use_const_operands_no_inbounds(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep ptr %foo, 1 x i64 4
call void @use(ptr %gep1)
%gep2.idx.mask = and i64 %j, 9223372036854775807
%cmp = icmp eq i64 %gep2.idx.mask, 2
ret i1 %cmp
}
Transformation seems to be correct!
-- 184. PassManager<Function> : Skipping NOP
-- 185. PassManager<Function> : Skipping NOP
-- 186. InstCombinePass
----------------------------------------
declare void @use(ptr)
declare void @use.i1(i1)
define void @test60_extra_use_fold(ptr %foo, i64 %start.idx, i64 %end.offset) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 %start.idx
%gep2 = gep inbounds ptr %foo, 1 x i64 %end.offset
call void @use(ptr %gep1)
call void @use(ptr %gep2)
%cmp1 = icmp eq ptr %gep1, %gep2
call void @use.i1(i1 %cmp1)
%cmp2 = icmp ult ptr %gep1, %gep2
call void @use.i1(i1 %cmp2)
ret void
}
Transformation seems to be correct! (syntactically equal)
-- 187. InstCombinePass
----------------------------------------
declare void @use(ptr)
declare void @use.i1(i1)
define void @test60_extra_use_fold(ptr %foo, i64 %start.idx, i64 %end.offset) {
#0:
%gep1 = gep inbounds ptr %foo, 4 x i64 %start.idx
%gep2 = gep inbounds ptr %foo, 1 x i64 %end.offset
call void @use(ptr %gep1)
call void @use(ptr %gep2)
%cmp1 = icmp eq ptr %gep1, %gep2, offsetonly
call void @use.i1(i1 %cmp1)
%cmp2 = icmp ult ptr %gep1, %gep2
call void @use.i1(i1 %cmp2)
ret void
}
=>
declare void @use(ptr)
declare void @use.i1(i1)
define void @test60_extra_use_fold(ptr %foo, i64 %start.idx, i64 %end.offset) {
#0:
%gep1.idx = shl nsw i64 %start.idx, 2
%gep1 = gep inbounds ptr %foo, 1 x i64 %gep1.idx
%gep2 = gep inbounds ptr %foo, 1 x i64 %end.offset
call void @use(ptr %gep1)
call void @use(ptr %gep2)
%cmp1 = icmp eq i64 %gep1.idx, %end.offset
call void @use.i1(i1 %cmp1)
%cmp2 = icmp slt i64 %gep1.idx, %end.offset
call void @use.i1(i1 %cmp2)
ret void
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 188. PassManager<Function> : Skipping NOP
-- 189. PassManager<Function> : Skipping NOP
-- 190. InstCombinePass
----------------------------------------
define i1 @test_scalable_same(ptr %x) {
#0:
%a = gep ptr %x, 4 x i64 8
%b = gep inbounds ptr %x, 4 x i64 8
%c = icmp ugt ptr %a, %b
ret i1 %c
}
Transformation seems to be correct! (syntactically equal)
-- 191. InstCombinePass
----------------------------------------
define i1 @test_scalable_same(ptr %x) {
#0:
%a = gep ptr %x, 4 x i64 8
%b = gep inbounds ptr %x, 4 x i64 8
%c = icmp ugt ptr %a, %b
ret i1 %c
}
=>
declare i64 @llvm.vscale.i64() nofree willreturn memory(none)
define i1 @test_scalable_same(ptr %x) {
#0:
%#1 = call i64 @llvm.vscale.i64() nofree willreturn memory(none)
%a.idx = shl i64 %#1, 5
%a = gep ptr %x, 1 x i64 %a.idx
%#2 = call i64 @llvm.vscale.i64() nofree willreturn memory(none)
%b.idx = shl i64 %#2, 5
%b = gep inbounds ptr %x, 1 x i64 %b.idx
%c = icmp ugt ptr %a, %b
ret i1 %c
}
Transformation doesn't verify! (not unsound)
ERROR: Couldn't prove the correctness of the transformation
Alive2 approximated the semantics of the programs and therefore we
cannot conclude whether the bug found is valid or not.
Approximations done:
- Unknown libcall: @llvm.vscale.i64
-- 192. PassManager<Function> : Skipping NOP
-- 193. PassManager<Function> : Skipping NOP
-- 194. InstCombinePass
----------------------------------------
define i1 @test_scalable_x(ptr %x) {
#0:
%a = gep ptr %x, 4 x i64 8
%c = icmp eq ptr %a, %x
ret i1 %c
}
Transformation seems to be correct! (syntactically equal)
-- 195. InstCombinePass
----------------------------------------
define i1 @test_scalable_x(ptr %x) {
#0:
%a = gep ptr %x, 4 x i64 8
%c = icmp eq ptr %a, %x, offsetonly
ret i1 %c
}
=>
declare i64 @llvm.vscale.i64() nofree willreturn memory(none)
define i1 @test_scalable_x(ptr %x) {
#0:
%#1 = call i64 @llvm.vscale.i64() nofree willreturn memory(none)
%a.idx.mask = and i64 %#1, 576460752303423487
%c = icmp eq i64 %a.idx.mask, 0
ret i1 %c
}
Transformation doesn't verify! (not unsound)
ERROR: Couldn't prove the correctness of the transformation
Alive2 approximated the semantics of the programs and therefore we
cannot conclude whether the bug found is valid or not.
Approximations done:
- Unknown libcall: @llvm.vscale.i64
-- 196. PassManager<Function> : Skipping NOP
-- 197. PassManager<Function> : Skipping NOP
-- 198. InstCombinePass
----------------------------------------
define i1 @test_scalable_xc(ptr %x) {
#0:
%a = gep ptr %x, 4 x i64 8
%c = icmp eq ptr %x, %a
ret i1 %c
}
Transformation seems to be correct! (syntactically equal)
-- 199. InstCombinePass
----------------------------------------
define i1 @test_scalable_xc(ptr %x) {
#0:
%a = gep ptr %x, 4 x i64 8
%c = icmp eq ptr %x, %a, offsetonly
ret i1 %c
}
=>
declare i64 @llvm.vscale.i64() nofree willreturn memory(none)
define i1 @test_scalable_xc(ptr %x) {
#0:
%#1 = call i64 @llvm.vscale.i64() nofree willreturn memory(none)
%a.idx.mask = and i64 %#1, 576460752303423487
%c = icmp eq i64 %a.idx.mask, 0
ret i1 %c
}
Transformation doesn't verify! (not unsound)
ERROR: Couldn't prove the correctness of the transformation
Alive2 approximated the semantics of the programs and therefore we
cannot conclude whether the bug found is valid or not.
Approximations done:
- Unknown libcall: @llvm.vscale.i64
-- 200. PassManager<Function> : Skipping NOP
-- 201. PassManager<Function> : Skipping NOP
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(3)
-- 202. InstCombinePass
ERROR: Unsupported instruction: %bit = addrspacecast ptr %foo to ptr addrspace(3)
-- 203. InstCombinePass
-- 204. PassManager<Function> : Skipping NOP
-- 205. PassManager<Function> : Skipping NOP
-- 206. InstCombinePass
----------------------------------------
define i1 @test_scalable_ij(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds ptr %foo, 16 x i64 %i
%gep2 = gep inbounds ptr %foo, 4 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 207. InstCombinePass
----------------------------------------
define i1 @test_scalable_ij(ptr %foo, i64 %i, i64 %j) {
#0:
%gep1 = gep inbounds ptr %foo, 16 x i64 %i
%gep2 = gep inbounds ptr %foo, 4 x i64 %j
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
declare i64 @llvm.vscale.i64() nofree willreturn memory(none)
define i1 @test_scalable_ij(ptr %foo, i64 %i, i64 %j) {
#0:
%#1 = call i64 @llvm.vscale.i64() nofree willreturn memory(none)
%#2 = shl nuw i64 %#1, 4
%gep1.idx = mul nsw i64 %i, %#2
%#3 = call i64 @llvm.vscale.i64() nofree willreturn memory(none)
%#4 = shl nuw i64 %#3, 2
%gep2.idx = mul nsw i64 %j, %#4
%cmp = icmp slt i64 %gep1.idx, %gep2.idx
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Couldn't prove the correctness of the transformation
Alive2 approximated the semantics of the programs and therefore we
cannot conclude whether the bug found is valid or not.
Approximations done:
- Unknown libcall: @llvm.vscale.i64
-- 208. PassManager<Function> : Skipping NOP
-- 209. PassManager<Function> : Skipping NOP
-- 210. InstCombinePass
----------------------------------------
define i1 @gep_nuw(ptr %p, i64 %a, i64 %b, i64 %c, i64 %d) {
#0:
%gep1 = gep nuw ptr %p, 4 x i64 %a, 2 x i64 %b
%gep2 = gep nuw ptr %p, 8 x i64 %c, 4 x i64 %d
%cmp = icmp eq ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 211. InstCombinePass
----------------------------------------
define i1 @gep_nuw(ptr %p, i64 %a, i64 %b, i64 %c, i64 %d) {
#0:
%gep1 = gep nuw ptr %p, 4 x i64 %a, 2 x i64 %b
%gep2 = gep nuw ptr %p, 8 x i64 %c, 4 x i64 %d
%cmp = icmp eq ptr %gep1, %gep2, offsetonly
ret i1 %cmp
}
=>
define i1 @gep_nuw(ptr %p, i64 %a, i64 %b, i64 %c, i64 %d) {
#0:
%gep1.split.idx = shl nuw i64 %a, 2
%gep1.idx = shl nuw i64 %b, 1
%#1 = add nuw i64 %gep1.split.idx, %gep1.idx
%gep2.split.idx = shl nuw i64 %c, 3
%gep2.idx = shl nuw i64 %d, 2
%#2 = add nuw i64 %gep2.split.idx, %gep2.idx
%cmp = icmp eq i64 %#1, %#2
ret i1 %cmp
}
Transformation seems to be correct!
-- 212. PassManager<Function> : Skipping NOP
-- 213. PassManager<Function> : Skipping NOP
-- 214. InstCombinePass
----------------------------------------
define i1 @gep_nusw(ptr %p, i64 %a, i64 %b, i64 %c, i64 %d) {
#0:
%gep1 = gep nusw ptr %p, 4 x i64 %a, 2 x i64 %b
%gep2 = gep nusw ptr %p, 8 x i64 %c, 4 x i64 %d
%cmp = icmp eq ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 215. InstCombinePass
----------------------------------------
define i1 @gep_nusw(ptr %p, i64 %a, i64 %b, i64 %c, i64 %d) {
#0:
%gep1 = gep nusw ptr %p, 4 x i64 %a, 2 x i64 %b
%gep2 = gep nusw ptr %p, 8 x i64 %c, 4 x i64 %d
%cmp = icmp eq ptr %gep1, %gep2, offsetonly
ret i1 %cmp
}
=>
define i1 @gep_nusw(ptr %p, i64 %a, i64 %b, i64 %c, i64 %d) {
#0:
%gep1.split.idx = shl nsw i64 %a, 2
%gep1.idx = shl nsw i64 %b, 1
%#1 = add i64 %gep1.split.idx, %gep1.idx
%gep2.split.idx = shl nsw i64 %c, 3
%gep2.idx = shl nsw i64 %d, 2
%#2 = add i64 %gep2.split.idx, %gep2.idx
%cmp = icmp eq i64 %#1, %#2
ret i1 %cmp
}
Transformation seems to be correct!
-- 216. PassManager<Function> : Skipping NOP
-- 217. PassManager<Function> : Skipping NOP
-- 218. InstCombinePass
----------------------------------------
define i1 @pointer_icmp_aligned_with_offset(ptr align(8) %a, ptr align(8) %a2) {
#0:
%gep = gep ptr align(8) %a, 1 x i64 4
%cmp = icmp eq ptr %gep, align(8) %a2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 219. InstCombinePass
----------------------------------------
define i1 @pointer_icmp_aligned_with_offset(ptr align(8) %a, ptr align(8) %a2) {
#0:
%gep = gep ptr align(8) %a, 1 x i64 4
%cmp = icmp eq ptr %gep, align(8) %a2
ret i1 %cmp
}
=>
define i1 @pointer_icmp_aligned_with_offset(ptr align(8) %a, ptr align(8) %a2) {
#0:
ret i1 0
}
Transformation seems to be correct!
-- 220. PassManager<Function> : Skipping NOP
-- 221. PassManager<Function> : Skipping NOP
-- 222. InstCombinePass
----------------------------------------
define i1 @pointer_icmp_aligned_with_offset_negative(ptr align(8) %a, ptr align(8) %a2) {
#0:
%gep = gep ptr align(8) %a, 1 x i64 8
%cmp = icmp eq ptr %gep, align(8) %a2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 223. InstCombinePass
----------------------------------------
define i1 @pointer_icmp_aligned_with_offset_negative(ptr align(8) %a, ptr align(8) %a2) {
#0:
%gep = gep ptr align(8) %a, 1 x i64 8
%cmp = icmp eq ptr %gep, align(8) %a2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 224. PassManager<Function> : Skipping NOP
-- 225. PassManager<Function> : Skipping NOP
-- 226. InstCombinePass
----------------------------------------
define i1 @gep_diff_base_same_indices(ptr %x, ptr %y, i64 %z) {
#0:
%gep1 = gep ptr %x, 1 x i64 %z
%gep2 = gep ptr %y, 1 x i64 %z
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 227. InstCombinePass
----------------------------------------
define i1 @gep_diff_base_same_indices(ptr %x, ptr %y, i64 %z) {
#0:
%gep1 = gep ptr %x, 1 x i64 %z
%gep2 = gep ptr %y, 1 x i64 %z
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 228. PassManager<Function> : Skipping NOP
-- 229. PassManager<Function> : Skipping NOP
-- 230. InstCombinePass
----------------------------------------
define i1 @gep_diff_base_same_indices_nuw(ptr %x, ptr %y, i64 %z) {
#0:
%gep1 = gep nuw ptr %x, 1 x i64 %z
%gep2 = gep nuw ptr %y, 1 x i64 %z
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 231. InstCombinePass
----------------------------------------
define i1 @gep_diff_base_same_indices_nuw(ptr %x, ptr %y, i64 %z) {
#0:
%gep1 = gep nuw ptr %x, 1 x i64 %z
%gep2 = gep nuw ptr %y, 1 x i64 %z
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
define i1 @gep_diff_base_same_indices_nuw(ptr %x, ptr %y, i64 %z) {
#0:
%cmp = icmp ult ptr %x, %y
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 232. PassManager<Function> : Skipping NOP
-- 233. PassManager<Function> : Skipping NOP
-- 234. InstCombinePass
----------------------------------------
define i1 @gep_diff_base_same_indices_nusw(ptr %x, ptr %y, i64 %z) {
#0:
%gep1 = gep nusw ptr %x, 1 x i64 %z
%gep2 = gep nusw ptr %y, 1 x i64 %z
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 235. InstCombinePass
----------------------------------------
define i1 @gep_diff_base_same_indices_nusw(ptr %x, ptr %y, i64 %z) {
#0:
%gep1 = gep nusw ptr %x, 1 x i64 %z
%gep2 = gep nusw ptr %y, 1 x i64 %z
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
=>
define i1 @gep_diff_base_same_indices_nusw(ptr %x, ptr %y, i64 %z) {
#0:
%cmp = icmp ult ptr %x, %y
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 236. PassManager<Function> : Skipping NOP
-- 237. PassManager<Function> : Skipping NOP
-- 238. InstCombinePass
----------------------------------------
define i1 @gep_diff_base_same_indices_nuw_nusw(ptr %x, ptr %y, i64 %z) {
#0:
%gep1 = gep nuw ptr %x, 1 x i64 %z
%gep2 = gep nusw ptr %y, 1 x i64 %z
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 239. InstCombinePass
----------------------------------------
define i1 @gep_diff_base_same_indices_nuw_nusw(ptr %x, ptr %y, i64 %z) {
#0:
%gep1 = gep nuw ptr %x, 1 x i64 %z
%gep2 = gep nusw ptr %y, 1 x i64 %z
%cmp = icmp ult ptr %gep1, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 240. PassManager<Function> : Skipping NOP
-- 241. PassManager<Function> : Skipping NOP
-- 242. InstCombinePass
----------------------------------------
define i1 @gep_multiple_eq(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep ptr %base, 4 x i64 %idx
%gep2 = gep ptr %gep1, 4 x i64 %idx2
%cmp = icmp eq ptr %gep2, %base
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 243. InstCombinePass
----------------------------------------
define i1 @gep_multiple_eq(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep ptr %base, 4 x i64 %idx
%gep2 = gep ptr %gep1, 4 x i64 %idx2
%cmp = icmp eq ptr %gep2, %base, offsetonly
ret i1 %cmp
}
=>
define i1 @gep_multiple_eq(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1.idx1 = add i64 %idx, %idx2
%.mask = and i64 %gep1.idx1, 4611686018427387903
%cmp = icmp eq i64 %.mask, 0
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 244. PassManager<Function> : Skipping NOP
-- 245. PassManager<Function> : Skipping NOP
-- 246. InstCombinePass
----------------------------------------
define i1 @gep_multiple_eq_commuted(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep ptr %base, 4 x i64 %idx
%gep2 = gep ptr %gep1, 4 x i64 %idx2
%cmp = icmp eq ptr %base, %gep2
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 247. InstCombinePass
----------------------------------------
define i1 @gep_multiple_eq_commuted(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep ptr %base, 4 x i64 %idx
%gep2 = gep ptr %gep1, 4 x i64 %idx2
%cmp = icmp eq ptr %base, %gep2, offsetonly
ret i1 %cmp
}
=>
define i1 @gep_multiple_eq_commuted(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1.idx1 = add i64 %idx, %idx2
%.mask = and i64 %gep1.idx1, 4611686018427387903
%cmp = icmp eq i64 %.mask, 0
ret i1 %cmp
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 248. PassManager<Function> : Skipping NOP
-- 249. PassManager<Function> : Skipping NOP
-- 250. InstCombinePass
----------------------------------------
define i1 @gep_mugtiple_ugt_nuw(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep nuw ptr %base, 4 x i64 %idx
%gep2 = gep nuw ptr %gep1, 4 x i64 %idx2
%cmp = icmp ugt ptr %gep2, %base
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 251. InstCombinePass
----------------------------------------
define i1 @gep_mugtiple_ugt_nuw(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep nuw ptr %base, 4 x i64 %idx
%gep2 = gep nuw ptr %gep1, 4 x i64 %idx2
%cmp = icmp ugt ptr %gep2, %base
ret i1 %cmp
}
=>
define i1 @gep_mugtiple_ugt_nuw(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1.idx1 = sub i64 0, %idx2
%cmp = icmp ne i64 %idx, %gep1.idx1
ret i1 %cmp
}
Transformation seems to be correct!
-- 252. PassManager<Function> : Skipping NOP
-- 253. PassManager<Function> : Skipping NOP
-- 254. InstCombinePass
----------------------------------------
define i1 @gep_mugtiple_ugt_not_all_nuw(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep nuw ptr %base, 4 x i64 %idx
%gep2 = gep ptr %gep1, 4 x i64 %idx2
%cmp = icmp ugt ptr %gep2, %base
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 255. InstCombinePass
----------------------------------------
define i1 @gep_mugtiple_ugt_not_all_nuw(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep nuw ptr %base, 4 x i64 %idx
%gep2 = gep ptr %gep1, 4 x i64 %idx2
%cmp = icmp ugt ptr %gep2, %base
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 256. PassManager<Function> : Skipping NOP
-- 257. PassManager<Function> : Skipping NOP
-- 258. InstCombinePass
----------------------------------------
define i1 @gep_mugtiple_ugt_inbounds_nusw(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep inbounds ptr %base, 4 x i64 %idx
%gep2 = gep nusw ptr %gep1, 4 x i64 %idx2
%cmp = icmp ugt ptr %gep2, %base
ret i1 %cmp
}
Transformation seems to be correct! (syntactically equal)
-- 259. InstCombinePass
----------------------------------------
define i1 @gep_mugtiple_ugt_inbounds_nusw(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1 = gep inbounds ptr %base, 4 x i64 %idx
%gep2 = gep nusw ptr %gep1, 4 x i64 %idx2
%cmp = icmp ugt ptr %gep2, %base
ret i1 %cmp
}
=>
define i1 @gep_mugtiple_ugt_inbounds_nusw(ptr %base, i64 %idx, i64 %idx2) {
#0:
%gep1.idx1 = add i64 %idx, %idx2
%#1 = shl i64 %gep1.idx1, 2
%cmp = icmp sgt i64 %#1, 0
ret i1 %cmp
}
Transformation doesn't verify! (unsound)
ERROR: Value mismatch
Example:
ptr %base = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000002
i64 %idx = #x0000000000000001 (1)
i64 %idx2 = #x1fffffffffffffff (2305843009213693951)
Source:
ptr %gep1 = pointer(non-local, block_id=1, offset=4) / Address=#x0000000000000006
ptr %gep2 = pointer(non-local, block_id=1, offset=-9223372036854775808) / Address=#x8000000000000002
i1 %cmp = #x1 (1)
SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: 0
Block 1 > size: 9 align: 1 alloc type: 0 alive: true address: 2
Target:
i64 %gep1.idx1 = #x2000000000000000 (2305843009213693952)
i64 %#1 = #x8000000000000000 (9223372036854775808, -9223372036854775808)
i1 %cmp = #x0 (0)
Source value: #x1 (1)
Target value: #x0 (0)
Pass: InstCombinePass
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' '-passes=instcombine' '-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_82jNjjq6_jxCp.bc"
------------------- SMT STATS -------------------
Num queries: 233
Num invalid: 0
Num skips: 0
Num trivial: 108 (31.7%)
Num timeout: 11 (4.7%)
Num errors: 0 (0.0%)
Num SAT: 112 (48.1%)
Num UNSAT: 110 (47.2%)
Alive2: Transform doesn't verify; aborting!
/home/nlopes/alive2/build/opt-alive.sh -passes=instcombine -S < /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/icmp-gep.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/icmp-gep.ll # RUN: at line 2 + /home/nlopes/alive2/build/opt-alive.sh -passes=instcombine -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/icmp-gep.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/icmp-gep.ll