diff options
author | Daniil Suchkov <dsuchkov@azul.com> | 2022-01-04 02:38:56 +0000 |
---|---|---|
committer | Daniil Suchkov <dsuchkov@azul.com> | 2022-01-05 23:25:40 +0000 |
commit | 524abc68f231101996e8142aadb3f382fe40d20b (patch) | |
tree | 7cb6f33e240813fec0b4acac27b2cc21c37c85c7 /llvm/test/Analysis/Dominators | |
parent | d7b6574c3bf671d70acd751a8c85d3a062dcc7c6 (diff) | |
download | llvm-524abc68f231101996e8142aadb3f382fe40d20b.zip llvm-524abc68f231101996e8142aadb3f382fe40d20b.tar.gz llvm-524abc68f231101996e8142aadb3f382fe40d20b.tar.bz2 |
Introduce NewPM .dot printers for DomTree
This patch adds a couple of NewPM function passes (dot-dom and
dot-dom-only) that dump DomTree into .dot files.
Reviewed-By: aeubanks
Differential Revision: https://reviews.llvm.org/D116629
Diffstat (limited to 'llvm/test/Analysis/Dominators')
-rw-r--r-- | llvm/test/Analysis/Dominators/print-dot-dom.ll | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/llvm/test/Analysis/Dominators/print-dot-dom.ll b/llvm/test/Analysis/Dominators/print-dot-dom.ll new file mode 100644 index 0000000..faad5a6 --- /dev/null +++ b/llvm/test/Analysis/Dominators/print-dot-dom.ll @@ -0,0 +1,71 @@ +; RUN: opt %s -passes=dot-dom -disable-output +; RUN: FileCheck %s -input-file=dom.test1.dot -check-prefix=TEST1 +; RUN: FileCheck %s -input-file=dom.test2.dot -check-prefix=TEST2 + +define void @test1() { +; TEST1: digraph "Dominator tree for 'test1' function" +; TEST1-NEXT: label="Dominator tree for 'test1' function" +; TEST1: Node0x[[EntryID:.*]] [shape=record,label="{entry: +; TEST1-NEXT: Node0x[[EntryID]] -> Node0x[[A_ID:.*]]; +; TEST1-NEXT: Node0x[[EntryID]] -> Node0x[[C_ID:.*]]; +; TEST1-NEXT: Node0x[[EntryID]] -> Node0x[[B_ID:.*]]; +; TEST1-NEXT: Node0x[[A_ID]] [shape=record,label="{a: +; TEST1-NEXT: Node0x[[C_ID]] [shape=record,label="{c: +; TEST1-NEXT: Node0x[[C_ID]] -> Node0x[[D_ID:.*]]; +; TEST1-NEXT: Node0x[[C_ID]] -> Node0x[[E_ID:.*]]; +; TEST1-NEXT: Node0x[[D_ID]] [shape=record,label="{d: +; TEST1-NEXT: Node0x[[E_ID]] [shape=record,label="{e: +; TEST1-NEXT: Node0x[[B_ID]] [shape=record,label="{b: + +entry: + br i1 undef, label %a, label %b + +a: + br label %c + +b: + br label %c + +c: + br i1 undef, label %d, label %e + +d: + ret void + +e: + ret void +} + +define void @test2() { +; TEST2: digraph "Dominator tree for 'test2' function" +; TEST2-NEXT: label="Dominator tree for 'test2' function" +; TEST2: Node0x[[EntryID:.*]] [shape=record,label="{entry: +; TEST2-NEXT: Node0x[[EntryID]] -> Node0x[[A_ID:.*]]; +; TEST2-NEXT: Node0x[[A_ID]] [shape=record,label="{a: +; TEST2-NEXT: Node0x[[A_ID]] -> Node0x[[B_ID:.*]]; +; TEST2-NEXT: Node0x[[B_ID]] [shape=record,label="{b: +; TEST2-NEXT: Node0x[[B_ID]] -> Node0x[[C_ID:.*]]; +; TEST2-NEXT: Node0x[[C_ID]] [shape=record,label="{c: +; TEST2-NEXT: Node0x[[C_ID]] -> Node0x[[D_ID:.*]]; +; TEST2-NEXT: Node0x[[C_ID]] -> Node0x[[E_ID:.*]]; +; TEST2-NEXT: Node0x[[D_ID]] [shape=record,label="{d: +; TEST2-NEXT: Node0x[[E_ID]] [shape=record,label="{e: + +entry: + br label %a + +a: + br label %b + +b: + br i1 undef, label %a, label %c + +c: + br i1 undef, label %d, label %e + +d: + br i1 undef, label %a, label %e + +e: + ret void +} |