llvm-6502/test/Bitcode/blockaddress.ll
Duncan P. N. Exon Smith 1526278443 UseListOrder: Fix blockaddress use-list order
`parseBitcodeFile()` uses the generic `getLazyBitcodeFile()` function as
a helper.  Since `parseBitcodeFile()` isn't actually lazy -- it calls
`MaterializeAllPermanently()` -- bypass the unnecessary call to
`materializeForwardReferencedFunctions()` by extracting out a common
helper function.  This removes the last of the use-list churn caused by
blockaddresses.

This highlights that we can't reproduce use-list order of globals and
constants when parsing lazily -- but that's necessarily out of scope.
When we're parsing lazily, we never have all the functions in memory, so
the use-lists of globals (and constants that reference globals) are
always incomplete.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214581 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 22:27:19 +00:00

47 lines
841 B
LLVM

; RUN: llvm-as < %s | llvm-dis | FileCheck %s
; RUN: verify-uselistorder < %s -preserve-bc-use-list-order
; PR9857
define void @f(i8** nocapture %ptr1) {
; CHECK: define void @f
entry:
br label %here.i
here.i:
store i8* blockaddress(@doit, %here), i8** %ptr1, align 8
; CHECK: blockaddress(@doit, %here)
br label %doit.exit
doit.exit:
ret void
}
define void @doit(i8** nocapture %pptr) {
; CHECK: define void @doit
entry:
br label %here
here:
store i8* blockaddress(@doit, %here), i8** %pptr, align 8
; CHECK: blockaddress(@doit, %here)
br label %end
end:
ret void
}
; PR13895
define void @doitagain(i8** nocapture %pptr) {
; CHECK: define void @doitagain
entry:
br label %here
here:
store i8* blockaddress(@doit, %here), i8** %pptr, align 8
; CHECK: blockaddress(@doit, %here)
br label %end
end:
ret void
}