Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are SSAPiInstructions inserted at the end of basic blocks? #83

Closed
StephanGocht opened this issue Jul 14, 2015 · 4 comments
Closed

Comments

@StephanGocht
Copy link
Contributor

Is there a reason SSAPiInstructions are inserted at the end of basic blocks?

I think it is not intuitive: Usually basic blocks have a single exit point. In case of a conditional branch, there will be pi instructions for each successor of the branch. Both pi instructions are inserted into the basic block of the branch. As a result this basic block has now two exit points.

@cos
Copy link
Contributor

cos commented Jul 16, 2015

The SSAPiInstructions do not actually introduce new control-flow, they are only markers you can use for other analyses. What are you trying to do? If they are simply in your way, you can disable them from SSAOptions.

@StephanGocht
Copy link
Contributor Author

We have two analysis, one needs the SSAPiInstructions, while the other may have a problem with them. But it is nothing we can't fix.

I just thought, that the pi instructions are inserted in the control-flow between the condition and its successors. If you "execute" the SSA form, you need to execute one of the pi-assignments, after branching. So they should introduce new control-flow, shouldn't they?

@cos
Copy link
Contributor

cos commented Aug 6, 2015

While SSAPiInstructions do have a reference to a basic block number, they do not influence the control-flow at all, i.e., they do not introduce any branching. You can safely simply ignore them when "executing" the SSA form in some way.

@msridhar
Copy link
Member

msridhar commented Aug 6, 2015

Closing as I don't think there's a bug here

@msridhar msridhar closed this as completed Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants