Don't try to collapse DomainValues onto an incompatible SSE domain.
[oota-llvm.git] / test / CodeGen / X86 / 2010-04-06-SSEDomainFixCrash.ll
1 ; RUN: llc < %s -O3 -relocation-model=pic -disable-fp-elim -mcpu=nocona
2 ;
3 ; This test case is reduced from Bullet. It crashes SSEDomainFix.
4 ;
5 target 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-n8:16:32"
6 target triple = "i386-apple-darwin10.0"
7
8 %struct.CONTACT_KEY_TOKEN_COMP = type <{ i8 }>
9 %struct.GIM_AABB = type { %struct.btSimdScalar, %struct.btSimdScalar }
10 %struct.HullDesc = type { i32, i32, %struct.btSimdScalar*, i32, float, i32, i32 }
11 %struct.HullLibrary = type { %"struct.btAlignedObjectArray<btHullTriangle*>", %"struct.btAlignedObjectArray<btSoftBody::ePSolver::_>" }
12 %struct.HullResult = type { i8, i32, %"struct.btAlignedObjectArray<btVector3>", i32, i32, %"struct.btAlignedObjectArray<btSoftBody::ePSolver::_>" }
13 %struct.btActionInterface = type { i32 (...)** }
14 %"struct.btAlignedObjectArray<bool>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, i8*, i8 }
15 %"struct.btAlignedObjectArray<btCollisionObject*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %struct.btCollisionObject**, i8 }
16 %"struct.btAlignedObjectArray<btDbvt::sStkCLN>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btDbvt::sStkCLN"*, i8 }
17 %"struct.btAlignedObjectArray<btHullTriangle*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %struct.btHullTriangle**, i8 }
18 %"struct.btAlignedObjectArray<btSoftBody::Anchor>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Anchor"*, i8 }
19 %"struct.btAlignedObjectArray<btSoftBody::Cluster*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Cluster"**, i8 }
20 %"struct.btAlignedObjectArray<btSoftBody::Face>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Face"*, i8 }
21 %"struct.btAlignedObjectArray<btSoftBody::Joint*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Joint"**, i8 }
22 %"struct.btAlignedObjectArray<btSoftBody::Link>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Link"*, i8 }
23 %"struct.btAlignedObjectArray<btSoftBody::Material*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Material"**, i8 }
24 %"struct.btAlignedObjectArray<btSoftBody::Node*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Node"**, i8 }
25 %"struct.btAlignedObjectArray<btSoftBody::Node>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Node"*, i8 }
26 %"struct.btAlignedObjectArray<btSoftBody::Note>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Note"*, i8 }
27 %"struct.btAlignedObjectArray<btSoftBody::RContact>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::RContact"*, i8 }
28 %"struct.btAlignedObjectArray<btSoftBody::SContact>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::SContact"*, i8 }
29 %"struct.btAlignedObjectArray<btSoftBody::Tetra>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Tetra"*, i8 }
30 %"struct.btAlignedObjectArray<btSoftBody::ePSolver::_>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, i32*, i8 }
31 %"struct.btAlignedObjectArray<btSparseSdf<3>::Cell*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSparseSdf<3>::Cell"**, i8 }
32 %"struct.btAlignedObjectArray<btTypedConstraint*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %struct.btTypedConstraint**, i8 }
33 %"struct.btAlignedObjectArray<btVector3>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %struct.btSimdScalar*, i8 }
34 %"struct.btAlignedObjectArray<float>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, float*, i8 }
35 %struct.btBroadphaseProxy = type { i8*, i16, i16, i8*, i32, %struct.btSimdScalar, %struct.btSimdScalar }
36 %struct.btCollisionObject = type { i32 (...)**, %struct.btTransform, %struct.btTransform, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, i8, float, %struct.btBroadphaseProxy*, %struct.btCollisionShape*, %struct.btCollisionShape*, i32, i32, i32, i32, float, float, float, i8*, i32, float, float, float, i8, [7 x i8] }
37 %struct.btCollisionShape = type { i32 (...)**, i32, i8* }
38 %struct.btDbvt = type { %struct.btDbvtNode*, %struct.btDbvtNode*, i32, i32, i32, %"struct.btAlignedObjectArray<btDbvt::sStkCLN>" }
39 %"struct.btDbvt::sStkCLN" = type { %struct.btDbvtNode*, %struct.btDbvtNode* }
40 %struct.btDbvtNode = type { %struct.GIM_AABB, %struct.btDbvtNode*, %"union.btDbvtNode::$_12" }
41 %"struct.btHashKey<btTriIndex>" = type { i32 }
42 %struct.btHullTriangle = type { %struct.int3, %struct.int3, i32, i32, float }
43 %struct.btMatrix3x3 = type { [3 x %struct.btSimdScalar] }
44 %"struct.btRaycastVehicle::btVehicleTuning" = type { float, float, float, float, float }
45 %struct.btRigidBody = type { %struct.btCollisionObject, %struct.btMatrix3x3, %struct.btSimdScalar, %struct.btSimdScalar, float, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, float, float, i8, float, float, float, float, float, float, %struct.btActionInterface*, %"struct.btAlignedObjectArray<btTypedConstraint*>", i32, i32, i32 }
46 %struct.btSimdScalar = type { %"union.btSimdScalar::$_13" }
47 %struct.btSoftBody = type { [268 x i8], %"struct.btAlignedObjectArray<btCollisionObject*>", %"struct.btSoftBody::Config", %"struct.btRaycastVehicle::btVehicleTuning", %"struct.btSoftBody::Pose", i8*, %struct.btSoftBodyWorldInfo*, %"struct.btAlignedObjectArray<btSoftBody::Note>", %"struct.btAlignedObjectArray<btSoftBody::Node>", %"struct.btAlignedObjectArray<btSoftBody::Link>", %"struct.btAlignedObjectArray<btSoftBody::Face>", %"struct.btAlignedObjectArray<btSoftBody::Tetra>", %"struct.btAlignedObjectArray<btSoftBody::Anchor>", %"struct.btAlignedObjectArray<btSoftBody::RContact>", %"struct.btAlignedObjectArray<btSoftBody::SContact>", %"struct.btAlignedObjectArray<btSoftBody::Joint*>", %"struct.btAlignedObjectArray<btSoftBody::Material*>", float, [2 x %struct.btSimdScalar], i8, %struct.btDbvt, %struct.btDbvt, %struct.btDbvt, %"struct.btAlignedObjectArray<btSoftBody::Cluster*>", %"struct.btAlignedObjectArray<bool>", %struct.btTransform, %"struct.btAlignedObjectArray<btSoftBody::ePSolver::_>" }
48 %"struct.btSoftBody::Anchor" = type { %"struct.btSoftBody::Node"*, %struct.btSimdScalar, %struct.btRigidBody*, %struct.btMatrix3x3, %struct.btSimdScalar, float }
49 %"struct.btSoftBody::Body" = type { %"struct.btSoftBody::Cluster"*, %struct.btRigidBody*, %struct.btCollisionObject* }
50 %"struct.btSoftBody::Cluster" = type { %"struct.btAlignedObjectArray<btSoftBody::Node*>", %"struct.btAlignedObjectArray<float>", %"struct.btAlignedObjectArray<btVector3>", %struct.btTransform, float, float, %struct.btMatrix3x3, %struct.btMatrix3x3, %struct.btSimdScalar, [2 x %struct.btSimdScalar], [2 x %struct.btSimdScalar], i32, i32, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btDbvtNode*, float, float, float, float, float, float, i8, i8, i32 }
51 %"struct.btSoftBody::Config" = type { i32, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, i32, i32, i32, i32, i32, %"struct.btAlignedObjectArray<btSoftBody::ePSolver::_>", %"struct.btAlignedObjectArray<btSoftBody::ePSolver::_>", %"struct.btAlignedObjectArray<btSoftBody::ePSolver::_>" }
52 %"struct.btSoftBody::Element" = type { i8* }
53 %"struct.btSoftBody::Face" = type { %"struct.btSoftBody::Feature", [3 x %"struct.btSoftBody::Node"*], %struct.btSimdScalar, float, %struct.btDbvtNode* }
54 %"struct.btSoftBody::Feature" = type { %"struct.btSoftBody::Element", %"struct.btSoftBody::Material"* }
55 %"struct.btSoftBody::Joint" = type { i32 (...)**, [2 x %"struct.btSoftBody::Body"], [2 x %struct.btSimdScalar], float, float, float, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btMatrix3x3, i8 }
56 %"struct.btSoftBody::Link" = type { %"struct.btSoftBody::Feature", [2 x %"struct.btSoftBody::Node"*], float, i8, float, float, float, %struct.btSimdScalar }
57 %"struct.btSoftBody::Material" = type { %"struct.btSoftBody::Element", float, float, float, i32 }
58 %"struct.btSoftBody::Node" = type { %"struct.btSoftBody::Feature", %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, float, float, %struct.btDbvtNode*, i8 }
59 %"struct.btSoftBody::Note" = type { %"struct.btSoftBody::Element", i8*, %struct.btSimdScalar, i32, [4 x %"struct.btSoftBody::Node"*], [4 x float] }
60 %"struct.btSoftBody::Pose" = type { i8, i8, float, %"struct.btAlignedObjectArray<btVector3>", %"struct.btAlignedObjectArray<float>", %struct.btSimdScalar, %struct.btMatrix3x3, %struct.btMatrix3x3, %struct.btMatrix3x3 }
61 %"struct.btSoftBody::RContact" = type { %"struct.btSoftBody::sCti", %"struct.btSoftBody::Node"*, %struct.btMatrix3x3, %struct.btSimdScalar, float, float, float }
62 %"struct.btSoftBody::SContact" = type { %"struct.btSoftBody::Node"*, %"struct.btSoftBody::Face"*, %struct.btSimdScalar, %struct.btSimdScalar, float, float, [2 x float] }
63 %"struct.btSoftBody::Tetra" = type { %"struct.btSoftBody::Feature", [4 x %"struct.btSoftBody::Node"*], float, %struct.btDbvtNode*, [4 x %struct.btSimdScalar], float, float }
64 %"struct.btSoftBody::sCti" = type { %struct.btCollisionObject*, %struct.btSimdScalar, float }
65 %struct.btSoftBodyWorldInfo = type { float, float, float, %struct.btSimdScalar, %struct.btActionInterface*, %struct.btActionInterface*, %struct.btSimdScalar, %"struct.btSparseSdf<3>" }
66 %"struct.btSparseSdf<3>" = type { %"struct.btAlignedObjectArray<btSparseSdf<3>::Cell*>", float, i32, i32, i32, i32 }
67 %"struct.btSparseSdf<3>::Cell" = type { [4 x [4 x [4 x float]]], [3 x i32], i32, i32, %struct.btCollisionShape*, %"struct.btSparseSdf<3>::Cell"* }
68 %struct.btTransform = type { %struct.btMatrix3x3, %struct.btSimdScalar }
69 %struct.btTypedConstraint = type { i32 (...)**, %"struct.btHashKey<btTriIndex>", i32, i32, i8, %struct.btRigidBody*, %struct.btRigidBody*, float, float, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar }
70 %struct.int3 = type { i32, i32, i32 }
71 %"union.btDbvtNode::$_12" = type { [2 x %struct.btDbvtNode*] }
72 %"union.btSimdScalar::$_13" = type { <4 x float> }
73
74 declare i32 @_ZN11HullLibrary16CreateConvexHullERK8HullDescR10HullResult(%struct.HullLibrary*, %struct.HullDesc* nocapture, %struct.HullResult* nocapture) ssp align 2
75
76 define void @_ZN17btSoftBodyHelpers4DrawEP10btSoftBodyP12btIDebugDrawi(%struct.btSoftBody* %psb, %struct.btActionInterface* %idraw, i32 %drawflags) ssp align 2 {
77 entry:
78   br i1 undef, label %bb92, label %bb58
79
80 bb58:                                             ; preds = %entry
81   %0 = invoke i32 @_ZN11HullLibrary16CreateConvexHullERK8HullDescR10HullResult(%struct.HullLibrary* undef, %struct.HullDesc* undef, %struct.HullResult* undef)
82           to label %invcont64 unwind label %lpad159 ; <i32> [#uses=0]
83
84 invcont64:                                        ; preds = %bb58
85   br i1 undef, label %invcont65, label %bb.i.i
86
87 bb.i.i:                                           ; preds = %invcont64
88   %1 = load <4 x float>* undef, align 16          ; <<4 x float>> [#uses=5]
89   br i1 undef, label %bb.nph.i.i, label %invcont65
90
91 bb.nph.i.i:                                       ; preds = %bb.i.i
92   %tmp22.i.i = bitcast <4 x float> %1 to i128     ; <i128> [#uses=1]
93   %tmp23.i.i = trunc i128 %tmp22.i.i to i32       ; <i32> [#uses=1]
94   %2 = bitcast i32 %tmp23.i.i to float            ; <float> [#uses=1]
95   %tmp6.i = extractelement <4 x float> %1, i32 1  ; <float> [#uses=1]
96   %tmp2.i = extractelement <4 x float> %1, i32 2  ; <float> [#uses=1]
97   br label %bb1.i.i
98
99 bb1.i.i:                                          ; preds = %bb1.i.i, %bb.nph.i.i
100   %.tmp6.0.i.i = phi float [ %tmp2.i, %bb.nph.i.i ], [ %5, %bb1.i.i ] ; <float> [#uses=1]
101   %.tmp5.0.i.i = phi float [ %tmp6.i, %bb.nph.i.i ], [ %4, %bb1.i.i ] ; <float> [#uses=1]
102   %.tmp.0.i.i = phi float [ %2, %bb.nph.i.i ], [ %3, %bb1.i.i ] ; <float> [#uses=1]
103   %3 = fadd float %.tmp.0.i.i, undef              ; <float> [#uses=2]
104   %4 = fadd float %.tmp5.0.i.i, undef             ; <float> [#uses=2]
105   %5 = fadd float %.tmp6.0.i.i, undef             ; <float> [#uses=2]
106   br i1 undef, label %bb2.return.loopexit_crit_edge.i.i, label %bb1.i.i
107
108 bb2.return.loopexit_crit_edge.i.i:                ; preds = %bb1.i.i
109   %tmp8.i = insertelement <4 x float> %1, float %3, i32 0 ; <<4 x float>> [#uses=1]
110   %tmp4.i = insertelement <4 x float> %tmp8.i, float %4, i32 1 ; <<4 x float>> [#uses=1]
111   %tmp.i = insertelement <4 x float> %tmp4.i, float %5, i32 2 ; <<4 x float>> [#uses=1]
112   br label %invcont65
113
114 invcont65:                                        ; preds = %bb2.return.loopexit_crit_edge.i.i, %bb.i.i, %invcont64
115   %.0.i = phi <4 x float> [ %tmp.i, %bb2.return.loopexit_crit_edge.i.i ], [ undef, %invcont64 ], [ %1, %bb.i.i ] ; <<4 x float>> [#uses=1]
116   %tmp15.i = extractelement <4 x float> %.0.i, i32 2 ; <float> [#uses=1]
117   %6 = fmul float %tmp15.i, undef                 ; <float> [#uses=1]
118   br label %bb.i265
119
120 bb.i265:                                          ; preds = %bb.i265, %invcont65
121   %7 = fsub float 0.000000e+00, %6                ; <float> [#uses=1]
122   store float %7, float* undef, align 4
123   br label %bb.i265
124
125 bb92:                                             ; preds = %entry
126   unreachable
127
128 lpad159:                                          ; preds = %bb58
129   unreachable
130 }