llvm-project/llvm/test/Transforms/Attributor
Johannes Doerfert 94d3b59c56 [Attributor][FIX] Do not introduce multiple instances of SSA values
If we have a recursive function we could create multiple instantiations
of an SSA value, one per recursive invocation of the function. This is a
problem as we use SSA value equality in various places. The basic idea
follows from this test:

```
static int r(int c, int *a) {
  int X;
  return c ? r(false, &X) : a == &X;
}

int test(int c) {
  return r(c, undef);
}
```

If we look through the argument `a` we will end up with `X`. Using SSA
value equality we will fold `a == &X` to true and return true even
though it should have been false because `a` and `&X` are from different
instantiations of the function.

Various tests for this  have been placed in value-simplify-instances.ll
and this commit fixes them all by avoiding to produce simplified values
that could be non-unique at runtime. Thus, the result of a simplify
value call will always be unique at runtime or the original value, both
do not allow to accidentally compare two instances of a value with each
other and conclude they are equal statically (pointer equivalence) while
they are unequal at runtime.
2021-07-22 00:07:55 -05:00
..
ArgumentPromotion [Attributor] Extend the AAValueSimplify compare simplification logic 2021-07-20 00:35:14 -05:00
IPConstantProp [Attributor] Simplify to values in the genericValueTraversal 2021-07-20 01:39:34 -05:00
reduced Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
align.ll [Attributor] Extend the AAValueSimplify compare simplification logic 2021-07-20 00:35:14 -05:00
allow_list.ll [Attributor][NFC] Update tests after D94741 2021-03-11 23:31:39 -06:00
alwaysinline.ll [Attributor][NFC] Update tests after D94741 2021-03-11 23:31:39 -06:00
callbacks.ll [Attributor] Set floating point loads and stores as nofree in AANoFreeFloating 2021-06-09 16:16:37 -04:00
callgraph.ll [Attributor] Simplify operands inside of simplification AAs first 2021-07-06 22:41:18 -05:00
cb_liveness_disabled.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
cb_liveness_enabled.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
cb_range_disabled.ll [Attributor] Derive `willreturn` based on `mustprogress` 2021-03-11 23:31:44 -06:00
cb_range_enabled.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
cgscc_bugs.ll [Attributor] Extend the AAValueSimplify compare simplification logic 2021-07-20 00:35:14 -05:00
chain.ll [Attributor][NFC] Update tests after D94741 2021-03-11 23:31:39 -06:00
depgraph.ll [Attributor] Use checkForAllUses instead of custom use tracking 2021-07-20 01:39:33 -05:00
dereferenceable-1.ll [Attributor] Introduce a helper function to deal with undef + none 2021-07-06 22:41:21 -05:00
dereferenceable-2-inseltpoison.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
dereferenceable-2.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
heap_to_stack.ll [Attributor] Use checkForAllUses instead of custom use tracking 2021-07-20 01:39:33 -05:00
heap_to_stack_gpu.ll [Attributor] Extend the AAValueSimplify compare simplification logic 2021-07-20 00:35:14 -05:00
internal-noalias.ll [Attributor] Introduce AAPointerInfo 2021-07-19 22:48:35 -05:00
internalize.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
lit.local.cfg [FileCheck] Default --allow-unused-prefixes to false 2021-02-08 13:37:04 -08:00
liveness.ll [Attributor] Extend the AAValueSimplify compare simplification logic 2021-07-20 00:35:14 -05:00
liveness_chains.ll [Attributor][NFC] Update tests after D94741 2021-03-11 23:31:39 -06:00
lowerheap.ll [IR] Memory intrinsics are not unconditionally `nosync` 2021-05-21 03:40:59 +02:00
lvi-after-jumpthreading.ll [Attributor] Introduce a helper function to deal with undef + none 2021-07-06 22:41:21 -05:00
lvi-for-ashr.ll [Attributor] Look through selects in genericValueTraversal 2021-07-10 16:44:05 -05:00
memory_locations.ll [Attributor][FIX] Do not introduce multiple instances of SSA values 2021-07-22 00:07:55 -05:00
misc.ll [OpaquePtr] Support forward references in textual IR 2021-06-29 20:10:31 +02:00
misc_crash.ll [Attributor] Introduce AAPointerInfo 2021-07-19 22:48:35 -05:00
new_attributes.ll [Attributor][NFC] Update tests after D94741 2021-03-11 23:31:39 -06:00
noalias.ll [Attributor] Simplify loads 2021-07-19 22:47:29 -05:00
nocapture-1.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
nocapture-2.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
nodelete.ll [Attributor] Introduce AAPointerInfo 2021-07-19 22:48:35 -05:00
nofree.ll [Attributor] Set floating point loads and stores as nofree in AANoFreeFloating 2021-06-09 16:16:37 -04:00
nonnull.ll [Attributor][FIX] Do not replace a value with a non-dominating instruction 2021-07-10 16:09:30 -05:00
norecurse.ll [Attributor] Introduce AAPointerInfo 2021-07-19 22:48:35 -05:00
noreturn.ll [Attributor][NFC] Update tests after D94741 2021-03-11 23:31:39 -06:00
noreturn_async.ll [Attributor] Introduce a helper do deal with constant type mismatches 2021-05-23 23:00:40 -05:00
noreturn_sync.ll [Attributor] Introduce AAPointerInfo 2021-07-19 22:48:35 -05:00
nosync.ll [IR] Memory intrinsics are not unconditionally `nosync` 2021-05-21 03:40:59 +02:00
noundef.ll [Attributor][FIX] Traverse uses even if a value is assumed constant 2021-07-10 15:47:20 -05:00
nounwind.ll [Attributor][NFC] Update tests after D94741 2021-03-11 23:31:39 -06:00
potential.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
range.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
read_write_returned_arguments_scc.ll [Attributor] Extend the AAValueSimplify compare simplification logic 2021-07-20 00:35:14 -05:00
readattrs.ll [Attributor] Simplify to values in the genericValueTraversal 2021-07-20 01:39:34 -05:00
returned.ll [Attributor] Use AAValueSimplify to simplify returned values 2021-07-10 15:52:36 -05:00
undefined_behavior.ll [Attributor] Simplify loads 2021-07-19 22:47:29 -05:00
value-simplify-instances.ll [Attributor][FIX] Do not introduce multiple instances of SSA values 2021-07-22 00:07:55 -05:00
value-simplify-pointer-info.ll [Attributor] Extend the AAValueSimplify compare simplification logic 2021-07-20 00:35:14 -05:00
value-simplify.ll [Attributor] Extend the AAValueSimplify compare simplification logic 2021-07-20 00:35:14 -05:00
willreturn.ll Reapply [IR] Don't mark mustprogress as type attribute 2021-07-09 20:57:44 +02:00
wrapper.ll [Attributor] Introduce AAPointerInfo 2021-07-19 22:48:35 -05:00