File: allones.ll

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (46 lines) | stat: -rw-r--r-- 1,740 bytes parent folder | download | duplicates (2)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; RUN: opt -early-cse -S -o - %s | FileCheck %s
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64-ni:2"
target triple = "armv7-unknown-linux-gnueabi"

%struct.anon = type { i32 }

@onesstruct = private constant %struct.anon { i32 -1 }, align 4

define i32 @allones_struct() {
; CHECK-LABEL: @allones_struct()
; CHECK-NEXT:    %1 = load [1 x i32], [1 x i32]* bitcast (%struct.anon* @onesstruct to [1 x i32]*), align 4
; CHECK-NEXT:    %2 = extractvalue [1 x i32] %1, 0
; CHECK-NEXT:    ret i32 %2
  %1 = load [1 x i32], [1 x i32]* bitcast (%struct.anon* @onesstruct to [1 x i32]*), align 4
  %2 = extractvalue [1 x i32] %1, 0
  ret i32 %2
}

define i32 @allones_int() {
; CHECK-LABEL: @allones_int()
; CHECK-NEXT:    ret i32 -1
  %1 = load i32, i32* bitcast (%struct.anon* @onesstruct to i32*), align 4
  ret i32 %1
}

define i32* @allones_ptr() {
; CHECK-LABEL: @allones_ptr()
; CHECK-NEXT:    ret i32* inttoptr (i32 -1 to i32*)
  %1 = load i32*, i32** bitcast (%struct.anon* @onesstruct to i32**), align 4
  ret i32* %1
}

define i32 addrspace(1)* @allones_ptr1() {
; CHECK-LABEL: @allones_ptr1()
; CHECK-NEXT:    ret i32 addrspace(1)* inttoptr (i32 -1 to i32 addrspace(1)*)
  %1 = load i32 addrspace(1)*, i32 addrspace(1)** bitcast (%struct.anon* @onesstruct to i32 addrspace(1)**), align 4
  ret i32 addrspace(1)* %1
}

define i32 addrspace(2)* @allones_ptr2() {
; CHECK-LABEL: @allones_ptr2()
; CHECK-NEXT:    %1 = load i32 addrspace(2)*, i32 addrspace(2)** bitcast (%struct.anon* @onesstruct to i32 addrspace(2)**), align 4
; CHECK-NEXT:    ret i32 addrspace(2)* %1
  %1 = load i32 addrspace(2)*, i32 addrspace(2)** bitcast (%struct.anon* @onesstruct to i32 addrspace(2)**), align 4
  ret i32 addrspace(2)* %1
}