[llvm] SCEV: return std::nullopt for invalid TC (NFC) (PR #94162)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 4 00:54:59 PDT 2024
artagnon wrote:
> If the only planned use of this is to avoid printing `TC: 0` in LV, would it be possible to simply update the code in LV to check that the return value is != 0 before printing? IIUC 0 is never a valid return value for `getSmallConstantTripCount` and it should be fairly clear from the documentation.
Wouldn't it be preferable if this was clear from the API? I'm also planning to change the API of related functions like `getTripCountFromExitCount` so that there isn't an ugly and cryptic `TC->isZero()` check.
https://github.com/llvm/llvm-project/pull/94162
More information about the llvm-commits
mailing list