[polly] r293165 - ScopDetectionDiagnostics: Also emit diagnostics in case no debug info is available

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 02:30:55 PST 2017


Author: grosser
Date: Thu Jan 26 04:30:55 2017
New Revision: 293165

URL: http://llvm.org/viewvc/llvm-project?rev=293165&view=rev
Log:
ScopDetectionDiagnostics: Also emit diagnostics in case no debug info is available

In this case, we just use the start of the scop as the debug location.

Added:
    polly/trunk/test/ScopDetectionDiagnostics/ReportIrreducibleRegionWithoutDebugLoc.ll
Modified:
    polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp

Modified: polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp?rev=293165&r1=293164&r2=293165&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp Thu Jan 26 04:30:55 2017
@@ -134,6 +134,9 @@ void emitRejectionRemarks(const BBPair &
     if (const DebugLoc &Loc = RR->getDebugLoc())
       emitOptimizationRemarkMissed(Ctx, DEBUG_TYPE, F, Loc,
                                    RR->getEndUserMessage());
+    else
+      emitOptimizationRemarkMissed(Ctx, DEBUG_TYPE, F, Begin,
+                                   RR->getEndUserMessage());
   }
 
   emitOptimizationRemarkMissed(Ctx, DEBUG_TYPE, F, End,

Added: polly/trunk/test/ScopDetectionDiagnostics/ReportIrreducibleRegionWithoutDebugLoc.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetectionDiagnostics/ReportIrreducibleRegionWithoutDebugLoc.ll?rev=293165&view=auto
==============================================================================
--- polly/trunk/test/ScopDetectionDiagnostics/ReportIrreducibleRegionWithoutDebugLoc.ll (added)
+++ polly/trunk/test/ScopDetectionDiagnostics/ReportIrreducibleRegionWithoutDebugLoc.ll Thu Jan 26 04:30:55 2017
@@ -0,0 +1,26 @@
+; RUN: opt %loadPolly -analyze -polly-detect \
+; RUN:     -pass-remarks-missed="polly-detect" \
+; RUN:     < %s 2>&1| FileCheck %s
+
+; CHECK: remark: <unknown>:0:0: Irreducible region encountered in control flow.
+
+define void @hoge(i8* %arg)  {
+bb1:
+  br i1 false, label %bb2, label %bb3
+
+bb2:
+  br i1 false, label %bb4, label %bb5
+
+bb4:
+  br i1 false, label %bb3, label %bb5
+
+bb5:
+  br label %bb6
+
+bb6:
+  br label %bb4
+
+bb3:
+  ret void
+}
+




More information about the llvm-commits mailing list