Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
llvm-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
Oniro Core
llvm-project
Commits
7457fe3d
Commit
7457fe3d
authored
3 years ago
by
Piotr Sobczak
Browse files
Options
Downloads
Patches
Plain Diff
[InstCombine][NFC] Precommit new tests
parent
c87a4a46
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/test/Transforms/InstCombine/insert-extract-shuffle.ll
+56
-0
56 additions, 0 deletions
llvm/test/Transforms/InstCombine/insert-extract-shuffle.ll
with
56 additions
and
0 deletions
llvm/test/Transforms/InstCombine/insert-extract-shuffle.ll
+
56
−
0
View file @
7457fe3d
...
...
@@ -692,6 +692,32 @@ define <4 x float> @insert_undemanded_element_op1(<4 x float> %x, <4 x float> %y
ret
<
4
x
float
>
%s
}
define
<
5
x
float
>
@insert_undemanded_element_unequal_length_op0
(<
4
x
float
>
%x
,
<
4
x
float
>
%y
)
{
; CHECK-LABEL: @insert_undemanded_element_unequal_length_op0(
; CHECK-NEXT: [[INS:%.*]] = insertelement <4 x float> [[X:%.*]], float 4.200000e+01, i32 3
; CHECK-NEXT: call void @use(<4 x float> [[INS]])
; CHECK-NEXT: [[S:%.*]] = shufflevector <4 x float> [[INS]], <4 x float> [[Y:%.*]], <5 x i32> <i32 undef, i32 0, i32 7, i32 1, i32 4>
; CHECK-NEXT: ret <5 x float> [[S]]
;
%ins
=
insertelement
<
4
x
float
>
%x
,
float
42.0
,
i32
3
call
void
@use
(<
4
x
float
>
%ins
)
%s
=
shufflevector
<
4
x
float
>
%ins
,
<
4
x
float
>
%y
,
<
5
x
i32
>
<
i32
undef
,
i32
0
,
i32
7
,
i32
1
,
i32
4
>
ret
<
5
x
float
>
%s
}
define
<
5
x
float
>
@insert_undemanded_element_unequal_length_op1
(<
4
x
float
>
%x
,
<
4
x
float
>
%y
)
{
; CHECK-LABEL: @insert_undemanded_element_unequal_length_op1(
; CHECK-NEXT: [[INS:%.*]] = insertelement <4 x float> [[X:%.*]], float 4.200000e+01, i32 3
; CHECK-NEXT: call void @use(<4 x float> [[INS]])
; CHECK-NEXT: [[S:%.*]] = shufflevector <4 x float> [[Y:%.*]], <4 x float> [[INS]], <5 x i32> <i32 undef, i32 3, i32 2, i32 1, i32 4>
; CHECK-NEXT: ret <5 x float> [[S]]
;
%ins
=
insertelement
<
4
x
float
>
%x
,
float
42.0
,
i32
3
call
void
@use
(<
4
x
float
>
%ins
)
%s
=
shufflevector
<
4
x
float
>
%y
,
<
4
x
float
>
%ins
,
<
5
x
i32
>
<
i32
undef
,
i32
3
,
i32
2
,
i32
1
,
i32
4
>
ret
<
5
x
float
>
%s
}
; Negative test - shuffle chooses the inserted constant.
define
<
4
x
float
>
@insert_demanded_element_op0
(<
4
x
float
>
%x
,
<
4
x
float
>
%y
)
{
...
...
@@ -722,6 +748,36 @@ define <4 x float> @insert_demanded_element_op1(<4 x float> %x, <4 x float> %y)
ret
<
4
x
float
>
%s
}
; Negative test - shuffle chooses the inserted constant.
define
<
5
x
float
>
@insert_demanded_element_unequal_length_op0
(<
4
x
float
>
%x
,
<
4
x
float
>
%y
)
{
; CHECK-LABEL: @insert_demanded_element_unequal_length_op0(
; CHECK-NEXT: [[INS:%.*]] = insertelement <4 x float> [[X:%.*]], float 4.200000e+01, i32 3
; CHECK-NEXT: call void @use(<4 x float> [[INS]])
; CHECK-NEXT: [[S:%.*]] = shufflevector <4 x float> [[INS]], <4 x float> [[Y:%.*]], <5 x i32> <i32 undef, i32 3, i32 2, i32 1, i32 4>
; CHECK-NEXT: ret <5 x float> [[S]]
;
%ins
=
insertelement
<
4
x
float
>
%x
,
float
42.0
,
i32
3
call
void
@use
(<
4
x
float
>
%ins
)
%s
=
shufflevector
<
4
x
float
>
%ins
,
<
4
x
float
>
%y
,
<
5
x
i32
>
<
i32
undef
,
i32
3
,
i32
2
,
i32
1
,
i32
4
>
ret
<
5
x
float
>
%s
}
; Negative test - shuffle chooses the inserted constant.
define
<
5
x
float
>
@insert_demanded_element_unequal_length_op1
(<
4
x
float
>
%x
,
<
4
x
float
>
%y
)
{
; CHECK-LABEL: @insert_demanded_element_unequal_length_op1(
; CHECK-NEXT: [[INS:%.*]] = insertelement <4 x float> [[X:%.*]], float 4.300000e+01, i32 3
; CHECK-NEXT: call void @use(<4 x float> [[INS]])
; CHECK-NEXT: [[S:%.*]] = shufflevector <4 x float> [[Y:%.*]], <4 x float> [[INS]], <5 x i32> <i32 undef, i32 0, i32 7, i32 1, i32 4>
; CHECK-NEXT: ret <5 x float> [[S]]
;
%ins
=
insertelement
<
4
x
float
>
%x
,
float
43.0
,
i32
3
call
void
@use
(<
4
x
float
>
%ins
)
%s
=
shufflevector
<
4
x
float
>
%y
,
<
4
x
float
>
%ins
,
<
5
x
i32
>
<
i32
undef
,
i32
0
,
i32
7
,
i32
1
,
i32
4
>
ret
<
5
x
float
>
%s
}
define
<
4
x
float
>
@splat_constant
(<
4
x
float
>
%x
)
{
; CHECK-LABEL: @splat_constant(
; CHECK-NEXT: [[INS3:%.*]] = insertelement <4 x float> [[X:%.*]], float 3.000000e+00, i32 3
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment