[PATCH] D137505: [SCEV] Cache ZExt SCEV expressions.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 01:48:03 PDT 2022


nikic added a comment.

To make sure I understand the idea here correctly: We already cache the case where the zext does //not// fold through the early folding set lookup. This additional cache only helps with the case where the zext //does// fold, and the early lookup thus fails, is that correct?

If so, I feel like this needs some more general solution. We're using the same pattern (early folding set lookup to bypass most of the folding logic) in most (all?) other SCEV creation methods as well, and introducing an independent cache for each of these would not be great. I wonder if we could insert a "forwarding" node into the folding set for all folded SCEV expressions, which points to the folding result, or something along those lines.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137505/new/

https://reviews.llvm.org/D137505



More information about the llvm-commits mailing list