summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-12-28 19:44:19 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-12-28 19:44:19 +0000
commit32ca14819848b362af9e1879f3811e68427f5279 (patch)
treea3e908a27535a53a4ba4b72c4a30d49baba0af65 /llvm/test/Bitcode
parent26dada79ffeba8237f50827da884111809633c7e (diff)
downloadbcm5719-llvm-32ca14819848b362af9e1879f3811e68427f5279.tar.gz
bcm5719-llvm-32ca14819848b362af9e1879f3811e68427f5279.zip
Add an index for Module Metadata record in the bitcode
Summary: This index record the position for each metadata record in the bitcode, so that the reader will be able to lazy-load on demand each individual record. We also make sure that every abbrev is emitted upfront so that the block can be skipped while reading. I don't plan to commit this before having the reader counterpart, but I figured this can be reviewed mostly independently. Reviewers: pcc, tejohnson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28083 llvm-svn: 290684
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/mdnodes-distinct-in-post-order.ll4
-rw-r--r--llvm/test/Bitcode/mdnodes-distinct-nodes-break-cycles.ll4
-rw-r--r--llvm/test/Bitcode/mdnodes-distinct-nodes-first.ll4
-rw-r--r--llvm/test/Bitcode/mdnodes-in-post-order.ll7
-rw-r--r--llvm/test/Bitcode/metadata-function-blocks.ll3
5 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/mdnodes-distinct-in-post-order.ll b/llvm/test/Bitcode/mdnodes-distinct-in-post-order.ll
index 6e6ba604235..45ec48d9ab6 100644
--- a/llvm/test/Bitcode/mdnodes-distinct-in-post-order.ll
+++ b/llvm/test/Bitcode/mdnodes-distinct-in-post-order.ll
@@ -17,6 +17,10 @@
; CHECK-NEXT: <DISTINCT_NODE op0=1 op1=3 op2=2/>
!4 = distinct !{!1, !3, !2}
+; Before the named records we emit the index containing the position of the
+; previously emitted records
+; CHECK-NEXT: <INDEX {{.*}} (offset match)
+
; Note: named metadata nodes are not cannot reference null so their operands
; are numbered off-by-one.
; CHECK-NEXT: <NAME
diff --git a/llvm/test/Bitcode/mdnodes-distinct-nodes-break-cycles.ll b/llvm/test/Bitcode/mdnodes-distinct-nodes-break-cycles.ll
index 51701d10c03..37a16b4eb82 100644
--- a/llvm/test/Bitcode/mdnodes-distinct-nodes-break-cycles.ll
+++ b/llvm/test/Bitcode/mdnodes-distinct-nodes-break-cycles.ll
@@ -22,6 +22,10 @@
; CHECK-NEXT: <NODE op0=2/>
!3 = !{!2}
+; Before the named records we emit the index containing the position of the
+; previously emitted records
+; CHECK-NEXT: <INDEX {{.*}} (offset match)
+
; Note: named metadata nodes are not cannot reference null so their operands
; are numbered off-by-one.
; CHECK-NEXT: <NAME
diff --git a/llvm/test/Bitcode/mdnodes-distinct-nodes-first.ll b/llvm/test/Bitcode/mdnodes-distinct-nodes-first.ll
index 1d146817e6b..ed678ef263a 100644
--- a/llvm/test/Bitcode/mdnodes-distinct-nodes-first.ll
+++ b/llvm/test/Bitcode/mdnodes-distinct-nodes-first.ll
@@ -11,6 +11,10 @@
; CHECK-NEXT: <NODE op0=1/>
!2 = !{!1}
+; Before the named records we emit the index containing the position of the
+; previously emitted records
+; CHECK-NEXT: <INDEX {{.*}} (offset match)
+
; Note: named metadata nodes are not cannot reference null so their operands
; are numbered off-by-one.
; CHECK-NEXT: <NAME
diff --git a/llvm/test/Bitcode/mdnodes-in-post-order.ll b/llvm/test/Bitcode/mdnodes-in-post-order.ll
index fbe1c34cf00..845175d6879 100644
--- a/llvm/test/Bitcode/mdnodes-in-post-order.ll
+++ b/llvm/test/Bitcode/mdnodes-in-post-order.ll
@@ -15,6 +15,9 @@
; CHECK-NEXT: 'leaf
; CHECK-NEXT: }
+; Before the records we emit an offset to the index for the block
+; CHECK-NEXT: <INDEX_OFFSET
+
; The leafs should come first (in either order).
; CHECK-NEXT: <NODE op0=1/>
; CHECK-NEXT: <NODE op0=2/>
@@ -27,6 +30,10 @@
; CHECK-NEXT: <NODE op0=3 op1=5 op2=4/>
!6 = !{!3, !5, !4}
+; Before the named records we emit the index containing the position of the
+; previously emitted records
+; CHECK-NEXT: <INDEX {{.*}} (offset match)
+
; Note: named metadata nodes are not cannot reference null so their operands
; are numbered off-by-one.
; CHECK-NEXT: <NAME
diff --git a/llvm/test/Bitcode/metadata-function-blocks.ll b/llvm/test/Bitcode/metadata-function-blocks.ll
index f3e83c5074d..c76465ced8b 100644
--- a/llvm/test/Bitcode/metadata-function-blocks.ll
+++ b/llvm/test/Bitcode/metadata-function-blocks.ll
@@ -19,6 +19,9 @@
; Each node gets a new number. Bottom-up traversal of nodes.
!named = !{!6}
+; Before the records we emit an offset to the index for the block
+; CHECK-NEXT: <INDEX_OFFSET
+
; CHECK-NEXT: <NODE op0=1/>
!4 = !{!"named"}
OpenPOWER on IntegriCloud