-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SLP]Fix PR72524: "Out-of-bounds shuffle mask element" failed.
Need to check if we ran into subvector extract pattern before checking for identity vector to avoid compiler crash.
- Loading branch information
1 parent
59b2301
commit 206799f
Showing
2 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
llvm/test/Transforms/SLPVectorizer/X86/extract-subvector-long-input.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: opt -passes=slp-vectorizer -S -slp-threshold=-99999 -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s | ||
|
||
define void @test() { | ||
; CHECK-LABEL: define void @test() { | ||
; CHECK-NEXT: bb: | ||
; CHECK-NEXT: br label [[BB1:%.*]] | ||
; CHECK: bb1: | ||
; CHECK-NEXT: [[TMP0:%.*]] = phi <8 x i32> [ poison, [[BB10:%.*]] ], [ zeroinitializer, [[BB:%.*]] ] | ||
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <8 x i32> [[TMP0]], <8 x i32> poison, <2 x i32> <i32 6, i32 6> | ||
; CHECK-NEXT: switch i32 0, label [[BB16:%.*]] [ | ||
; CHECK-NEXT: i32 0, label [[BB14:%.*]] | ||
; CHECK-NEXT: i32 1, label [[BB11:%.*]] | ||
; CHECK-NEXT: ] | ||
; CHECK: bb9: | ||
; CHECK-NEXT: br label [[BB11]] | ||
; CHECK: bb10: | ||
; CHECK-NEXT: br label [[BB1]] | ||
; CHECK: bb11: | ||
; CHECK-NEXT: [[TMP2:%.*]] = phi <2 x i32> [ poison, [[BB9:%.*]] ], [ [[TMP1]], [[BB1]] ] | ||
; CHECK-NEXT: ret void | ||
; CHECK: bb14: | ||
; CHECK-NEXT: ret void | ||
; CHECK: bb15: | ||
; CHECK-NEXT: ret void | ||
; CHECK: bb16: | ||
; CHECK-NEXT: [[TMP3:%.*]] = phi <8 x i32> [ [[TMP0]], [[BB1]] ], [ poison, [[BB25:%.*]] ] | ||
; CHECK-NEXT: ret void | ||
; CHECK: bb25: | ||
; CHECK-NEXT: switch i32 0, label [[BB16]] [ | ||
; CHECK-NEXT: i32 0, label [[BB14]] | ||
; CHECK-NEXT: i32 1, label [[BB15:%.*]] | ||
; CHECK-NEXT: ] | ||
; | ||
bb: | ||
br label %bb1 | ||
|
||
bb1: | ||
%phi = phi i32 [ 0, %bb10 ], [ 0, %bb ] | ||
%phi2 = phi i32 [ 0, %bb10 ], [ 0, %bb ] | ||
%phi3 = phi i32 [ 0, %bb10 ], [ 0, %bb ] | ||
%phi4 = phi i32 [ 0, %bb10 ], [ 0, %bb ] | ||
%phi5 = phi i32 [ 0, %bb10 ], [ 0, %bb ] | ||
%phi6 = phi i32 [ 0, %bb10 ], [ 0, %bb ] | ||
%phi7 = phi i32 [ 0, %bb10 ], [ 0, %bb ] | ||
%phi8 = phi i32 [ 0, %bb10 ], [ 0, %bb ] | ||
switch i32 0, label %bb16 [ | ||
i32 0, label %bb14 | ||
i32 1, label %bb11 | ||
] | ||
|
||
bb9: | ||
br label %bb11 | ||
|
||
bb10: | ||
br label %bb1 | ||
|
||
bb11: | ||
%phi12 = phi i32 [ 0, %bb9 ], [ %phi7, %bb1 ] | ||
%phi13 = phi i32 [ 0, %bb9 ], [ undef, %bb1 ] | ||
ret void | ||
|
||
bb14: | ||
ret void | ||
|
||
bb15: | ||
ret void | ||
|
||
bb16: | ||
%phi17 = phi i32 [ %phi, %bb1 ], [ 0, %bb25 ] | ||
%phi18 = phi i32 [ %phi2, %bb1 ], [ 0, %bb25 ] | ||
%phi19 = phi i32 [ %phi3, %bb1 ], [ 0, %bb25 ] | ||
%phi20 = phi i32 [ %phi4, %bb1 ], [ 0, %bb25 ] | ||
%phi21 = phi i32 [ %phi5, %bb1 ], [ 0, %bb25 ] | ||
%phi22 = phi i32 [ %phi6, %bb1 ], [ 0, %bb25 ] | ||
%phi23 = phi i32 [ %phi7, %bb1 ], [ 0, %bb25 ] | ||
%phi24 = phi i32 [ %phi8, %bb1 ], [ 0, %bb25 ] | ||
ret void | ||
|
||
bb25: | ||
switch i32 0, label %bb16 [ | ||
i32 0, label %bb14 | ||
i32 1, label %bb15 | ||
] | ||
} |