llvm.org GIT mirror llvm / cf62b37
The bitcode reader can create an shuffle with a place holder mask which it will fix up later. For this special case, allow such a mask to be considered valid. <rdar://problem/8622574> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142992 91177308-0d34-0410-b5e6-96231b3b80d8 Mon P Wang 9 years ago
2 changed file(s) with 41 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
15751575 return false;
15761576 }
15771577 }
1578 }
1579 else if (!isa(Mask) && !isa(Mask))
1578 } else if (!isa(Mask) && !isa(Mask)) {
1579 // The bitcode reader can create a place holder for a forward reference
1580 // used as the shuffle mask. When this occurs, the shuffle mask will
1581 // fall into this case and fail. To avoid this error, do this bit of
1582 // ugliness to allow such a mask pass.
1583 if (const ConstantExpr* CE = dyn_cast(Mask)) {
1584 if (CE->getOpcode() == Instruction::UserOp1)
1585 return true;
1586 }
15801587 return false;
1581
1588 }
15821589 return true;
15831590 }
15841591
0 ; RUN: llvm-as < %s | llvm-dis
1
2 ;
3 ; tests the bitcodereader can handle the case where the reader will initially
4 ; create shuffle with a place holder mask.
5
6
7 define <4 x float> @test(<2 x double> %d2) {
8 entry:
9 %call20.i = tail call <4 x float> @cmp(<2 x double> %d2,
10 <2 x double> bitcast (
11 <4 x float> shufflevector (
12 <3 x float> shufflevector (
13 <4 x float> shufflevector (
14 <3 x float> bitcast (
15 i96 trunc (
16 i128 bitcast (<2 x double> bitcast (
17 <4 x i32> to <2 x double>)
18 to i128) to i96)
19 to <3 x float>),
20 <3 x float> undef,
21 <4 x i32> ),
22 <4 x float> undef,
23 <3 x i32> ),
24 <3 x float> undef,
25 <4 x i32> )
26 to <2 x double>))
27 ret <4 x float> %call20.i
28 }
29
30 declare <4 x float> @cmp(<2 x double>, <2 x double>)