[llvm] [LoopUnroll] Make optimization remarks more precise (PR #190714)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 08:06:14 PDT 2026


================
@@ -711,20 +711,28 @@ UnrollCostEstimator::UnrollCostEstimator(
     LoopSize = BEInsns + 1;
 }
 
-bool UnrollCostEstimator::canUnroll() const {
+bool UnrollCostEstimator::canUnroll(OptimizationRemarkEmitter *ORE,
+                                    const Loop *L) const {
+  auto ReportCannotUnroll = [&](StringRef Reason) {
+    LLVM_DEBUG(dbgs().indent(1) << "Not unrolling: " << Reason << ".\n");
----------------
nikic wrote:

Disagree, the target audience is different. Optimization remarks are very inconvenient if you're debugging from opt.

https://github.com/llvm/llvm-project/pull/190714


More information about the llvm-commits mailing list