BlockAddress is a "User"

I’ve been playing around with the new IndirectBr and BlockAddress types. I’m finding that in CodeGen, during “EliminateMostlyEmptyBlocks”, BlockAddresses are not updated to point to the newly merged block if the original block was eliminated. This is causing me problems. Mind you, I’m experimenting with this using the Sparc backend, which could be the source of blame, but this seems unlikely. Thoughts?

My apologies. This problem was indeed with my changes to the backend. Next time I will more carefully examine the source of the problem. :slight_smile:

Can you elaborate? I don’t see anything in that code to check for blocks that have their addresses taken. It seems like something like the attached patch may be in order, but I don’t have a testcase to expose the issue. Maybe your changes could help identify a testcase? Or did you find something that prevents this from being an issue?

blkaddr.patch (636 Bytes)