implied: improve overwrite_states_using_pool()
How this worked originally is we have code like:
if (...) {
a = 0;
} else if (...) {
a = 0;
} else {
a = 1;
}
if (a == 0)
b = 2;
return a;
So then we look at the stree where a was set, and any states which were
set specifically in that path, then we use those and overwrite the fake
cur stree. The problem is that we miss some implications this way.
The solution is to re-use the existing implication code.
We group all the similar possible leaf sm states together. We set the
true and false stack. Then we reuse the implication code. It's simple
enough.
Grouping the similar states together means that we have fewer separate
returns to handle with seems like a good thing. I introduced the
ptr_in_list() function to see if we have already handled that return
range.
The other thing here is that I noticed that split_helper() and
call_return_state_hooks_split_possible() are basically the same function
so I merged them together. I probably should have done that in a separate
patch but I am a loser.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>