<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/114902>114902</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
wrong range check in correlated propagation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bongjunj
</td>
</tr>
</table>
<pre>
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
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkVkGP6jYQ_jXmYrFy7ASSQw7sApe-95B2t6p6Qo5tgvc5dmQ7LOyvr-wENkt52qe2h1ZFKGTi7_vGmRkPQ52TtRaiBNk9yJYT2vm9sWVldP3S6ZdJZfipXCh5EBha0RrrAVnAvfetA2QB8BrgNY3Ld0odmjtja4DXTAC8fgN43WTb37YMoCVAi-E6Q_03wPtH05_8DAIpqiAgS1grU1EFcZ7D6uSFA_gBUiVrDdMLko2R6Y9w8crFTmoB5SyFIEWtnaWzWXGHAc4BLiCY3w9gTFB482hACHC23TKjnRfH1m5R70-0UOrKdJo72HobBKvgNuz1GF2gYKaDgbORHGvaKCLDjRY9_8pLIIe3G9GaTkWaE0owD2UyaAVo8NFpLnZnIxn7M_pAIvVNHEdE6E3AjpCU84gLvzFM0WvcyyBzBlvhzwjK-RC4-XK4IUtAVv_CZP5fc6ndK9Td6yc5BTgDmFiqa7FF25EEwEl8Os74ZW_Dza3K-JPaVZ08W6rdztiGemk05EY4DfDcw4OwcncCOBlnfPX4uHkMvemZ2jo4cbAxVsDWSGe06Rz0e6qhM51l4gPxSJtWiUsZ9NenHnd-eCtx8eVbI7UXFuBcGz1VhtEYvEoZ9n0rOSDLmGCz2znhAVkmCMUKxGu44NwK58JxwOTIEepdvSetDy45hgd5AnAxAC5puiDQ1ScQUCQUILuvqBMcGt3XDTxQ1QmQLT-ovVfODb3bG3jP_2eEIaSbXx8fVvDr6uvm8Xf49Lx4Xo0awl_6Rvq3zbfpl83D4gu8_7J5-OXpkrT7kAQY8rQCqHDyLeQznFuAitgzgplGQxkG_amNANQvH6LhbSeCfc7VAhKM87F-cqWf_i31fByxvpT_o0UY1vP0mvDP1lkWCNk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