[PATCH] D107353: [LoopIdiom] let the pass deal with runtime memset size
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 13 11:07:52 PDT 2021
lebedev.ri added a comment.
Actually, we've talked about not needing the overflow check, but IIRC just saturating the number of bytes.
Can you point me at the code that does that?
================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1076-1102
/// Compute the number of bytes as a SCEV from the backedge taken count.
///
/// This also maps the SCEV into the provided type and tries to handle the
/// computation in a way that will fold cleanly.
static const SCEV *getNumBytes(const SCEV *BECount, Type *IntPtr,
unsigned StoreSize, Loop *CurLoop,
const DataLayout *DL, ScalarEvolution *SE) {
----------------
This doesn't look right.
1. There absolutely should not be two almost identical functions
2. Shouldn't this be saturating unsigned multiplication?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107353/new/
https://reviews.llvm.org/D107353
More information about the llvm-commits
mailing list