Closed richardmembarth closed 7 years ago
The actual problem are the two identical bitcasts which are mapped to the same thorin node and represent a constant primop:
lambda_crit_520(mem mem_521, fn(mem) return_522, [pf32]* _523, qs32 _524)
bool _525 = lt _524, qs32 1
pf32* idx_527 = lea _523, _524
br_498(_525, if_then_526, if_else_531)
if_else_531()
mem _532 = store mem_521, idx_527, (pf32 bitcast qs32 2147483647)
return_522(_532)
if_then_526()
mem _530 = store mem_521, idx_527, (pf32 bitcast qs32 2147483647)
return_522(_530)
br_498(bool br_499, fn() br_500, fn() br_501)
For the first instance we generate correct code, but use the cached variable for the second. Our llvm-based back ends fold the bitcast (done by llvm) and we get directly a constant in both cases.
We generate incorrect code for the following example:
Generated CUDA code:
Problem: _566 is not set when entering l568.