Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DAGCombine] Fix a bug in a BUILD_VECTOR combine
When trying to convert a BUILD_VECTOR into a shuffle, we try to split a single source vector that is twice as wide as the destination vector. We can not do this when we also need the zero vector to create a blend. This fixes PR22774. Differential Revision: http://reviews.llvm.org/D8040 llvm-svn: 231219
- Loading branch information
Michael Kuperstein
committed
Mar 4, 2015
1 parent
43fbf68
commit fb95697
Showing
2 changed files
with
23 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
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,20 @@ | ||
; RUN: llc -mattr=avx %s -o - | FileCheck %s | ||
|
||
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-pc-linux-gnu" | ||
|
||
@in = global <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1>, align 32 | ||
@out = global <2 x i64> zeroinitializer, align 16 | ||
|
||
define i32 @_Z3foov() { | ||
entry: | ||
; CHECK: vmovdqa in(%rip), %ymm0 | ||
; CHECK-NEXT: vmovq %xmm0, %xmm0 | ||
; CHECK-NEXT: vmovdqa %xmm0, out(%rip) | ||
%0 = load <4 x i64>, <4 x i64>* @in, align 32 | ||
%vecext = extractelement <4 x i64> %0, i32 0 | ||
%vecinit = insertelement <2 x i64> undef, i64 %vecext, i32 0 | ||
%vecinit1 = insertelement <2 x i64> %vecinit, i64 0, i32 1 | ||
store <2 x i64> %vecinit1, <2 x i64>* @out, align 16 | ||
ret i32 0 | ||
} |