File: 2011-06-01-NonLocalMemdepMiscompile.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (66 lines) | stat: -rw-r--r-- 1,906 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
56
57
58
59
60
61
62
63
64
65
66
; RUN: opt < %s -basic-aa -loops -gvn -S | FileCheck %s
; This test is checking that (a) this doesn't crash, and (b) we don't
; conclude the value of %tmp17 is available in bb1.bb15_crit_edge.
; rdar://9429882

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-macosx10.7.0"
define i1 @rb_intern(i8 *%foo) nounwind ssp {
; CHECK-LABEL: @rb_intern(

bb:
  %tmp = alloca i8*, align 8
  store i8* null, i8** %tmp, align 8
  store i8 undef, i8* null, align 536870912
  br label %bb1

bb1:
  br i1 undef, label %bb3, label %bb15

; CHECK: bb1:
; CHECK: [[TMP:%.*]] = phi i8* [ %tmp14, %bb10 ], [ null, %bb ]

; CHECK: bb1.bb15_crit_edge:
; CHECK: %tmp17.pre = load i8, i8* [[TMP]], align 1

bb3:
  call void @isalnum()
  br i1 undef, label %bb10, label %bb5

bb5:
  br i1 undef, label %bb10, label %bb6

bb6:
  %tmp7 = load i8*, i8** %tmp, align 8
  %tmp8 = load i8, i8* %tmp7, align 1
  %tmp9 = zext i8 %tmp8 to i64
  br i1 undef, label %bb15, label %bb10

bb10:
  %tmp11 = load i8*, i8** %tmp, align 8
  %tmp12 = load i8, i8* %tmp11, align 1
  %tmp13 = zext i8 %tmp12 to i64
  %tmp14 = getelementptr inbounds i8, i8* %foo, i64 undef
  store i8* %tmp14, i8** %tmp, align 8
  br label %bb1

bb15:
  %tmp16 = load i8*, i8** %tmp, align 8
  %tmp17 = load i8, i8* %tmp16, align 1
  %tmp18 = icmp eq i8 %tmp17, 0
  br label %bb19

; CHECK-LABEL: bb6:
; CHECK:         br i1 undef, label %bb15split, label %bb10

; CHECK-LABEL: bb15split:                                        ; preds = %bb6
; CHECK-NEXT:    br label %bb15

; CHECK-LABEL: bb15:
; CHECK:         %tmp17 = phi i8 [ %tmp8, %bb15split ], [ %tmp17.pre, %bb1.bb15_crit_edge ]

bb19:                                             ; preds = %bb15
  ret i1 %tmp18
}

declare void @isalnum() nounwind inlinehint ssp