diff options
author | Johannes Doerfert <johannes@jdoerfert.de> | 2022-05-10 18:08:43 -0400 |
---|---|---|
committer | Johannes Doerfert <johannes@jdoerfert.de> | 2022-06-09 16:48:53 +0200 |
commit | da50dab1ae111e9e6cb0248a47a038b17f798705 (patch) | |
tree | 6420b1471236a0a2400b7b55f39306121817bb65 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 94841c713fdd2bce3276015d1e946d414bb74ee8 (diff) | |
download | llvm-da50dab1ae111e9e6cb0248a47a038b17f798705.zip llvm-da50dab1ae111e9e6cb0248a47a038b17f798705.tar.gz llvm-da50dab1ae111e9e6cb0248a47a038b17f798705.tar.bz2 |
[Attributor] Replace AAValueSimplify with AAPotentialValues
For the longest time we used `AAValueSimplify` and
`genericValueTraversal` to determine "potential values". This was
problematic for many reasons:
- We recomputed the result a lot as there was no caching for the 9
locations calling `genericValueTraversal`.
- We added the idea of "intra" vs. "inter" procedural simplification
only as an afterthought. `genericValueTraversal` did offer an option
but `AAValueSimplify` did not. Thus, we might end up with "too much"
simplification in certain situations and then gave up on it.
- Because `genericValueTraversal` was not a real `AA` we ended up with
problems like the infinite recursion bug (#54981) as well as code
duplication.
This patch introduces `AAPotentialValues` and replaces the
`AAValueSimplify` uses with it. `genericValueTraversal` is folded into
`AAPotentialValues` as are the instruction simplifications performed in
`AAValueSimplify` before. We further distinguish "intra" and "inter"
procedural simplification now.
`AAValueSimplify` was not deleted as we haven't ported the
re-materialization of instructions yet. There are other differences over
the former handling, e.g., we may not fold trivially foldable
instructions right now, e.g., `add i32 1, 1` is not folded to `i32 2`
but if an operand would be simplified to `i32 1` we would fold it still.
We are also even more aware of function/SCC boundaries in CGSCC passes,
which is good.
Fixes: https://github.com/llvm/llvm-project/issues/54981
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions