• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
2; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
3;
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.
6
7target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
8target triple = "x86_64-unknown-linux-gnu"
9
10declare i8 addrspace(1)* @foo()
11
12; Function Attrs: uwtable
13define i32 @test() gc "statepoint-example" {
14; CHECK-LABEL: @test
15entry:
16; CHECK-LABEL: entry
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
23; CHECK: load atomic
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
28  ret i32 %1
29}
30