File: eliminate-exit-no-dl.ll

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (42 lines) | stat: -rw-r--r-- 1,654 bytes parent folder | download
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
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -indvars -S < %s | FileCheck %s

; Check the case where one exit has a pointer EC, and the other doesn't.
; Note that this test case is really really fragile.  Removing any
; instruction in the below causes the result to differ.  Note that the lack
; of a data layout (with pointer size info) is critical to getting a pointer
; EC returned by SCEV.

@global = external global [0 x i8], align 1

define void @foo() {
; CHECK-LABEL: @foo(
; CHECK-NEXT:  bb:
; CHECK-NEXT:    br label [[BB3:%.*]]
; CHECK:       bb3:
; CHECK-NEXT:    [[TMP6:%.*]] = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 1), align 1
; CHECK-NEXT:    br i1 false, label [[BB7:%.*]], label [[BB11:%.*]]
; CHECK:       bb7:
; CHECK-NEXT:    [[TMP8:%.*]] = zext i8 [[TMP6]] to i64
; CHECK-NEXT:    br i1 true, label [[BB11]], label [[BB3]]
; CHECK:       bb11:
; CHECK-NEXT:    ret void
;
bb:
  br label %bb3

bb3:                                              ; preds = %bb7, %bb2
  %tmp = phi i8* [ %tmp4, %bb7 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 2), %bb ]
  %tmp4 = getelementptr inbounds i8, i8* %tmp, i64 -1
  %tmp6 = load i8, i8* %tmp4, align 1
  %tmp5 = icmp ugt i8* %tmp4, getelementptr inbounds ([0 x i8], [0 x i8]* @global, i64 0, i64 500)
  br i1 %tmp5, label %bb7, label %bb11

bb7:                                              ; preds = %bb3
  %tmp8 = zext i8 %tmp6 to i64
  %tmp10 = icmp eq i16 0, 0
  br i1 %tmp10, label %bb11, label %bb3

bb11:                                             ; preds = %bb7, %bb3
  ret void
}