File: arm64-2011-10-18-LdStOptBug.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,696 kB
  • sloc: cpp: 7,438,781; ansic: 1,393,871; asm: 1,012,926; python: 241,771; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 8,596; ml: 5,082; perl: 4,730; makefile: 3,591; awk: 3,523; javascript: 2,251; xml: 892; fortran: 672
file content (31 lines) | stat: -rw-r--r-- 894 bytes parent folder | download | duplicates (14)
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
; RUN: llc < %s -mtriple=arm64-apple-ios | FileCheck %s

; Can't fold the increment by 1<<12 into a post-increment load
; rdar://10301335

@test_data = common global i32 0, align 4

define void @t() nounwind ssp {
; CHECK-LABEL: t:
entry:
  br label %for.body

for.body:
; CHECK: for.body
; CHECK: ldr w{{[0-9]+}}, [x{{[0-9]+}}]
; CHECK: add x[[REG:[0-9]+]],
; CHECK:                      x[[REG]], #1, lsl  #12
  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
  %0 = shl nsw i64 %indvars.iv, 12
  %add = add nsw i64 %0, 34628173824
  %1 = inttoptr i64 %add to ptr
  %2 = load volatile i32, ptr %1, align 4096
  store volatile i32 %2, ptr @test_data, align 4
  %indvars.iv.next = add i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond = icmp eq i32 %lftr.wideiv, 200
  br i1 %exitcond, label %for.end, label %for.body

for.end:
  ret void
}