File: pr45185-range-predinfo.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (59 lines) | stat: -rw-r--r-- 2,189 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
47
48
49
50
51
52
53
54
55
56
57
58
59
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=ipsccp -S %s | FileCheck %s

;Test for PR45185.

define void @spam(ptr %arg) {
; CHECK-LABEL: define void @spam(
; CHECK-SAME: ptr [[ARG:%.*]]) {
; CHECK-NEXT:  [[BB:.*:]]
; CHECK-NEXT:    call void @blam(i32 0, ptr nonnull [[ARG]])
; CHECK-NEXT:    [[TMP1:%.*]] = getelementptr inbounds nuw [4 x [24 x float]], ptr [[ARG]], i64 0, i64 1, i64 0
; CHECK-NEXT:    call void @blam(i32 1, ptr nonnull [[TMP1]])
; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr inbounds nuw [4 x [24 x float]], ptr [[ARG]], i64 0, i64 2, i64 0
; CHECK-NEXT:    call void @blam(i32 2, ptr nonnull [[TMP2]])
; CHECK-NEXT:    ret void
;
bb:
  call void @blam(i32 0, ptr nonnull %arg)
  %tmp1 = getelementptr inbounds [4 x [24 x float]], ptr %arg, i64 0, i64 1, i64 0
  call void @blam(i32 1, ptr nonnull %tmp1)
  %tmp2 = getelementptr inbounds [4 x [24 x float]], ptr %arg, i64 0, i64 2, i64 0
  call void @blam(i32 2, ptr nonnull %tmp2)
  ret void
}

; Make sure we do not incorrectly eliminate the checks in @blam.
define internal void @blam(i32 %arg, ptr nocapture %arg1) {
; CHECK-LABEL: define internal void @blam(
; CHECK-SAME: i32 range(i32 0, 3) [[ARG:%.*]], ptr nocapture [[ARG1:%.*]]) {
; CHECK-NEXT:  [[BB:.*:]]
; CHECK-NEXT:    [[TMP:%.*]] = icmp eq i32 [[ARG]], 0
; CHECK-NEXT:    br i1 [[TMP]], label %[[BB2:.*]], label %[[BB3:.*]]
; CHECK:       [[BB2]]:
; CHECK-NEXT:    br label %[[BB5:.*]]
; CHECK:       [[BB3]]:
; CHECK-NEXT:    [[TMP4:%.*]] = icmp eq i32 [[ARG]], 2
; CHECK-NEXT:    br i1 [[TMP4]], label %[[BB5]], label %[[BB6:.*]]
; CHECK:       [[BB5]]:
; CHECK-NEXT:    ret void
; CHECK:       [[BB6]]:
; CHECK-NEXT:    ret void
;
bb:
  %tmp = icmp eq i32 %arg, 0
  br i1 %tmp, label %bb2, label %bb3

bb2:                                              ; preds = %bb
  br label %bb5

bb3:                                              ; preds = %bb
  %tmp4 = icmp eq i32 %arg, 2
  br i1 %tmp4, label %bb5, label %bb6

bb5:                                              ; preds = %bb3, %bb2
  ret void

bb6:                                              ; preds = %bb3
  ret void
}