File: 2008-06-05-APInt-OverAShr.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (60 lines) | stat: -rw-r--r-- 2,104 bytes parent folder | download | duplicates (12)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
; RUN: %lli -jit-kind=mcjit -force-interpreter=true %s | FileCheck %s
; CHECK: 1

target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
@.str = internal constant [10 x i8] c"MSB = %d\0A\00"		; <ptr> [#uses=1]

define i65 @foo(i65 %x) {
entry:
	%x_addr = alloca i65		; <ptr> [#uses=2]
	%retval = alloca i65		; <ptr> [#uses=2]
	%tmp = alloca i65		; <ptr> [#uses=2]
	%"alloca point" = bitcast i65 0 to i65		; <i65> [#uses=0]
	store i65 %x, ptr %x_addr
	%tmp1 = load i65, ptr %x_addr, align 4		; <i65> [#uses=1]
	%tmp2 = ashr i65 %tmp1, 65		; <i65> [#uses=1]
	store i65 %tmp2, ptr %tmp, align 4
	%tmp3 = load i65, ptr %tmp, align 4		; <i65> [#uses=1]
	store i65 %tmp3, ptr %retval, align 4
	br label %return

return:		; preds = %entry
	%retval4 = load i65, ptr %retval		; <i65> [#uses=1]
	ret i65 %retval4
}

define i32 @main() {
entry:
	%retval = alloca i32		; <ptr> [#uses=1]
	%iftmp.0 = alloca i32		; <ptr> [#uses=3]
	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
	%tmp = call i65 @foo( i65 -9 )		; <i65> [#uses=1]
	%tmp1 = lshr i65 %tmp, 64		; <i65> [#uses=1]
	%tmp2 = xor i65 %tmp1, 1		; <i65> [#uses=1]
	%tmp3 = and i65 %tmp2, 1		; <i65> [#uses=1]
	%tmp34 = trunc i65 %tmp3 to i8		; <i8> [#uses=1]
	%toBool = icmp ne i8 %tmp34, 0		; <i1> [#uses=1]
	br i1 %toBool, label %cond_true, label %cond_false

cond_true:		; preds = %entry
	store i32 0, ptr %iftmp.0, align 4
	br label %cond_next

cond_false:		; preds = %entry
	store i32 1, ptr %iftmp.0, align 4
	br label %cond_next

cond_next:		; preds = %cond_false, %cond_true
	%tmp5 = getelementptr [10 x i8], ptr @.str, i32 0, i32 0		; <ptr> [#uses=1]
	%tmp6 = load i32, ptr %iftmp.0, align 4		; <i32> [#uses=1]
	%tmp7 = call i32 (ptr, ...) @printf( ptr noalias  %tmp5, i32 %tmp6 ) nounwind 		; <i32> [#uses=0]
	br label %return

return:		; preds = %cond_next
    store i32 0, ptr %retval, align 4
	%retval8 = load i32, ptr %retval		; <i32> [#uses=1]
	ret i32 %retval8
}

declare i32 @printf(ptr noalias , ...) nounwind