[PATCH] D103834: [SCEV] Properly guard reasoning about infinite loops being UB on mustprogress
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 10 12:04:47 PDT 2021
reames added a comment.
JFYI, C and C++ apparently have different rules here. For c++ your example function is mustprogress, for C only the loop is. (Based on a quick skim of checkIfLoopMustProgress clang's CodeGenFunction.h) I have no idea if the C rules could be more aggressive here or not, you'd be best taking that up with a clang developer.
It does look like checking the loop mustprogress flag would be sufficient to address the specific regression seen here. I'll see if that's easy to implement quickly.
For the weakness being discussed, feel free to file a bug. I'm currently working through a collection of missing cases in SCEV's trip count logic and having an example to come back to would help.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103834/new/
https://reviews.llvm.org/D103834
More information about the llvm-commits
mailing list