[PATCH] D120311: [SCEV] Don't try to reuse expressions with offset

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 01:57:55 PST 2022


nikic created this revision.
nikic added reviewers: reames, mkazantsev, fhahn.
Herald added subscribers: pengfei, javed.absar, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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 seems to have an invalidation issue with these offseted expressions.

So I was wondering whether this functionality it really worthwhile, and whether we would be better off dropping it entirely.


https://reviews.llvm.org/D120311

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120311.410481.patch
Type: text/x-patch
Size: 22672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220222/8d2dd202/attachment.bin>


More information about the llvm-commits mailing list