[PATCH] D93686: [LoopUnroll] Fix a crash

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 07:30:40 PST 2020


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUnroll.cpp:404
+        dbgs() << "Can't unroll; a conditional latch must exit the loop");
+    return LoopUnrollResult::Unmodified;
+  }
----------------
Does this need updating? At this point, we could have peeled the loop and thus change it I think. 

Also, by moving the early exit to after peeling, we now expose more cases to peeling. Can peeling handle the case of the early exit properly?


================
Comment at: llvm/test/Transforms/LoopUnroll/unroll-after-peel.ll:5
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
+target triple = "x86_64-unknown-linux-gnu"
+
----------------
the triple should not be needed?


================
Comment at: llvm/test/Transforms/LoopUnroll/unroll-after-peel.ll:39
+  %tmp = phi i32 [ 8, %bb2 ], [ 0, %bb ]
+  br i1 undef, label %bb2, label %bb4
+
----------------
Would it be possible to use a concrete condition here? (branch on `undef` is UB)


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

https://reviews.llvm.org/D93686



More information about the llvm-commits mailing list