[SCEV] Don't try to reuse expressions with offset
authorNikita Popov <npopov@redhat.com>
Tue, 22 Feb 2022 09:47:15 +0000 (10:47 +0100)
committerNikita Popov <npopov@redhat.com>
Fri, 25 Feb 2022 08:16:48 +0000 (09:16 +0100)
commitd9715a726674046b177221873d63578dce383feb
tree6c81ca9fd66144abaadfb591d2b46ef3c35f26a8
parenteb3e09c9bf1d8808acf7d21f40ab0103121a0d60
[SCEV] Don't try to reuse expressions with offset

SCEVs ExprValueMap currently tracks not only which IR Values
correspond to a given SCEV expression, but additionally stores that
it may be expanded in the form X+Offset. In theory, this allows
reusing existing IR Values in more cases.

In practice, this doesn't seem to be particularly useful (the test
changes are rather underwhelming) and adds a good bit of complexity.
Per https://github.com/llvm/llvm-project/issues/53905, we have an
invalidation issue with these offseted expressions.

Differential Revision: https://reviews.llvm.org/D120311
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
llvm/test/CodeGen/X86/dag-update-nodetomatch.ll
llvm/test/Transforms/LoopIdiom/memset-runtime-32bit.ll
llvm/test/Transforms/LoopIdiom/memset-runtime-64bit.ll