[PATCH] D86844: [LoopDeletion] Allows deletion of possibly infinite side-effect free loops

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 02:06:00 PST 2020


fhahn added inline comments.


================
Comment at: llvm/test/Other/loop-deletion-printer.ll:17
 
-define void @deleteme() {
+define void @deleteme() willreturn {
 entry:
----------------
atmnpatel wrote:
> fhahn wrote:
> > Is this change related to the patch? Same for the other test changes that just add `willreturn`?
> Yep, if these test functions aren't marked willreturn, we won't delete the loop because it could be a legal infinite loop from C/C++.
I don't think that is the case here. The trip count of the loop here is constant, so it cannot be infinite. Also, the existing code already removes the loop, without `willreturn`, as implied by no changes to the check lines? 

I did not check all other cases, but I would expect that `willreturn` does not need to be added to cases where the trip count is a known constant and that already get removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86844



More information about the llvm-commits mailing list