File: self-ref-bug.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 (58 lines) | stat: -rw-r--r-- 2,861 bytes parent folder | download | duplicates (13)
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -mtriple=thumbv7-unknown-linux-gnueabihf < %s -arm-parallel-dsp -verify -S | FileCheck %s

target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"

define i32 @test(ptr %b) {
; CHECK-LABEL: @test(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = load i16, ptr [[B:%.*]], align 2
; CHECK-NEXT:    [[TMP1:%.*]] = load i32, ptr [[B]], align 2
; CHECK-NEXT:    [[TMP2:%.*]] = trunc i32 [[TMP1]] to i16
; CHECK-NEXT:    [[TMP3:%.*]] = sext i16 [[TMP2]] to i32
; CHECK-NEXT:    [[TMP4:%.*]] = lshr i32 [[TMP1]], 16
; CHECK-NEXT:    [[TMP5:%.*]] = trunc i32 [[TMP4]] to i16
; CHECK-NEXT:    [[TMP6:%.*]] = sext i16 [[TMP5]] to i32
; CHECK-NEXT:    [[CONV:%.*]] = sext i16 [[TMP0]] to i32
; CHECK-NEXT:    [[ARRAYIDX1:%.*]] = getelementptr inbounds i16, ptr [[B]], i32 3
; CHECK-NEXT:    [[TMP7:%.*]] = load i16, ptr [[ARRAYIDX1]], align 2
; CHECK-NEXT:    [[TMP8:%.*]] = load i32, ptr [[ARRAYIDX1]], align 2
; CHECK-NEXT:    [[TMP9:%.*]] = trunc i32 [[TMP8]] to i16
; CHECK-NEXT:    [[TMP10:%.*]] = call i32 @llvm.arm.smlad(i32 [[TMP8]], i32 [[TMP1]], i32 0)
; CHECK-NEXT:    [[TMP11:%.*]] = sext i16 [[TMP9]] to i32
; CHECK-NEXT:    [[TMP12:%.*]] = lshr i32 [[TMP8]], 16
; CHECK-NEXT:    [[TMP13:%.*]] = trunc i32 [[TMP12]] to i16
; CHECK-NEXT:    [[TMP14:%.*]] = sext i16 [[TMP13]] to i32
; CHECK-NEXT:    [[CONV2:%.*]] = sext i16 [[TMP7]] to i32
; CHECK-NEXT:    [[MUL:%.*]] = mul nsw i32 [[TMP11]], [[TMP3]]
; CHECK-NEXT:    [[INCDEC_PTR:%.*]] = getelementptr inbounds i16, ptr [[B]], i32 1
; CHECK-NEXT:    [[TMP15:%.*]] = load i16, ptr [[INCDEC_PTR]], align 2
; CHECK-NEXT:    [[CONV4:%.*]] = sext i16 [[TMP15]] to i32
; CHECK-NEXT:    [[ARRAYIDX5:%.*]] = getelementptr inbounds i16, ptr [[B]], i32 4
; CHECK-NEXT:    [[TMP16:%.*]] = load i16, ptr [[ARRAYIDX5]], align 2
; CHECK-NEXT:    [[CONV6:%.*]] = sext i16 [[TMP16]] to i32
; CHECK-NEXT:    [[MUL7:%.*]] = mul nsw i32 [[TMP14]], [[TMP6]]
; CHECK-NEXT:    [[ADD9:%.*]] = add nsw i32 [[MUL7]], [[MUL]]
; CHECK-NEXT:    [[MUL13:%.*]] = mul nsw i32 0, 0
; CHECK-NEXT:    [[ADD15:%.*]] = add nsw i32 [[MUL13]], [[TMP10]]
; CHECK-NEXT:    ret i32 [[ADD15]]
;
entry:
  %0 = load i16, ptr %b, align 2
  %conv = sext i16 %0 to i32
  %arrayidx1 = getelementptr inbounds i16, ptr %b, i32 3
  %1 = load i16, ptr %arrayidx1, align 2
  %conv2 = sext i16 %1 to i32
  %mul = mul nsw i32 %conv2, %conv
  %incdec.ptr = getelementptr inbounds i16, ptr %b, i32 1
  %2 = load i16, ptr %incdec.ptr, align 2
  %conv4 = sext i16 %2 to i32
  %arrayidx5 = getelementptr inbounds i16, ptr %b, i32 4
  %3 = load i16, ptr %arrayidx5, align 2
  %conv6 = sext i16 %3 to i32
  %mul7 = mul nsw i32 %conv6, %conv4
  %add9 = add nsw i32 %mul7, %mul
  %mul13 = mul nsw i32 0, 0
  %add15 = add nsw i32 %mul13, %add9
  ret i32 %add15
}