mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-01-08 14:22:53 +00:00
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
This commit is contained in:
@@ -131,3 +131,38 @@ loop2:
|
||||
%var = phi i32 [ %var, %loop1 ], [ %var, %loop2 ]
|
||||
br label %loop1
|
||||
}
|
||||
|
||||
; Check that block addresses work.
|
||||
@ba1 = constant i8* blockaddress (@bafunc1, %bb)
|
||||
@ba2 = constant i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
@ba3 = constant i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
|
||||
define i8* @babefore() {
|
||||
ret i8* getelementptr (i8* blockaddress (@bafunc2, %bb), i61 0)
|
||||
bb1:
|
||||
ret i8* blockaddress (@bafunc1, %bb)
|
||||
bb2:
|
||||
ret i8* blockaddress (@bafunc3, %bb)
|
||||
}
|
||||
define void @bafunc1() {
|
||||
unreachable
|
||||
bb:
|
||||
unreachable
|
||||
}
|
||||
define void @bafunc2() {
|
||||
unreachable
|
||||
bb:
|
||||
unreachable
|
||||
}
|
||||
define void @bafunc3() {
|
||||
unreachable
|
||||
bb:
|
||||
unreachable
|
||||
}
|
||||
define i8* @baafter() {
|
||||
ret i8* blockaddress (@bafunc2, %bb)
|
||||
bb1:
|
||||
ret i8* blockaddress (@bafunc1, %bb)
|
||||
bb2:
|
||||
ret i8* blockaddress (@bafunc3, %bb)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user