-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SLP]Fix PR107036: Check if the type of the user is sizable before re…
…questing its size. Only some instructions should be considered as potentially reducing the size of the operands types, not all instructions should be considered. Fixes #107036 (cherry picked from commit f381cd0)
- Loading branch information
1 parent
11e2a15
commit 42f18ee
Showing
2 changed files
with
36 additions
and
0 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
31 changes: 31 additions & 0 deletions
31
llvm/test/Transforms/SLPVectorizer/X86/minbw-user-non-sizable.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,31 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s -slp-threshold=-100 | FileCheck %s | ||
|
||
define void @test(ptr %i) { | ||
; CHECK-LABEL: define void @test( | ||
; CHECK-SAME: ptr [[I:%.*]]) { | ||
; CHECK-NEXT: [[BB:.*]]: | ||
; CHECK-NEXT: br label %[[BB2:.*]] | ||
; CHECK: [[BB2]]: | ||
; CHECK-NEXT: [[TMP0:%.*]] = phi <2 x i32> [ [[TMP3:%.*]], %[[BB2]] ], [ zeroinitializer, %[[BB]] ] | ||
; CHECK-NEXT: store <2 x i32> [[TMP0]], ptr [[I]], align 4 | ||
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x i32> [[TMP0]], <2 x i32> <i32 0, i32 poison>, <2 x i32> <i32 2, i32 1> | ||
; CHECK-NEXT: [[TMP2:%.*]] = trunc <2 x i32> [[TMP1]] to <2 x i1> | ||
; CHECK-NEXT: [[TMP3]] = select <2 x i1> [[TMP2]], <2 x i32> zeroinitializer, <2 x i32> zeroinitializer | ||
; CHECK-NEXT: br label %[[BB2]] | ||
; | ||
bb: | ||
%i1 = getelementptr i8, ptr %i, i64 4 | ||
br label %bb2 | ||
|
||
bb2: | ||
%i3 = phi i32 [ %i6, %bb2 ], [ 0, %bb ] | ||
%i4 = phi i32 [ %i8, %bb2 ], [ 0, %bb ] | ||
store i32 %i3, ptr %i | ||
store i32 %i4, ptr %i1 | ||
%i5 = trunc i32 0 to i1 | ||
%i6 = select i1 %i5, i32 0, i32 0 | ||
%i7 = trunc i32 %i4 to i1 | ||
%i8 = select i1 %i7, i32 0, i32 0 | ||
br label %bb2 | ||
} |