1 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
2 ; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
4 ; A test to make sure that we can look through bitcasts of
5 ; vector types when a base pointer is contained in a vector.
7 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
8 target triple = "x86_64-unknown-linux-gnu"
10 declare i8 addrspace(1)* @foo()
12 ; Function Attrs: uwtable
13 define i32 @test() gc "statepoint-example" {
17 ; CHECK: %bc = bitcast
18 ; CHECK: %[[p1:[A-Za-z0-9_]+]] = extractelement
19 ; CHECK: %[[p2:[A-Za-z0-9_]+]] = extractelement
20 ; CHECK: llvm.experimental.gc.statepoint
21 ; CHECK: %[[p2]].relocated = {{.+}} @llvm.experimental.gc.relocate
22 ; CHECK: %[[p1]].relocated = {{.+}} @llvm.experimental.gc.relocate
24 %bc = bitcast <8 x i8 addrspace(1)*> undef to <8 x i32 addrspace(1)*>
25 %ptr= extractelement <8 x i32 addrspace(1)*> %bc, i32 7
26 %0 = call i8 addrspace(1)* @foo() [ "deopt"() ]
27 %1 = load atomic i32, i32 addrspace(1)* %ptr unordered, align 4