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

Is there a block-level ICFG in SVF? #1331

Closed
Qcloud1223 opened this issue Jan 16, 2024 · 3 comments
Closed

Is there a block-level ICFG in SVF? #1331

Qcloud1223 opened this issue Jan 16, 2024 · 3 comments

Comments

@Qcloud1223
Copy link
Contributor

Hi, I want to traverse all basic blocks of a function as well as its sub-procedures, and check if a block is dominator of another. Currently I'm using ICFG, but 1) it's instruction-level so it's too inefficient 2) still need to get to basic block to get dominator info.

I've looked at the implementation of CFBasicBlockG, and it really looks like a block-level ICFG.
However, it confuses me to see CFBasicBlockNode contains a vector of ICFGNode, instead of SVFBasicBlock. I found that it's intentional in #1227, which remove getSVFBasicBlock for CFBasicBlockNode, but getFunction remains. Does that mean a CFBasicBlockNode can contain instructions across multiple blocks?

Did I miss something or misunderstanding what this graph is for?

Thank you!

@yuleisui
Copy link
Collaborator

@jumormt could you help answer this question?

@jumormt
Copy link
Contributor

jumormt commented Jan 17, 2024

The cfbasicblocknode does not contain instructions across basic blocks. If a basicblock does not contain a call instruction, it is represented as a single cfbasicblocknode. Otherwise, the basicblock is split by each call in the block and each call basicblock connects to its callee.

@Qcloud1223
Copy link
Contributor Author

Oh, that makes sense. I thought br is the only instruction that causes control flow to move to another block. Indeed CFBasicBlockNode should not contain a whole basic block.

Thank you very much for your reply!

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