| Issue |
114902
|
| Summary |
wrong range check in correlated propagation
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
bongjunj
|
Alive2 report: https://alive2.llvm.org/ce/z/m5_W_c
```llvm
----------------------------------------
@b = global 288 bytes, align 4
@c = global 4 bytes, align 4
define i64 @pr64669.2() {
#0:
%__constexpr_0 = gep inbounds ptr @b, 288 x i64 0, 4 x i64 25
%cmp = icmp ne ptr %__constexpr_0, @c
%mul = select i1 %cmp, i64 undef, i64 1
%conv3 = zext i1 %cmp to i64
%add = add i64 %mul, %conv3
ret i64 %add
}
=>
@b = global 288 bytes, align 4
@c = global 4 bytes, align 4
define i64 @pr64669.2() {
#0:
%__constexpr_0 = gep inbounds ptr @b, 288 x i64 0, 4 x i64 25
%cmp = icmp ne ptr %__constexpr_0, @c
%mul = select i1 %cmp, i64 undef, i64 1
%conv3 = zext i1 %cmp to i64
%add = add nsw nuw i64 %mul, %conv3
%#range_0_%add = !range i64 %add, i64 1, i64 3
ret i64 %#range_0_%add
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source
Example:
Source:
ptr %__constexpr_0 = pointer(non-local, block_id=0, offset=100) / Address=#xd00
i1 %cmp = #x1 (1)
i64 %mul = #x0000000000000000 (0) [based on undef value]
i64 %conv3 = #x0000000000000001 (1)
i64 %add = #x0000000000000001 (1)
SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 288 align: 4 alloc type: 0 alive: true address: 3228
Block 1 > size: 4 align: 4 alloc type: 0 alive: true address: 8
Target:
ptr %__constexpr_0 = pointer(non-local, block_id=0, offset=100) / Address=#xd00
i1 %cmp = #x1 (1)
i64 %mul = #x0000000000000004 (4)
i64 %conv3 = #x0000000000000001 (1)
i64 %add = #x0000000000000005 (5)
i64 %#range_0_%add = poison
Source value: #x0000000000000001 (1)
Target value: poison
Summary:
0 correct transformations
1 incorrect transformations
0 failed-to-prove transformations
0 Alive2 errors
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs