[llvm-dev] [Backend] MachineBasicBlock ReplaceUseOfBlockWith

Feng, Yaotian via llvm-dev llvm-dev at lists.llvm.org
Sat Mar 7 23:15:54 PST 2020


Im working on a target that has only indirect branches, so I managed to create a pseudo instruction that loads the base of the branch target and the branch instruction would use it to branch. However there is one problem that is when the branch target MBB is replaced. The replacement function inside MachineBasicBlock.cpp will iterate the instructions and replace the target block until it hits a non-terminator. However with the setup I have even if I label my load base as a terminator and glue it to my branch instruction it seems like During Register allocation there could be spill load stores inserted between my load offset and branch thus preventing the replacement routine to replace the operant on the load address instruction. Am I doing anything wrong here? Or is there a better way for this load address to happen?

Sincerely,
Yaotian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200308/e8421a91/attachment.html>


More information about the llvm-dev mailing list