[ConstantHoisting] Add back ptr->ptr bitcast to avoid assertion failure
In commit a7ee80fa a ptr->ptr bitcast was removed. But that seem to cause "Expected an cast instruction!" assertions later in that pass. This patch will add back the bitcast again. This was a bit unexpected since there is no bitcast added after creating the Add instruction in the else clause, but I guess there is something special with the GetElementPtr scenario which makes this bitcast needed to avoid such asserts. This patch is also adding a reproducer for https://github.com/llvm/llvm-project/issues/52689 that started to fail due to hitting the above mentioned assert. Now it should end up hitting the assertion failure from #52689 again.
Loading
Please sign in to comment