-
Notifications
You must be signed in to change notification settings - Fork 11
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
wp-interpolation on single dimension arrays #368
Comments
Output without array:
Output with array:
|
on which branch do you run this example? is it |
no the |
@rasoolmaghareh I don't remember the old code on wp-interpolant on arrays you mentioned. Could you show me where it is? |
I see this function
The result of this: |
I had intentionally stopped those codes. Please remove these lines to activate the previous codes: In
In
In
In
|
When we call this function |
Can you post the state of the path just before this subsumption check. You can use |
When I declare array
|
@rasoolmaghareh I think there are something wrong with data of dependency in funtion
And the result I got is like this:
Why do we have offset values like 42,43 here, I don't know if this is a bug or it has other usages |
@xuanlinhha My understanding is that everything is fine here. 1- Regarding having 2- Regarding I think the main issue over here is why the correct WP formula is not generated when the array is global. Let's focus back on this. |
I uncommented your code and update to like this: |
yes. |
But how about this:
|
And I run with this program: #361 (comment) |
@xuanlinhha: I have checked the output and the first issue seems to be from the partitioning. Have a look at the stored interpolant:
Hear |
In
I think we can link |
Hi Linh, If you look at the last instruction before For example, in this program we have:
Here, |
Currently, there are 2 places we get the name of |
I am not sure if I understood your question completely. But I think it is needed at least when generating WP. |
When we create WP for
|
@xuanlinhha: I think the easier way is to look at the previous instruction in the reverseInstructionList. If you look at the parent node, the instruction before |
In the TxWeakestPreCondition::getLoad, I can access the TxTreeNode corresponding to that TxWeakestPreCondition and |
I think we might require to look at the parent node while they are in the same function. The reason is that if there are two if-stmt between the current instruction and the top of the function, the alloca would be in the grandparent node. |
@rasoolmaghareh 1 thing I found is that when we see |
@xuanlinhha I think WPVar("%1") would be good enough. Later on, when there is a store into %1, the wp formula is updated naturally. |
So with the format on your machine, |
I suggest we discuss this more in an online meeting. |
@xuanlinhha, with respect to our discussion, there are three things that should be checked: 1- Return instruction I will first start with the third case. After fixing this we will go to case 2 and case 1. Consider this program:
Attached please find the output of my run. Here you can see that the partitioning is not working correctly and the same variable appears on the both sides of the Interpolant:
Issues: Please fix this issue and we will continue with the other two issues. The ourput interpolant should be like this:
|
@rasoolmaghareh: I think these issues are related each other. |
The problem now is that we don't know how to map |
Consider this function:
If you compile this function to LLVM, you will have 4
|
But for this function, there is not
|
can you post the C function, probably it has no return value (void). |
It has but it returns the param:
|
Ok, I think we can agree that LLVM is not acting consistently in every place. The best way to detect the arguments seems to be the first instructions after the
Here, |
But I found this case in
it stores to |
In such a case %1 is the return value. If you compile this on my version |
so how to differentiate between the return value and parameter? |
The algorithm would be like this: 1- |
I updated the code like this:
The passed argument is a GE, it will produce a Another issue is that in the concrete address store we can remove row containing |
I think we need to remember the information that |
If we keep
And the entry is like this:
And the list of instructions in the current node is:
I don't know when we replace |
If we just replace |
I see your point, I think we might need to design a new approach for the |
@xuanlinhha and I have fixed this issue halfway, I will close this issue now. I have created 3 new issues for 3 crashes. |
@xuanlinhha, let's uncomment our old code on wp-interpolant on arrays.
This is a sample test program. If we had
sum += v * x;
then the wp-interpolant works correctly. But when havingsum += v * weight[x];
the wp-interpolant is not generated. Can you kindly start working on this and let me know if you face any issues:The text was updated successfully, but these errors were encountered: