File: crash_vectorizeTree.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 (98 lines) | stat: -rw-r--r-- 3,918 bytes parent folder | download | duplicates (8)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=slp-vectorizer -mtriple=x86_64-apple-macosx10.9.0 -mcpu=corei7-avx -S < %s | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9.0"


; This test used to crash because we were following phi chains incorrectly.
; We used indices to get the incoming value of two phi nodes rather than
; incoming block lookup.
; This can give wrong results when the ordering of incoming
; edges in the two phi nodes don't match.

%0 = type { %1, %2 }
%1 = type { double, double }
%2 = type { double, double }


;define fastcc void @bar() {
define void @bar() {
; CHECK-LABEL: @bar(
; CHECK-NEXT:  bb:
; CHECK-NEXT:    [[I:%.*]] = getelementptr inbounds [[TMP0:%.*]], ptr undef, i64 0, i32 1, i32 0
; CHECK-NEXT:    [[I2:%.*]] = getelementptr inbounds [[TMP0]], ptr undef, i64 0, i32 1, i32 0
; CHECK-NEXT:    [[I4:%.*]] = getelementptr inbounds [[TMP0]], ptr undef, i64 0, i32 1, i32 0
; CHECK-NEXT:    br label [[BB6:%.*]]
; CHECK:       bb6:
; CHECK-NEXT:    [[TMP0]] = phi <2 x double> [ <double 1.800000e+01, double 2.800000e+01>, [[BB:%.*]] ], [ [[TMP3:%.*]], [[BB17:%.*]] ], [ [[TMP3]], [[BB16:%.*]] ], [ [[TMP3]], [[BB16]] ]
; CHECK-NEXT:    store <2 x double> [[TMP0]], ptr [[I]], align 8
; CHECK-NEXT:    [[TMP3]] = load <2 x double>, ptr [[I2]], align 8
; CHECK-NEXT:    br i1 undef, label [[BB11:%.*]], label [[BB12:%.*]]
; CHECK:       bb11:
; CHECK-NEXT:    ret void
; CHECK:       bb12:
; CHECK-NEXT:    store <2 x double> [[TMP3]], ptr [[I4]], align 8
; CHECK-NEXT:    br i1 undef, label [[BB13:%.*]], label [[BB14:%.*]]
; CHECK:       bb13:
; CHECK-NEXT:    br label [[BB14]]
; CHECK:       bb14:
; CHECK-NEXT:    br i1 undef, label [[BB15:%.*]], label [[BB16]]
; CHECK:       bb15:
; CHECK-NEXT:    unreachable
; CHECK:       bb16:
; CHECK-NEXT:    switch i32 undef, label [[BB17]] [
; CHECK-NEXT:    i32 32, label [[BB6]]
; CHECK-NEXT:    i32 103, label [[BB6]]
; CHECK-NEXT:    ]
; CHECK:       bb17:
; CHECK-NEXT:    br i1 undef, label [[BB6]], label [[BB18:%.*]]
; CHECK:       bb18:
; CHECK-NEXT:    unreachable
;
bb:
  %i = getelementptr inbounds %0, ptr undef, i64 0, i32 1, i32 0
  %i1 = getelementptr inbounds %0, ptr undef, i64 0, i32 1, i32 1
  %i2 = getelementptr inbounds %0, ptr undef, i64 0, i32 1, i32 0
  %i3 = getelementptr inbounds %0, ptr undef, i64 0, i32 1, i32 1
  %i4 = getelementptr inbounds %0, ptr undef, i64 0, i32 1, i32 0
  %i5 = getelementptr inbounds %0, ptr undef, i64 0, i32 1, i32 1
  br label %bb6

bb6:                                              ; preds = %bb17, %bb16, %bb16, %bb
  %i7 = phi double [ 2.800000e+01, %bb ], [ %i10, %bb17 ], [ %i10, %bb16 ], [ %i10, %bb16 ]
  %i8 = phi double [ 1.800000e+01, %bb ], [ %i9, %bb17 ], [ %i9, %bb16 ], [ %i9, %bb16 ]
  store double %i8, ptr %i, align 8
  store double %i7, ptr %i1, align 8
  %i9 = load double, ptr %i2, align 8
  %i10 = load double, ptr %i3, align 8
  br i1 undef, label %bb11, label %bb12

bb11:                                             ; preds = %bb6
  ret void

bb12:                                             ; preds = %bb6
  store double %i9, ptr %i4, align 8
  store double %i10, ptr %i5, align 8
  br i1 undef, label %bb13, label %bb14

bb13:                                             ; preds = %bb12
  br label %bb14

bb14:                                             ; preds = %bb13, %bb12
  br i1 undef, label %bb15, label %bb16

bb15:                                             ; preds = %bb14
  unreachable

bb16:                                             ; preds = %bb14
  switch i32 undef, label %bb17 [
  i32 32, label %bb6
  i32 103, label %bb6
  ]

bb17:                                             ; preds = %bb16
  br i1 undef, label %bb6, label %bb18

bb18:                                             ; preds = %bb17
  unreachable
}