Hi Everyone,

I have been trying to build a SSA graph for a functionUnit using functionUnit->SsaInfo->Build(); but I keep encountering

a Phoenix assertion failure. I want to build this graph so that I can access the definition instructions for the source operands for

certain instructions. Can someone please help me out with this

Thanks a lot!

Re: Phoenix SSA graph construction

Andy Ayers - MSFT

The UninitializedLocal sample has an example of how to build SSA, but here's an overview in C++ syntax.

First, you need to make sure there is an SSA::Info object on the functionUnit. Usually there won't be one -- this is possibly the bug you are running into.

Code Snippet

if (!functionUnit->SsaInfo)


functionUnit->SsaInfo = Phx::SSA::Info::New(functionUnit->Lifetime, functionUnit,



Then, use the SSA::Info object to build SSA:

Code Snippet

Then, use the SSA data for your analysis (details omitted for now -- we can revisit when you get SSA built for your function).

Finally, delete SSA and if your phase created the info object, delete it:

Code Snippet


functionUnit->SsaInfo = nullptr;

Re: Phoenix SSA graph construction


Thanks! This helps.