summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-09-17 20:12:00 +0000
committerTeresa Johnson <tejohnson@google.com>2015-09-17 20:12:00 +0000
commitff642b9b84e0c8d226f4d7ce2ae2853a89b08cda (patch)
treee8c4fe3472f2fbda304a16cbf20f12f0333928ff /llvm/test/Bitcode
parentcbd00723b437a00727294f4351601aa8e63b5a71 (diff)
downloadbcm5719-llvm-ff642b9b84e0c8d226f4d7ce2ae2853a89b08cda.tar.gz
bcm5719-llvm-ff642b9b84e0c8d226f4d7ce2ae2853a89b08cda.zip
Restore "Function bitcode index in Value Symbol Table and lazy reading support"
This reverts commit r247898 (which reverted r247894). Patch fixed to address two issues exposed by buildbots: - unused variable warning in NDEBUG mode - std::initializer_list lifetime issue causing test failures Original Summary: Support for including the function bitcode indices in the Value Symbol Table. This requires writing the VST after the function blocks, which in turn requires a new VST forward declaration record encoding the offset of the full VST (which is backpatched to contain the offset after the VST is written). This patch also enables the lazy function reader to use the new function indices out of the VST. This support will be used by ThinLTO as well, which will be in a follow on patch. Backwards compatibility with older bitcode files is maintained. A new test is also included. The bitcode format (used for the lazy reader as well as the upcoming ThinLTO patches) came out of discussions with Duncan and others and is described here: https://drive.google.com/file/d/0B036uwnWM6RWdnBLakxmeDdOeXc/view Reviewers: dexonsmith, davidxl, joker.eph Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12536 llvm-svn: 247927
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r--llvm/test/Bitcode/vst-forward-declaration.ll29
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/vst-forward-declaration.ll b/llvm/test/Bitcode/vst-forward-declaration.ll
new file mode 100644
index 00000000000..599caa0150e
--- /dev/null
+++ b/llvm/test/Bitcode/vst-forward-declaration.ll
@@ -0,0 +1,29 @@
+; RUN: llvm-as < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
+; Check for VST forward declaration record and VST function index records.
+
+; BC: <VSTOFFSET
+; BC: <FNENTRY
+; BC: <FNENTRY
+
+; RUN: llvm-as < %s | llvm-dis | FileCheck %s
+; Check that this round-trips correctly.
+
+; ModuleID = '<stdin>'
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+; CHECK: define i32 @foo()
+
+; Function Attrs: nounwind uwtable
+define i32 @foo() #0 {
+entry:
+ ret i32 1
+}
+
+; CHECK: define i32 @bar(i32 %x)
+
+; Function Attrs: nounwind uwtable
+define i32 @bar(i32 %x) #0 {
+entry:
+ ret i32 %x
+}
OpenPOWER on IntegriCloud