xref: /aosp_15_r20/external/llvm/test/Transforms/InstCombine/shufflemask-undef.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -instcombine -S | not grep "shufflevector.*i32 8"
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
4*9880d681SAndroid Build Coastguard Workertarget triple = "i386-apple-darwin9"
5*9880d681SAndroid Build Coastguard Worker	%struct.ActiveTextureTargets = type { i64, i64, i64, i64, i64, i64 }
6*9880d681SAndroid Build Coastguard Worker	%struct.AlphaTest = type { float, i16, i8, i8 }
7*9880d681SAndroid Build Coastguard Worker	%struct.ArrayRange = type { i8, i8, i8, i8 }
8*9880d681SAndroid Build Coastguard Worker	%struct.BlendMode = type { i16, i16, i16, i16, %struct.IColor4, i16, i16, i8, i8, i8, i8 }
9*9880d681SAndroid Build Coastguard Worker	%struct.ClearColor = type { double, %struct.IColor4, %struct.IColor4, float, i32 }
10*9880d681SAndroid Build Coastguard Worker	%struct.ClipPlane = type { i32, [6 x %struct.IColor4] }
11*9880d681SAndroid Build Coastguard Worker	%struct.ColorBuffer = type { i16, i8, i8, [8 x i16], [0 x i32] }
12*9880d681SAndroid Build Coastguard Worker	%struct.ColorMatrix = type { [16 x float]*, %struct.ImagingColorScale }
13*9880d681SAndroid Build Coastguard Worker	%struct.Convolution = type { %struct.IColor4, %struct.ImagingColorScale, i16, i16, [0 x i32], float*, i32, i32 }
14*9880d681SAndroid Build Coastguard Worker	%struct.DepthTest = type { i16, i16, i8, i8, i8, i8, double, double }
15*9880d681SAndroid Build Coastguard Worker	%struct.FixedFunction = type { %struct.PPStreamToken* }
16*9880d681SAndroid Build Coastguard Worker	%struct.FogMode = type { %struct.IColor4, float, float, float, float, float, i16, i16, i16, i8, i8 }
17*9880d681SAndroid Build Coastguard Worker	%struct.HintMode = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
18*9880d681SAndroid Build Coastguard Worker	%struct.Histogram = type { %struct.ProgramLimits*, i32, i16, i8, i8 }
19*9880d681SAndroid Build Coastguard Worker	%struct.ImagingColorScale = type { %struct.TCoord2, %struct.TCoord2, %struct.TCoord2, %struct.TCoord2 }
20*9880d681SAndroid Build Coastguard Worker	%struct.ImagingSubset = type { %struct.Convolution, %struct.Convolution, %struct.Convolution, %struct.ColorMatrix, %struct.Minmax, %struct.Histogram, %struct.ImagingColorScale, %struct.ImagingColorScale, %struct.ImagingColorScale, %struct.ImagingColorScale, i32, [0 x i32] }
21*9880d681SAndroid Build Coastguard Worker	%struct.Light = type { %struct.IColor4, %struct.IColor4, %struct.IColor4, %struct.IColor4, %struct.PointLineLimits, float, float, float, float, float, %struct.PointLineLimits, float, %struct.PointLineLimits, float, %struct.PointLineLimits, float, float, float, float, float }
22*9880d681SAndroid Build Coastguard Worker	%struct.LightModel = type { %struct.IColor4, [8 x %struct.Light], [2 x %struct.Material], i32, i16, i16, i16, i8, i8, i8, i8, i8, i8 }
23*9880d681SAndroid Build Coastguard Worker	%struct.LightProduct = type { %struct.IColor4, %struct.IColor4, %struct.IColor4 }
24*9880d681SAndroid Build Coastguard Worker	%struct.LineMode = type { float, i32, i16, i16, i8, i8, i8, i8 }
25*9880d681SAndroid Build Coastguard Worker	%struct.LogicOp = type { i16, i8, i8 }
26*9880d681SAndroid Build Coastguard Worker	%struct.MaskMode = type { i32, [3 x i32], i8, i8, i8, i8, i8, i8, i8, i8 }
27*9880d681SAndroid Build Coastguard Worker	%struct.Material = type { %struct.IColor4, %struct.IColor4, %struct.IColor4, %struct.IColor4, float, float, float, float, [8 x %struct.LightProduct], %struct.IColor4, [8 x i32] }
28*9880d681SAndroid Build Coastguard Worker	%struct.Minmax = type { %struct.MinmaxTable*, i16, i8, i8, [0 x i32] }
29*9880d681SAndroid Build Coastguard Worker	%struct.MinmaxTable = type { %struct.IColor4, %struct.IColor4 }
30*9880d681SAndroid Build Coastguard Worker	%struct.Mipmaplevel = type { [4 x i32], [4 x i32], [4 x float], [4 x i32], i32, i32, float*, i8*, i16, i16, i16, i16, [2 x float] }
31*9880d681SAndroid Build Coastguard Worker	%struct.Multisample = type { float, i8, i8, i8, i8, i8, i8, i8, i8 }
32*9880d681SAndroid Build Coastguard Worker	%struct.PipelineProgramState = type { i8, i8, i8, i8, [0 x i32], %struct.IColor4* }
33*9880d681SAndroid Build Coastguard Worker	%struct.PixelMap = type { i32*, float*, float*, float*, float*, float*, float*, float*, float*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
34*9880d681SAndroid Build Coastguard Worker	%struct.PixelMode = type { float, float, %struct.PixelStore, %struct.PixelTransfer, %struct.PixelMap, %struct.ImagingSubset, i32, i32 }
35*9880d681SAndroid Build Coastguard Worker	%struct.PixelPack = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8 }
36*9880d681SAndroid Build Coastguard Worker	%struct.PixelStore = type { %struct.PixelPack, %struct.PixelPack }
37*9880d681SAndroid Build Coastguard Worker	%struct.PixelTransfer = type { float, float, float, float, float, float, float, float, float, float, i32, i32, float, float, float, float, float, float, float, float, float, float, float, float }
38*9880d681SAndroid Build Coastguard Worker	%struct.PluginBufferData = type { i32 }
39*9880d681SAndroid Build Coastguard Worker	%struct.PointLineLimits = type { float, float, float }
40*9880d681SAndroid Build Coastguard Worker	%struct.PointMode = type { float, float, float, float, %struct.PointLineLimits, float, i8, i8, i8, i8, i16, i16, i32, i16, i16 }
41*9880d681SAndroid Build Coastguard Worker	%struct.PolygonMode = type { [128 x i8], float, float, i16, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8 }
42*9880d681SAndroid Build Coastguard Worker	%struct.ProgramLimits = type { i32, i32, i32, i32 }
43*9880d681SAndroid Build Coastguard Worker	%struct.RegisterCombiners = type { i8, i8, i8, i8, i32, [2 x %struct.IColor4], [8 x %struct.RegisterCombinersPerStageState], %struct.RegisterCombinersFinalStageState }
44*9880d681SAndroid Build Coastguard Worker	%struct.RegisterCombinersFinalStageState = type { i8, i8, i8, i8, [7 x %struct.RegisterCombinersPerVariableState] }
45*9880d681SAndroid Build Coastguard Worker	%struct.RegisterCombinersPerPortionState = type { [4 x %struct.RegisterCombinersPerVariableState], i8, i8, i8, i8, i16, i16, i16, i16, i16, i16 }
46*9880d681SAndroid Build Coastguard Worker	%struct.RegisterCombinersPerStageState = type { [2 x %struct.RegisterCombinersPerPortionState], [2 x %struct.IColor4] }
47*9880d681SAndroid Build Coastguard Worker	%struct.RegisterCombinersPerVariableState = type { i16, i16, i16, i16 }
48*9880d681SAndroid Build Coastguard Worker	%struct.SWRSurfaceRec = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i8*, [4 x i8*], i32 }
49*9880d681SAndroid Build Coastguard Worker	%struct.ScissorTest = type { %struct.ProgramLimits, i8, i8, i8, i8 }
50*9880d681SAndroid Build Coastguard Worker	%struct.State = type <{ i16, i16, i16, i16, i32, i32, [256 x %struct.IColor4], [128 x %struct.IColor4], %struct.Viewport, %struct.Transform, %struct.LightModel, %struct.ActiveTextureTargets, %struct.AlphaTest, %struct.BlendMode, %struct.ClearColor, %struct.ColorBuffer, %struct.DepthTest, %struct.ArrayRange, %struct.FogMode, %struct.HintMode, %struct.LineMode, %struct.LogicOp, %struct.MaskMode, %struct.PixelMode, %struct.PointMode, %struct.PolygonMode, %struct.ScissorTest, i32, %struct.StencilTest, [8 x %struct.TextureMode], [16 x %struct.TextureImageMode], %struct.ArrayRange, [8 x %struct.TextureCoordGen], %struct.ClipPlane, %struct.Multisample, %struct.RegisterCombiners, %struct.ArrayRange, %struct.ArrayRange, [3 x %struct.PipelineProgramState], %struct.ArrayRange, %struct.TransformFeedback, i32*, %struct.FixedFunction, [3 x i32], [3 x i32] }>
51*9880d681SAndroid Build Coastguard Worker	%struct.StencilTest = type { [3 x { i32, i32, i16, i16, i16, i16 }], i32, [4 x i8] }
52*9880d681SAndroid Build Coastguard Worker	%struct.TextureCoordGen = type { { i16, i16, %struct.IColor4, %struct.IColor4 }, { i16, i16, %struct.IColor4, %struct.IColor4 }, { i16, i16, %struct.IColor4, %struct.IColor4 }, { i16, i16, %struct.IColor4, %struct.IColor4 }, i8, i8, i8, i8 }
53*9880d681SAndroid Build Coastguard Worker	%struct.TextureGeomState = type { i16, i16, i16, i16, i16, i8, i8, i8, i8, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, [6 x i16], [6 x i16] }
54*9880d681SAndroid Build Coastguard Worker	%struct.TextureImageMode = type { float }
55*9880d681SAndroid Build Coastguard Worker	%struct.TextureLevel = type { i32, i32, i16, i16, i16, i8, i8, i16, i16, i16, i16, i8* }
56*9880d681SAndroid Build Coastguard Worker	%struct.TextureMode = type { %struct.IColor4, i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, float, float, i16, i16, i16, i16, i16, i16, [4 x i16], i8, i8, i8, i8, [3 x float], [4 x float], float, float }
57*9880d681SAndroid Build Coastguard Worker	%struct.TextureParamState = type { i16, i16, i16, i16, i16, i16, %struct.IColor4, float, float, float, float, i16, i16, i16, i16, float, i16, i8, i8, i32, i8* }
58*9880d681SAndroid Build Coastguard Worker	%struct.TextureRec = type { [4 x float], %struct.TextureState*, %struct.Mipmaplevel*, %struct.Mipmaplevel*, float, float, float, float, i8, i8, i8, i8, i16, i16, i16, i16, i32, float, [2 x %struct.PPStreamToken] }
59*9880d681SAndroid Build Coastguard Worker	%struct.TextureState = type { i16, i8, i8, i16, i16, float, i32, %struct.SWRSurfaceRec*, %struct.TextureParamState, %struct.TextureGeomState, [0 x i32], i8*, i32, %struct.TextureLevel, [1 x [15 x %struct.TextureLevel]] }
60*9880d681SAndroid Build Coastguard Worker	%struct.Transform = type <{ [24 x [16 x float]], [24 x [16 x float]], [16 x float], float, float, float, float, float, i8, i8, i8, i8, i32, i32, i32, i16, i16, i8, i8, i8, i8, i32 }>
61*9880d681SAndroid Build Coastguard Worker	%struct.TransformFeedback = type { i8, i8, i8, i8, [0 x i32], [16 x i32], [16 x i32] }
62*9880d681SAndroid Build Coastguard Worker	%struct.Viewport = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, double, double, i32, i32, i32, i32, float, float, float, float }
63*9880d681SAndroid Build Coastguard Worker	%struct.IColor4 = type { float, float, float, float }
64*9880d681SAndroid Build Coastguard Worker	%struct.TCoord2 = type { float, float }
65*9880d681SAndroid Build Coastguard Worker	%struct.VMGPStack = type { [6 x <4 x float>*], <4 x float>*, i32, i32, <4 x float>*, <4 x float>**, i32, i32, i32, i32, i32, i32 }
66*9880d681SAndroid Build Coastguard Worker	%struct.VMTextures = type { [16 x %struct.TextureRec*] }
67*9880d681SAndroid Build Coastguard Worker	%struct.PPStreamToken = type { { i16, i16, i32 } }
68*9880d681SAndroid Build Coastguard Worker	%struct._VMConstants = type { <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, <4 x float>, float, float, float, float, float, float, float, float, float, float, float, float, [256 x float], [528 x i8], { void (i8*, i8*, i32, i8*)*, float (float)*, float (float)*, float (float)*, i32 (float)* } }
69*9880d681SAndroid Build Coastguard Worker
70*9880d681SAndroid Build Coastguard Workerdefine i32 @foo(%struct.State* %dst, <4 x float>* %prgrm, <4 x float>** %buffs, %struct._VMConstants* %cnstn, %struct.PPStreamToken* %pstrm, %struct.PluginBufferData* %gpctx, %struct.VMTextures* %txtrs, %struct.VMGPStack* %gpstk) nounwind {
71*9880d681SAndroid Build Coastguard Workerbb266.i:
72*9880d681SAndroid Build Coastguard Worker	getelementptr <4 x float>, <4 x float>* null, i32 11		; <<4 x float>*>:0 [#uses=1]
73*9880d681SAndroid Build Coastguard Worker	load <4 x float>, <4 x float>* %0, align 16		; <<4 x float>>:1 [#uses=1]
74*9880d681SAndroid Build Coastguard Worker	shufflevector <4 x float> %1, <4 x float> undef, <4 x i32> < i32 0, i32 1, i32 1, i32 1 >		; <<4 x float>>:2 [#uses=1]
75*9880d681SAndroid Build Coastguard Worker	shufflevector <4 x float> %2, <4 x float> undef, <4 x i32> < i32 0, i32 4, i32 1, i32 5 >		; <<4 x float>>:3 [#uses=1]
76*9880d681SAndroid Build Coastguard Worker	shufflevector <4 x float> undef, <4 x float> undef, <4 x i32> < i32 0, i32 4, i32 1, i32 5 >		; <<4 x float>>:4 [#uses=1]
77*9880d681SAndroid Build Coastguard Worker	shufflevector <4 x float> %4, <4 x float> %3, <4 x i32> < i32 6, i32 7, i32 2, i32 3 >		; <<4 x float>>:5 [#uses=1]
78*9880d681SAndroid Build Coastguard Worker	fmul <4 x float> %5, zeroinitializer		; <<4 x float>>:6 [#uses=2]
79*9880d681SAndroid Build Coastguard Worker	fmul <4 x float> %6, %6		; <<4 x float>>:7 [#uses=1]
80*9880d681SAndroid Build Coastguard Worker	fadd <4 x float> zeroinitializer, %7		; <<4 x float>>:8 [#uses=1]
81*9880d681SAndroid Build Coastguard Worker	call <4 x float> @llvm.x86.sse.max.ps( <4 x float> zeroinitializer, <4 x float> %8 ) nounwind readnone		; <<4 x float>>:9 [#uses=1]
82*9880d681SAndroid Build Coastguard Worker	%phitmp40 = bitcast <4 x float> %9 to <4 x i32>		; <<4 x i32>> [#uses=1]
83*9880d681SAndroid Build Coastguard Worker	%tmp4109.i = and <4 x i32> %phitmp40, < i32 8388607, i32 8388607, i32 8388607, i32 8388607 >		; <<4 x i32>> [#uses=1]
84*9880d681SAndroid Build Coastguard Worker	%tmp4116.i = or <4 x i32> %tmp4109.i, < i32 1065353216, i32 1065353216, i32 1065353216, i32 1065353216 >		; <<4 x i32>> [#uses=1]
85*9880d681SAndroid Build Coastguard Worker	%tmp4117.i = bitcast <4 x i32> %tmp4116.i to <4 x float>		; <<4 x float>> [#uses=1]
86*9880d681SAndroid Build Coastguard Worker	fadd <4 x float> %tmp4117.i, zeroinitializer		; <<4 x float>>:10 [#uses=1]
87*9880d681SAndroid Build Coastguard Worker	fmul <4 x float> %10, < float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01 >		; <<4 x float>>:11 [#uses=1]
88*9880d681SAndroid Build Coastguard Worker	call <4 x float> @llvm.x86.sse.max.ps( <4 x float> %11, <4 x float> zeroinitializer ) nounwind readnone		; <<4 x float>>:12 [#uses=1]
89*9880d681SAndroid Build Coastguard Worker	call <4 x float> @llvm.x86.sse.min.ps( <4 x float> %12, <4 x float> zeroinitializer ) nounwind readnone		; <<4 x float>>:13 [#uses=1]
90*9880d681SAndroid Build Coastguard Worker	%tmp4170.i = call <4 x float> @llvm.x86.sse.cmp.ps( <4 x float> %13, <4 x float> zeroinitializer, i8 2 ) nounwind		; <<4 x float>> [#uses=1]
91*9880d681SAndroid Build Coastguard Worker	bitcast <4 x float> %tmp4170.i to <16 x i8>		; <<16 x i8>>:14 [#uses=1]
92*9880d681SAndroid Build Coastguard Worker	call i32 @llvm.x86.sse2.pmovmskb.128( <16 x i8> %14 ) nounwind readnone		; <i32>:15 [#uses=1]
93*9880d681SAndroid Build Coastguard Worker	icmp eq i32 %15, 0		; <i1>:16 [#uses=1]
94*9880d681SAndroid Build Coastguard Worker	br i1 %16, label %bb5574.i, label %bb4521.i
95*9880d681SAndroid Build Coastguard Worker
96*9880d681SAndroid Build Coastguard Workerbb4521.i:		; preds = %bb266.i
97*9880d681SAndroid Build Coastguard Worker	unreachable
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Workerbb5574.i:		; preds = %bb266.i
100*9880d681SAndroid Build Coastguard Worker	unreachable
101*9880d681SAndroid Build Coastguard Worker}
102*9880d681SAndroid Build Coastguard Worker
103*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8) nounwind readnone
104*9880d681SAndroid Build Coastguard Worker
105*9880d681SAndroid Build Coastguard Workerdeclare i32 @llvm.x86.sse2.pmovmskb.128(<16 x i8>) nounwind readnone
106*9880d681SAndroid Build Coastguard Worker
107*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.sse.max.ps(<4 x float>, <4 x float>) nounwind readnone
108*9880d681SAndroid Build Coastguard Worker
109*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.sse.min.ps(<4 x float>, <4 x float>) nounwind readnone
110