xref: /minix3/external/bsd/llvm/dist/llvm/test/CodeGen/X86/extractelement-shuffle.ll (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc; RUN: llc < %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc; Examples that exhibits a bug in DAGCombine.  The case is triggered by the
4*f4a2713aSLionel Sambuc; following program.  The bug is DAGCombine assumes that the bit convert
5*f4a2713aSLionel Sambuc; preserves the number of elements so the optimization code tries to read
6*f4a2713aSLionel Sambuc; through the 3rd mask element, which doesn't exist.
7*f4a2713aSLionel Sambucdefine i32 @update(<2 x i64> %val1, <2 x i64> %val2) nounwind readnone {
8*f4a2713aSLionel Sambucentry:
9*f4a2713aSLionel Sambuc	%shuf = shufflevector <2 x i64> %val1, <2 x i64> %val2, <2 x i32> <i32 0, i32 3>
10*f4a2713aSLionel Sambuc	%bit  = bitcast <2 x i64> %shuf to <4 x i32>
11*f4a2713aSLionel Sambuc	%res =  extractelement <4 x i32> %bit, i32 3
12*f4a2713aSLionel Sambuc	ret i32 %res
13*f4a2713aSLionel Sambuc}
14