Reapply of a22d1c2225543aa9ae7882f6b1a97ee7b2c95574. Using this PR for pre-merge CI. Instead of relying on any pass manager to schedule Polly's passes, add Polly's own pipeline manager which is seen as a monolithic pass in LLVM's pass manager. Polly's former passes are now phases of the new PhaseManager component. Relying on LLVM's pass manager (the legacy as well as the New Pass Manager) to manage Polly's phases never was a good fit that the PhaseManager resolves: * Polly passes were modifying analysis results, in particular RegionInfo and ScopInfo. This means that there was not just one unique and "definite" analysis result, the actual result depended on which analyses ran prior, and the pass manager was not allowed to throw away cached analyses or prior SCoP optimizations would have been forgotten. The LLVM pass manger's persistance of analysis results is not contractual but designed for caching. * Polly depends on a particular execution order of passes and regions (e.g. regression tests, invalidation of consecutive SCoPs). LLVM's pass manager does not guarantee any excecution order. * Polly does not completely preserve DominatorTree, RegionInfo, LoopInfo, or ScalarEvolution, but only as-needed for Polly's own uses. Because the ScopDetection object stores references to those analyses, it still had to lie to the pass manager that they would be preserved, or the pass manager would have released and recomputed the invalidated analysis objects that ScopDetection/ScopInfo was still referencing. To ensure that no non-Polly pass would see these not-completely-preserved analyses, all analyses still had to be thrown away after the ScopPassManager, respectively with a BarrierNoopPass in case of the LPM. * The NPM's PassInstrumentation wraps the IR unit into an `llvm::Any` object, but implementations such as PrintIRInstrumentation call llvm_unreachable on encountering an unknown IR unit, such as SCoPs, with no extension points to add support. Hence LLVM crashes when dumping IR between SCoP passes (such as `-print-before-changed` with Polly being active). The new PhaseManager uses some command line options that previously belonged to Polly's legacy passes, such as `-polly-print-detect` (so the option will continue to work). Hence the LPM support is incompatible with the new approach and support for it is removed.
67 lines
3.1 KiB
LLVM
67 lines
3.1 KiB
LLVM
; RUN: opt %loadNPMPolly '-passes=polly<no-default-opts>' -S < %s | FileCheck %s
|
|
|
|
; PR25241 (https://llvm.org/bugs/show_bug.cgi?id=25241)
|
|
; Ensure that synthesized values of a PHI node argument are generated in the
|
|
; incoming block, not in the PHI's block.
|
|
|
|
; CHECK-LABEL: polly.stmt.if.then.862:
|
|
; CHECK: %[[R1:[0-9]+]] = add i32 %tmp, 1
|
|
; CHECK: br label
|
|
|
|
; CHECK-LABEL: polly.stmt.while.body.740.region_exiting:
|
|
; CHECK: %polly.curr.3 = phi i32 [ %[[R1]], %polly.stmt.if.then.862 ], [ undef, %polly.stmt.if.else.864 ]
|
|
; CHECK: br label %polly.stmt.polly.merge_new_and_old.exit
|
|
|
|
; CHECK-LABEL: polly.stmt.polly.merge_new_and_old.exit:
|
|
; CHECK: store i32 %polly.curr.3, ptr %curr.3.s2a
|
|
; CHECK: br label %polly.exiting
|
|
|
|
; CHECK-LABEL: polly.exiting:
|
|
; CHECK: %curr.3.ph.final_reload = load i32, ptr %curr.3.s2a
|
|
; CHECK: br label
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
; Function Attrs: nounwind uwtable
|
|
define void @BZ2_decompress() {
|
|
entry:
|
|
%tmp = load i32, ptr undef, align 4, !tbaa !1
|
|
switch i32 undef, label %save_state_and_return [
|
|
i32 34, label %sw.bb.748
|
|
i32 35, label %if.then.813
|
|
]
|
|
|
|
while.body.740: ; preds = %if.else.864, %if.then.862
|
|
%curr.3 = phi i32 [ %inc863, %if.then.862 ], [ undef, %if.else.864 ]
|
|
ret void
|
|
|
|
sw.bb.748: ; preds = %entry
|
|
ret void
|
|
|
|
if.then.813: ; preds = %entry
|
|
%conv823903 = and i32 undef, undef
|
|
%cmp860 = icmp eq i32 %conv823903, 0
|
|
br i1 %cmp860, label %if.then.862, label %if.else.864
|
|
|
|
if.then.862: ; preds = %if.then.813
|
|
%inc863 = add nsw i32 %tmp, 1
|
|
br label %while.body.740
|
|
|
|
if.else.864: ; preds = %if.then.813
|
|
br label %while.body.740
|
|
|
|
save_state_and_return: ; preds = %entry
|
|
ret void
|
|
}
|
|
|
|
!llvm.ident = !{!0}
|
|
|
|
!0 = !{!"clang version 3.8.0 (trunk 250010) (llvm/trunk 250018)"}
|
|
!1 = !{!2, !6, i64 64092}
|
|
!2 = !{!"", !3, i64 0, !6, i64 8, !4, i64 12, !6, i64 16, !4, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !4, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !4, i64 68, !6, i64 1092, !4, i64 1096, !4, i64 2124, !3, i64 3152, !3, i64 3160, !3, i64 3168, !6, i64 3176, !6, i64 3180, !6, i64 3184, !6, i64 3188, !6, i64 3192, !4, i64 3196, !4, i64 3452, !4, i64 3468, !4, i64 3724, !4, i64 7820, !4, i64 7884, !4, i64 25886, !4, i64 43888, !4, i64 45436, !4, i64 51628, !4, i64 57820, !4, i64 64012, !6, i64 64036, !6, i64 64040, !6, i64 64044, !6, i64 64048, !6, i64 64052, !6, i64 64056, !6, i64 64060, !6, i64 64064, !6, i64 64068, !6, i64 64072, !6, i64 64076, !6, i64 64080, !6, i64 64084, !6, i64 64088, !6, i64 64092, !6, i64 64096, !6, i64 64100, !6, i64 64104, !6, i64 64108, !6, i64 64112, !6, i64 64116, !3, i64 64120, !3, i64 64128, !3, i64 64136}
|
|
!3 = !{!"any pointer", !4, i64 0}
|
|
!4 = !{!"omnipotent char", !5, i64 0}
|
|
!5 = !{!"Simple C/C++ TBAA"}
|
|
!6 = !{!"int", !4, i64 0}
|