Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
llvm-target-spread
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Raul Torres
llvm-target-spread
Commits
3b44c36b
Commit
3b44c36b
authored
5 years ago
by
Amaury Sechet
Browse files
Options
Downloads
Patches
Plain Diff
[X86] Add test for rotate combining when add X, X is used instead of shl X, 1. NFC
llvm-svn: 370203
parent
2dddf3e4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llvm/test/CodeGen/X86/rotate-extract-vector.ll
+14
-0
14 additions, 0 deletions
llvm/test/CodeGen/X86/rotate-extract-vector.ll
llvm/test/CodeGen/X86/rotate-extract.ll
+23
-0
23 additions, 0 deletions
llvm/test/CodeGen/X86/rotate-extract.ll
with
37 additions
and
0 deletions
llvm/test/CodeGen/X86/rotate-extract-vector.ll
+
14
−
0
View file @
3b44c36b
...
...
@@ -280,3 +280,17 @@ define <2 x i64> @no_extract_udiv(<2 x i64> %i) nounwind {
%out
=
or
<
2
x
i64
>
%lhs_shift
,
%rhs_div
ret
<
2
x
i64
>
%out
}
; DAGCombiner transforms shl X, 1 into add X, X.
define
<
4
x
i32
>
@extract_add_1
(<
4
x
i32
>
%i
)
nounwind
{
; CHECK-LABEL: extract_add_1:
; CHECK: # %bb.0:
; CHECK-NEXT: vpaddd %xmm0, %xmm0, %xmm1
; CHECK-NEXT: vpsrld $31, %xmm0, %xmm0
; CHECK-NEXT: vpor %xmm0, %xmm1, %xmm0
; CHECK-NEXT: ret{{[l|q]}}
%ii
=
add
<
4
x
i32
>
%i
,
%i
%rhs
=
lshr
<
4
x
i32
>
%i
,
<
i32
31
,
i32
31
,
i32
31
,
i32
31
>
%out
=
or
<
4
x
i32
>
%ii
,
%rhs
ret
<
4
x
i32
>
%out
}
This diff is collapsed.
Click to expand it.
llvm/test/CodeGen/X86/rotate-extract.ll
+
23
−
0
View file @
3b44c36b
...
...
@@ -265,3 +265,26 @@ define i8 @no_extract_udiv(i8 %i) nounwind {
%out
=
or
i8
%lhs_shift
,
%rhs_div
ret
i8
%out
}
; DAGCombiner transforms shl X, 1 into add X, X.
define
i32
@extract_add_1
(
i32
%i
)
nounwind
{
; X86-LABEL: extract_add_1:
; X86: # %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-NEXT: leal (%ecx,%ecx), %eax
; X86-NEXT: shrl $31, %ecx
; X86-NEXT: orl %ecx, %eax
; X86-NEXT: retl
;
; X64-LABEL: extract_add_1:
; X64: # %bb.0:
; X64-NEXT: # kill: def $edi killed $edi def $rdi
; X64-NEXT: leal (%rdi,%rdi), %eax
; X64-NEXT: shrl $31, %edi
; X64-NEXT: orl %edi, %eax
; X64-NEXT: retq
%ii
=
add
i32
%i
,
%i
%rhs
=
lshr
i32
%i
,
31
%out
=
or
i32
%ii
,
%rhs
ret
i32
%out
}
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