File: large-constants-x32.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (55 lines) | stat: -rw-r--r-- 2,087 bytes parent folder | download | duplicates (7)
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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-linux-gnux32 | FileCheck %s

define void @constant_expressions() {
; CHECK-LABEL: constant_expressions:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    movl $-289477652, %eax # imm = 0xEEBEEBEC
; CHECK-NEXT:    movl (%eax), %ecx
; CHECK-NEXT:    movl $-289477644, %edx # imm = 0xEEBEEBF4
; CHECK-NEXT:    movl (%edx), %edx
; CHECK-NEXT:    movl $-289477648, %esi # imm = 0xEEBEEBF0
; CHECK-NEXT:    addl (%esi), %ecx
; CHECK-NEXT:    movl $-289477636, %esi # imm = 0xEEBEEBFC
; CHECK-NEXT:    addl (%esi), %edx
; CHECK-NEXT:    addl %ecx, %edx
; CHECK-NEXT:    movl %edx, (%eax)
; CHECK-NEXT:    retq
entry:
  %0 = load i32, ptr inttoptr (i32 add (i32 -289477652, i32 0) to ptr)
  %1 = load i32, ptr inttoptr (i32 add (i32 -289477652, i32 4) to ptr)
  %2 = load i32, ptr inttoptr (i32 add (i32 -289477652, i32 8) to ptr)
  %3 = load i32, ptr inttoptr (i32 add (i32 -289477652, i32 16) to ptr)
  %4 = add i32 %0, %1
  %5 = add i32 %2, %3
  %6 = add i32 %4, %5
  store i32 %6, ptr inttoptr (i32 add (i32 -289477652, i32 0) to ptr)
  ret void
}


define void @constant_expressions2() {
; CHECK-LABEL: constant_expressions2:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    movl $-289477652, %eax # imm = 0xEEBEEBEC
; CHECK-NEXT:    movl (%eax), %ecx
; CHECK-NEXT:    movl $-289477644, %edx # imm = 0xEEBEEBF4
; CHECK-NEXT:    movl (%edx), %edx
; CHECK-NEXT:    movl $-289477648, %esi # imm = 0xEEBEEBF0
; CHECK-NEXT:    addl (%esi), %ecx
; CHECK-NEXT:    movl $-289477640, %esi # imm = 0xEEBEEBF8
; CHECK-NEXT:    addl (%esi), %edx
; CHECK-NEXT:    addl %ecx, %edx
; CHECK-NEXT:    movl %edx, (%eax)
; CHECK-NEXT:    retq
entry:
  %0 = load i32, ptr inttoptr (i32 -289477652 to ptr)
  %1 = load i32, ptr inttoptr (i32 -289477648 to ptr)
  %2 = load i32, ptr inttoptr (i32 -289477644 to ptr)
  %3 = load i32, ptr inttoptr (i32 -289477640 to ptr)
  %4 = add i32 %0, %1
  %5 = add i32 %2, %3
  %6 = add i32 %4, %5
  store i32 %6, ptr inttoptr (i32 -289477652 to ptr)
  ret void
}