[llvm-dev] Unreferenced BlockAddress broke IR compilation?

Zhang via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 11 20:41:37 PDT 2021


Hi:
I'm currently using 176249bd @ release/11.x for a downstream project that contains two passes.
The first pass randomly introduces DeadBasicBlocks (BasicBlocks that are not branched to in any way).
The second pass creates BlockAddress of all BasicBlocks in a function, put them into a GlobalVariable and patch br instructions to GEP+Load+indibr instructions.


When the first pass didn't create deadBasicBlock, the transformed IR fully works as intended, however if deadbasicblock is introduced, all elements in the GV created in the second pass references to the same address in the compiled object file.


Not sure if this is a bug on LLVM side or not
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210412/802d4e13/attachment.html>


More information about the llvm-dev mailing list