Skip to content

C++: IR sanity queries for outgoing edges #811

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

Merged
merged 1 commit into from
Jan 24, 2019

Conversation

jbj
Copy link
Contributor

@jbj jbj commented Jan 23, 2019

These queries have no results on our test cases in the repo, but ambiguousSuccessors has results on any large C++ code base, and unexplainedLoop has results on Windows builds of ChakraCore. I haven't been able to replicate these problems in qltest, so I think they have to do with linker awareness or with how declarations of similar names show up in different files.

Given the vast number of results for ambiguousSuccessors, fixing these problems could be necessary not just for correctness but also for performance. Here is a screenshot of raw/PrintIR.ql for a function that comes up in both of these new sanity queries.

unexplainedloop

This is the source of that function: https://github.com/Microsoft/ChakraCore/blob/08161b0b4110e3888f77632a9f40a2229884bbe7/lib/Runtime/Base/Entropy.cpp#L14-L21.

These queries have no results on our test cases in the repo, but
`ambiguousSuccessors` has results on any large C++ code base, and
`unexplainedLoop` has results on Windows builds of ChakraCore.
@dave-bartolomeo
Copy link
Contributor

Wow, the top half of that IR graph is a mess. What I find most disturbing is that there are multiple blocks labeled Block 6, all of which seem to be empty, which should be impossible because a block is just a set of instructions. I suspect that something is going wrong in the IR dump code, in addition to whatever is broken in the IR generation.

Copy link
Contributor

@dave-bartolomeo dave-bartolomeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New sanity tests LGTM.

@dave-bartolomeo dave-bartolomeo merged commit 63ed0c5 into github:master Jan 24, 2019
jbj added a commit to jbj/ql that referenced this pull request Jan 25, 2019
This prevents loops of non-back-edges on ChakraCore (see github#811).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants