[Attributor] Deduction based on path exploration
authorHideto Ueno <uenoku.tokotoko@gmail.com>
Mon, 9 Mar 2020 05:19:32 +0000 (14:19 +0900)
committerHideto Ueno <uenoku.tokotoko@gmail.com>
Mon, 9 Mar 2020 05:29:26 +0000 (14:29 +0900)
commitbdcbdb484829c518511eece0809cc8ce1baa73c8
tree165d290646113537830a4d4224f425b910085384
parent5e080dff756400f0fc92a6123230113777738c4c
[Attributor] Deduction based on path exploration

This patch introduces the propagation of known information based on path exploration.
For example,
```
int u(int c, int *p){
  if(c) {
     return *p;
  } else {
     return *p + 1;
  }
}
```
An argument `p` is dereferenced whatever c's value is.

For an instruction `CtxI`, we accumulate branch instructions in the must-be-executed-context of `CtxI` and then, we take the conjunction of the successors' known state.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D65593
llvm/include/llvm/Analysis/MustExecute.h
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
llvm/test/Transforms/Attributor/dereferenceable-1.ll
llvm/test/Transforms/Attributor/nonnull.ll