pseudo lowering

I have a bunch of pseudos that I want to lower right after instruction selection.

Where is the best place to do that?

I was planning to use expandPostRAPseudo.

Is there a better place?

TIA.

Reed

That's exactly the right place.

Cameron

That's exactly the right place.

Really? You don't want the expansion to be optimized? You want to specify a machine model for the pseudo's as if they're real instructions? You don't want to schedule or register allocate the real instructions?

-Andy

So then maybe my code should be called during instruction selection? The very original MIPs port was for Mips I and Mips I has a need for lots of psuedos because it’s primitive. That code has mostly been removed now because we don’t support Mips I which is just an historical processor at this time. I approach level one implementations of things from the point of view of correctness and then make things better as I understand the problem better. So my base scheme for all of this was to create multi line assembler expansion in pseudos. Now that I’m passing mostly all of test-suite, I’m starting improve things. At this time, I’m starting to place expansion in

So then maybe my code should be called during instruction selection? The very original MIPs port was for Mips I and Mips I has a need for lots of psuedos because it’s primitive. That code has mostly been removed now because we don’t support Mips I which is just an historical processor at this time. I approach level one implementations of things from the point of view of correctness and then make things better as I understand the problem better. So my base scheme for all of this was to create multi line assembler expansion in pseudos. Now that I’m passing mostly all of test-suite, I’m starting improve things. At this time, I’m starting to place expansion in

expandISelPseudos is the place to cleanup after ISEL hacks, and can create BBs. But, as Cameron explained well in the other thread, if you want a macro assembler for some sequences, do it late in expandPostRAPseudos.
-Andy

I feel like I should expand things as soon as I have all the information because then other passes can help make things better. So maybe I do this earlier in expandIselPseudos. Are there any cons ?

I feel like I should expand things as soon as I have all the information because then other passes can help make things better. So maybe I do this earlier in expandIselPseudos. Are there any cons ?

If the instructions must be adjacent for correctness or cannot be spilled within the sequence, then you have a problem. Sorry to be vague, but I’ll again refer you to Cameron’s detailed response.
-Andy

I somehow dyslexically read that as post-isel not post-RA. That's what I get for sending emails from my phone. Thanks for the correction.

Cameron

Thanks for all the help. This is saving me lots of time and making better code and helping me to avoid possible bugs.

I think that I can solve half of this now by just adding Defs and Uses to the instructions I am generate during the pseudo lowering.

I need to move this transformation to a different place as you guys are suggesting.

Now I have to either intelligently split the pseudos that have jmp instructions or else use machine bundles.

I've posted a separate topic on expanding the pseudos with branches since it has different issues.

All this will be reviewed internally by Akira at Mips on post commit.

Reed