[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
Sun Jul 18 14:09:58 PDT 2021


efriedma added a comment.

I'm not sure we actually need to version the loop to handle overflow.

In any given address-space, there are at most 2^N bytes addressable by "gep ptr, i" where N is DataLayout::getIndexTypeSizeInBits().  Assuming the memset isn't volatile, there isn't any point to storing to an address more than once. So we only actually need to memset `min(2^N, TotalBytes)` bytes.  You should be able to pass that number to memset.


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