diff options
author | Michael Zolotukhin <mzolotukhin@apple.com> | 2018-02-07 04:24:44 +0000 |
---|---|---|
committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2018-02-07 04:24:44 +0000 |
commit | e82e83fcce6d88c1850ab876f5ee0e2172f65e8e (patch) | |
tree | 924cc76c50438839c94b60b3fd986872efc3e3d6 | |
parent | f3681015670c531cb42bc20dbbe78cb237b055d7 (diff) | |
download | bcm5719-llvm-e82e83fcce6d88c1850ab876f5ee0e2172f65e8e.tar.gz bcm5719-llvm-e82e83fcce6d88c1850ab876f5ee0e2172f65e8e.zip |
Follow-up for r324429: "[LCSSAVerification] Run verification only when asserts are enabled."
Before r324429 we essentially didn't have a verification of LCSSA, so
no wonder that it has been broken: currently loop-sink breaks it (the
attached test illustrates the failure).
It was detected during a stage2 RA build, so to unbreak it I'm disabling
the check for now.
llvm-svn: 324445
-rw-r--r-- | llvm/lib/Analysis/LoopPass.cpp | 6 | ||||
-rw-r--r-- | llvm/test/Transforms/LICM/loopsink.ll | 61 |
2 files changed, 66 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index d4e9021ee1f..0fb15df3efd 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -151,7 +151,7 @@ void LPPassManager::markLoopAsDeleted(Loop &L) { bool LPPassManager::runOnFunction(Function &F) { auto &LIWP = getAnalysis<LoopInfoWrapperPass>(); LI = &LIWP.getLoopInfo(); -#ifndef NDEBUG +#if 0 DominatorTree *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree(); #endif bool Changed = false; @@ -227,8 +227,12 @@ bool LPPassManager::runOnFunction(Function &F) { // is that LPPassManager might run passes which do not require LCSSA // form (LoopPassPrinter for example). We should skip verification for // such passes. + // FIXME: Loop-sink currently break LCSSA. Fix it and reenable the + // verification! +#if 0 if (mustPreserveAnalysisID(LCSSAVerificationPass::ID)) assert(CurrentLoop->isRecursivelyLCSSAForm(*DT, *LI)); +#endif // Then call the regular verifyAnalysis functions. verifyPreservedAnalysis(P); diff --git a/llvm/test/Transforms/LICM/loopsink.ll b/llvm/test/Transforms/LICM/loopsink.ll index 09dddb437b4..a11613f294c 100644 --- a/llvm/test/Transforms/LICM/loopsink.ll +++ b/llvm/test/Transforms/LICM/loopsink.ll @@ -437,7 +437,68 @@ define i32 @t7(i32, i32) #0 !prof !0 { ret i32 10 } +%a = type { i8 } + +; CHECK-LABEL: @t8 +; CHECK: ret void +define void @t8() !prof !0 { +bb: + br label %bb1 + +bb1: ; preds = %bb + %tmp = getelementptr inbounds %a, %a* undef, i64 0, i32 0 + br label %bb2 + +bb2: ; preds = %bb16, %bb1 + br i1 undef, label %bb16, label %bb3 + +bb3: ; preds = %bb2 + br i1 undef, label %bb16, label %bb4 + +bb4: ; preds = %bb3 + br i1 undef, label %bb5, label %bb16 + +bb5: ; preds = %bb4 + br i1 undef, label %bb16, label %bb6 + +bb6: ; preds = %bb5 + br i1 undef, label %bb16, label %bb7 + +bb7: ; preds = %bb15, %bb6 + br i1 undef, label %bb8, label %bb16 + +bb8: ; preds = %bb7 + br i1 undef, label %bb9, label %bb15 + +bb9: ; preds = %bb8 + br i1 undef, label %bb10, label %bb15 + +bb10: ; preds = %bb9 + br i1 undef, label %bb11, label %bb15 + +bb11: ; preds = %bb10 + br i1 undef, label %bb12, label %bb15 + +bb12: ; preds = %bb11 + %tmp13 = load i8, i8* %tmp, align 8 + br i1 undef, label %bb15, label %bb14 + +bb14: ; preds = %bb12 + call void @bar(i8* %tmp) + br label %bb16 + +bb15: ; preds = %bb12, %bb11, %bb10, %bb9, %bb8 + br i1 undef, label %bb16, label %bb7 + +bb16: ; preds = %bb15, %bb14, %bb7, %bb6, %bb5, %bb4, %bb3, %bb2 + br i1 undef, label %bb17, label %bb2 + +bb17: ; preds = %bb16 + ret void +} + declare i32 @foo() +declare void @bar(i8*) !0 = !{!"function_entry_count", i64 1} !1 = !{!"branch_weights", i32 1, i32 2000} |