[loop-invariant] Look back up-to loop head
[loop-invariant] Look back up-to loop head

Summary:
Loop-invariant analysis invalidates variables that are used as arguments to functions that modify their arguments. This invalidation relied on looking back a single node for finding the variables to invalidate:

e.g. imagine that we wanted to invalidate `n$14`  in node Y (successor of X):

```
n$12=_fun___new(sizeof(t=java.lang.StringBuilder):java.lang.StringBuilder*) -- node X
n$13=_fun_StringBuilder.<init>()(n$12:java.lang.StringBuilder*)
*&$irvar2:java.lang.StringBuilder*=n$12
```

```
n$14=*&$irvar2:java.lang.StringBuilder*  -- node Y
n$16= impure_function_modifies_arg(n$14)
```

and when we invalidate `n$14`, we would go try invalidate `$irvar2` in Y's predecessor (which is X).

Before D31755369, the initializations were in one a single node (X) but after D31755369, initialization is now split into two nodes (X' and X''):

```
n$12=_fun___new(sizeof(t=java.lang.StringBuilder):java.lang.StringBuilder*)  -- node X'
*&$irvar2:java.lang.StringBuilder*=n$12

```
```
n$13=*&$irvar2:java.lang.StringBuilder*  --- node X''
n$14=_fun_StringBuilder.<init>()(n$13:java.lang.StringBuilder*)
```

Before, when we were trying to invalidate `$irvar2` in node Y,  it sufficed to look at its predecessor (node X) to also invalidate `n$12`. Now, after D31755369, when we need to invalidate `$irvar2` in Y, it is not enough to look at X'' but we must also check X'.

This diff fixes this issue by checking back in all statement nodes up to the loop head for invalidation.

Reviewed By: skcho

Differential Revision: D31926534

fbshipit-source-id: ff31cf269

facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer