mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 18:31:04 +00:00
ff69509f94
GlobalDCE deletes global vars and updates their initializers to nullptr while leaving underlying constants to be cleaned up later by its uses. The clean up may never happen, fix this by forcing it every time it's safe to destroy constants. Final patch by Rafael Espindola http://reviews.llvm.org/D4931 <rdar://problem/17523868> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216390 91177308-0d34-0410-b5e6-96231b3b80d8
17 lines
429 B
LLVM
17 lines
429 B
LLVM
; RUN: opt -globaldce -simplifycfg -S < %s | FileCheck %s
|
|
|
|
; Tests whether globaldce does the right cleanup while removing @bar
|
|
; so that a dead BlockAddress reference to foo won't prevent other passes
|
|
; to work properly, e.g. simplifycfg
|
|
@bar = internal unnamed_addr constant i8* blockaddress(@foo, %L1)
|
|
|
|
; CHECK-LABEL: foo
|
|
; CHECK-NOT: br label %L1
|
|
; CHECK: ret void
|
|
define void @foo() {
|
|
entry:
|
|
br label %L1
|
|
L1:
|
|
ret void
|
|
}
|