llvm/test/Transforms/GlobalSplit/non-beneficial.ll
Peter Collingbourne 510c1b6ff7 Introduce GlobalSplit pass.
This pass splits globals into elements using inrange annotations on
getelementptr indices.

Differential Revision: https://reviews.llvm.org/D22295

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 23:40:26 +00:00

25 lines
543 B
LLVM

; RUN: opt -S -globalsplit %s | FileCheck %s
target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux-gnu"
; CHECK: @global =
@global = internal constant { [2 x i8* ()*], [1 x i8* ()*] } {
[2 x i8* ()*] [i8* ()* @f, i8* ()* @g],
[1 x i8* ()*] [i8* ()* @h]
}
define i8* @f() {
ret i8* bitcast (i8* ()** getelementptr ({ [2 x i8* ()*], [1 x i8* ()*] }, { [2 x i8* ()*], [1 x i8* ()*] }* @global, i32 0, inrange i32 0, i32 0) to i8*)
}
define i8* @g() {
ret i8* null
}
define i8* @h() {
ret i8* null
}
!0 = !{i32 16}