Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NewPM] fixing asserts on deleted loop in -print-after-all
IR-printing AfterPass instrumentation might be called on a loop that has just been invalidated. We should skip printing it to avoid spurious asserts. Reviewed By: chandlerc, philip.pfaffe Differential Revision: https://reviews.llvm.org/D54740 llvm-svn: 348887
- Loading branch information
Fedor Sergeev
committed
Dec 11, 2018
1 parent
8876dac
commit a1d95c3
Showing
11 changed files
with
233 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; Make sure that Loop which was invalidated by loop-deletion | ||
; does not lead to problems for -print-after-all and is just skipped. | ||
; | ||
; RUN: opt < %s -disable-output \ | ||
; RUN: -passes=loop-instsimplify -print-after-all 2>&1 | FileCheck %s -check-prefix=SIMPLIFY | ||
; RUN: opt < %s -disable-output \ | ||
; RUN: -passes=loop-deletion,loop-instsimplify -print-after-all 2>&1 | FileCheck %s -check-prefix=DELETED | ||
; | ||
; SIMPLIFY: IR Dump {{.*}} LoopInstSimplifyPass | ||
; DELETED-NOT: IR Dump {{.*}}LoopInstSimplifyPass | ||
; DELETED-NOT: IR Dump {{.*}}LoopDeletionPass | ||
|
||
define void @deleteme() { | ||
entry: | ||
br label %loop | ||
loop: | ||
%iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ] | ||
%iv.next = add i32 %iv, 1 | ||
%check = icmp ult i32 %iv.next, 3 | ||
br i1 %check, label %loop, label %exit | ||
exit: | ||
ret void | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; RUN: opt < %s 2>&1 -disable-output \ | ||
; RUN: -passes=inline -print-before-all -print-after-all | FileCheck %s -check-prefix=INL | ||
; RUN: opt < %s 2>&1 -disable-output \ | ||
; RUN: -passes=inline -print-before-all -print-after-all -print-module-scope | FileCheck %s -check-prefix=INL-MOD | ||
|
||
; INL: IR Dump Before {{InlinerPass .*scc: .tester, foo}} | ||
; INL-NOT: IR Dump After {{InlinerPass}} | ||
; INL: IR Dump Before {{InlinerPass .*scc: .tester}} | ||
; INL: IR Dump After {{InlinerPass .*scc: .tester}} | ||
|
||
; INL-MOD: IR Dump Before {{InlinerPass .*scc: .tester, foo}} | ||
; INL-MOD-NOT: IR Dump After {{InlinerPass}} | ||
; INL-MOD: IR Dump Before {{InlinerPass .*scc: .tester}} | ||
; INL-MOD: IR Dump After {{InlinerPass .*scc: .tester}} | ||
|
||
|
||
define void @tester() noinline { | ||
call void @foo() | ||
ret void | ||
} | ||
|
||
define internal void @foo() alwaysinline { | ||
call void @tester() | ||
ret void | ||
} |
Oops, something went wrong.