[PATCH] D104636: [LoopIdiom] [LoopNest] let the pass deal with runtime memset size

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 11:49:03 PDT 2021


efriedma added a comment.

In D104636#2896872 <https://reviews.llvm.org/D104636#2896872>, @eopXD wrote:

> However the current code inside `LoopIdiomRecognize::processLoopMemset` , for the constant size the pass would also check for size overflow. I am curious of why it is originally needed here? Do you have any idea why is the check needed? (the commit history is out of the Phabricator's reach)

Code originates from rG8643810eded6eef8ad2753478a8403437695228f <https://reviews.llvm.org/rG8643810eded6eef8ad2753478a8403437695228f> .  As for why, not sure.  There isn't any obvious reason it's necessary.

> Assume we don't need runtime check for size overflow, we still need runtime checks for the assumptions made to fold SCEV expressions that enable the optimization. So versioning would still be needed.

Why can't we use the SCEV expression for the trip count as-is?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104636



More information about the llvm-commits mailing list