On Mon, Feb 28, 2005 at 09:39:49PM -0600, Brent Monroe
wrote:> I need to generate a branch instruction from within CodeGenIntrinsic
> in SparcV9BurgISel.cpp. I generate a few instructions and add them to
> the mvec vector, and then I need to generate a branch whose target is
> the first instruction in the vector.
>
> I've seen how other portions of the code do this, but they have access
> to more information than CodeGenIntrinsic.
The long-term solution would be to restructure the V9 backend to
generate code like X86 and PPC backends do -- using MachineBasicBlocks
instead of std::vector<MachineInst*> .
However, that is an involved project, so as a short-term workaround, you
may need to change the signature of CodeGenIntrinsic to pass in the
parameters that you need (adding MashineBasicBlock and/or an
iterator...?). I don't see another way, but maybe someone else does?
If I am correct in this, I recommend you try to make your changes
minimal with respect to the current V9 codebase and make sure you don't
introduce any regressions, and then submit a patch.
--
Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu