diff options
| author | Manman Ren <manman.ren@gmail.com> | 2014-01-31 01:10:35 +0000 |
|---|---|---|
| committer | Manman Ren <manman.ren@gmail.com> | 2014-01-31 01:10:35 +0000 |
| commit | 413a6cb42ba6b8f997f3546e3ebf02b178834faf (patch) | |
| tree | 6240a10554041862f23f97bd699e51a8d3b50340 /llvm/lib/Object/MachOUniversal.cpp | |
| parent | 332aafede3985657683b3aa334b72fd5fb05a06f (diff) | |
| download | bcm5719-llvm-413a6cb42ba6b8f997f3546e3ebf02b178834faf.tar.gz bcm5719-llvm-413a6cb42ba6b8f997f3546e3ebf02b178834faf.zip | |
This patch teaches the DAGCombiner how to fold insert_subvector nodes
when the input is a concat_vectors and the insert replaces one of the
concat halves:
Lower half: fold (insert_subvector (concat_vectors X, Y), Z) ->
(concat_vectors Z, Y)
Upper half: fold (insert_subvector (concat_vectors X, Y), Z) ->
(concat_vectors X, Z)
This can be seen with the following IR:
define <8 x float> @lower_half(<4 x float> %v1, <4 x float> %v2, <4 x
float> %v3) {
%1 = shufflevector <4 x float> %v1, <4 x float> %v2, <8 x i32> <i32
0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%2 = tail call <8 x float> @llvm.x86.avx.vinsertf128.ps.256(<8 x
float> %1, <4 x float> %v3, i8 0)
The vinsertf128 intrinsic is converted into an insert_subvector node
in SelectionDAGBuilder.cpp.
Using AVX, without the patch this generates two vinsertf128 instructions:
vinsertf128 $1, %xmm1, %ymm0, %ymm0
vinsertf128 $0, %xmm2, %ymm0, %ymm0
With the patch this is optimized into:
vinsertf128 $1, %xmm1, %ymm2, %ymm0
Patch by Robert Lougher.
llvm-svn: 200506
Diffstat (limited to 'llvm/lib/Object/MachOUniversal.cpp')
0 files changed, 0 insertions, 0 deletions

