File: inline-constexpr-addrspacecast-argument.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (32 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
; RUN: opt -S -inline < %s | FileCheck %s
; RUN: opt -S -passes='cgscc(inline)' < %s | FileCheck %s
; RUN: opt -S -passes='module-inline' < %s | FileCheck %s

target datalayout = "e-p3:32:32-p4:64:64-n32"

@lds = internal addrspace(3) global [64 x i64] zeroinitializer

; CHECK-LABEL: @constexpr_addrspacecast_ptr_size_change(
; CHECK: load i64, i64 addrspace(4)* addrspacecast (i64 addrspace(3)* getelementptr inbounds ([64 x i64], [64 x i64] addrspace(3)* @lds, i32 0, i32 0) to i64 addrspace(4)*)
; CHECK-NEXT: br
define void @constexpr_addrspacecast_ptr_size_change() #0 {
  %tmp0 = call i32 @foo(i64 addrspace(4)* addrspacecast (i64 addrspace(3)* getelementptr inbounds ([64 x i64], [64 x i64] addrspace(3)* @lds, i32 0, i32 0) to i64 addrspace(4)*)) #1
  ret void
}

define i32 @foo(i64 addrspace(4)* %arg) #1 {
bb:
  %tmp = getelementptr i64, i64 addrspace(4)* %arg, i64 undef
  %tmp1 = load i64, i64 addrspace(4)* %tmp
  br i1 undef, label %bb2, label %bb3

bb2:
  store i64 0, i64 addrspace(4)* %tmp
  br label %bb3

bb3:
  unreachable
}

attributes #0 = { nounwind }
attributes #1 = { alwaysinline nounwind }