Hi, I’m working on the backend for a custom compiler that I’m building for a student project. I make several transformations to the code at the IR level, but the correctness of these transformations is affected by spilled registers under certain conditions.
I can identify these registers using a MachineIR pass but undoing the transformations at the MachineIR level seems cumbersome and impractical. Ideally, I would want to be able to locate the IR basic blocks which include the offending register spills so I can undo the transformations to these blocks.
What would be the best way to do this? I noticed that the API offers a getBasicBlock() function on the MachineIR block, although I am not sure how much it would help my situation since I need a lot of other information that I gather in analysis passes at the IR level to undo the changes.
I would be happy to share any more details about my problem that would help you to point me in the right direction.