llvm.org GIT mirror llvm / 8ba1c6a
Don't try to collapse DomainValues onto an incompatible SSE domain. This fixes the Bullet regression on i386/nocona. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100553 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 9 years ago
2 changed file(s) with 142 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
215215 if (LiveRegs && (dv = LiveRegs[rx])) {
216216 if (dv->isCollapsed())
217217 dv->addDomain(domain);
218 else
218 else if (dv->hasDomain(domain))
219219 Collapse(dv, domain);
220 else {
221 // This is an incompatible open DomainValue. Collapse it to whatever and force
222 // the new value into domain. This costs a domain crossing.
223 Collapse(dv, dv->getFirstDomain());
224 assert(LiveRegs[rx] && "Not live after collapse?");
225 LiveRegs[rx]->addDomain(domain);
226 }
220227 } else {
221228 // Set up basic collapsed DomainValue.
222229 SetLiveReg(rx, Alloc(domain));
280287 // We have a live DomainValue from more than one predecessor.
281288 if (LiveRegs[rx]->isCollapsed()) {
282289 // We are already collapsed, but predecessor is not. Force him.
283 if (!pdv->isCollapsed())
284 Collapse(pdv, LiveRegs[rx]->getFirstDomain());
290 unsigned domain = LiveRegs[rx]->getFirstDomain();
291 if (!pdv->isCollapsed() && pdv->hasDomain(domain))
292 Collapse(pdv, domain);
285293 continue;
286294 }
287295
289297 if (!pdv->isCollapsed())
290298 Merge(LiveRegs[rx], pdv);
291299 else
292 Collapse(LiveRegs[rx], pdv->getFirstDomain());
300 Force(rx, pdv->getFirstDomain());
293301 }
294302 }
295303 }
0 ; RUN: llc < %s -O3 -relocation-model=pic -disable-fp-elim -mcpu=nocona
1 ;
2 ; This test case is reduced from Bullet. It crashes SSEDomainFix.
3 ;
4 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"
5 target triple = "i386-apple-darwin10.0"
6
7 %struct.CONTACT_KEY_TOKEN_COMP = type <{ i8 }>
8 %struct.GIM_AABB = type { %struct.btSimdScalar, %struct.btSimdScalar }
9 %struct.HullDesc = type { i32, i32, %struct.btSimdScalar*, i32, float, i32, i32 }
10 %struct.HullLibrary = type { %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray" }
11 %struct.HullResult = type { i8, i32, %"struct.btAlignedObjectArray", i32, i32, %"struct.btAlignedObjectArray" }
12 %struct.btActionInterface = type { i32 (...)** }
13 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, i8*, i8 }
14 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %struct.btCollisionObject**, i8 }
15 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btDbvt::sStkCLN"*, i8 }
16 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %struct.btHullTriangle**, i8 }
17 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Anchor"*, i8 }
18 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Cluster"**, i8 }
19 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Face"*, i8 }
20 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Joint"**, i8 }
21 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Link"*, i8 }
22 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Material"**, i8 }
23 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Node"**, i8 }
24 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Node"*, i8 }
25 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Note"*, i8 }
26 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::RContact"*, i8 }
27 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::SContact"*, i8 }
28 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSoftBody::Tetra"*, i8 }
29 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, i32*, i8 }
30 %"struct.btAlignedObjectArray::Cell*>" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %"struct.btSparseSdf<3>::Cell"**, i8 }
31 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %struct.btTypedConstraint**, i8 }
32 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, %struct.btSimdScalar*, i8 }
33 %"struct.btAlignedObjectArray" = type { %struct.CONTACT_KEY_TOKEN_COMP, i32, i32, float*, i8 }
34 %struct.btBroadphaseProxy = type { i8*, i16, i16, i8*, i32, %struct.btSimdScalar, %struct.btSimdScalar }
35 %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] }
36 %struct.btCollisionShape = type { i32 (...)**, i32, i8* }
37 %struct.btDbvt = type { %struct.btDbvtNode*, %struct.btDbvtNode*, i32, i32, i32, %"struct.btAlignedObjectArray" }
38 %"struct.btDbvt::sStkCLN" = type { %struct.btDbvtNode*, %struct.btDbvtNode* }
39 %struct.btDbvtNode = type { %struct.GIM_AABB, %struct.btDbvtNode*, %"union.btDbvtNode::$_12" }
40 %"struct.btHashKey" = type { i32 }
41 %struct.btHullTriangle = type { %struct.int3, %struct.int3, i32, i32, float }
42 %struct.btMatrix3x3 = type { [3 x %struct.btSimdScalar] }
43 %"struct.btRaycastVehicle::btVehicleTuning" = type { float, float, float, float, float }
44 %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", i32, i32, i32 }
45 %struct.btSimdScalar = type { %"union.btSimdScalar::$_13" }
46 %struct.btSoftBody = type { [268 x i8], %"struct.btAlignedObjectArray", %"struct.btSoftBody::Config", %"struct.btRaycastVehicle::btVehicleTuning", %"struct.btSoftBody::Pose", i8*, %struct.btSoftBodyWorldInfo*, %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", float, [2 x %struct.btSimdScalar], i8, %struct.btDbvt, %struct.btDbvt, %struct.btDbvt, %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %struct.btTransform, %"struct.btAlignedObjectArray" }
47 %"struct.btSoftBody::Anchor" = type { %"struct.btSoftBody::Node"*, %struct.btSimdScalar, %struct.btRigidBody*, %struct.btMatrix3x3, %struct.btSimdScalar, float }
48 %"struct.btSoftBody::Body" = type { %"struct.btSoftBody::Cluster"*, %struct.btRigidBody*, %struct.btCollisionObject* }
49 %"struct.btSoftBody::Cluster" = type { %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %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 }
50 %"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", %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray" }
51 %"struct.btSoftBody::Element" = type { i8* }
52 %"struct.btSoftBody::Face" = type { %"struct.btSoftBody::Feature", [3 x %"struct.btSoftBody::Node"*], %struct.btSimdScalar, float, %struct.btDbvtNode* }
53 %"struct.btSoftBody::Feature" = type { %"struct.btSoftBody::Element", %"struct.btSoftBody::Material"* }
54 %"struct.btSoftBody::Joint" = type { i32 (...)**, [2 x %"struct.btSoftBody::Body"], [2 x %struct.btSimdScalar], float, float, float, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btMatrix3x3, i8 }
55 %"struct.btSoftBody::Link" = type { %"struct.btSoftBody::Feature", [2 x %"struct.btSoftBody::Node"*], float, i8, float, float, float, %struct.btSimdScalar }
56 %"struct.btSoftBody::Material" = type { %"struct.btSoftBody::Element", float, float, float, i32 }
57 %"struct.btSoftBody::Node" = type { %"struct.btSoftBody::Feature", %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar, float, float, %struct.btDbvtNode*, i8 }
58 %"struct.btSoftBody::Note" = type { %"struct.btSoftBody::Element", i8*, %struct.btSimdScalar, i32, [4 x %"struct.btSoftBody::Node"*], [4 x float] }
59 %"struct.btSoftBody::Pose" = type { i8, i8, float, %"struct.btAlignedObjectArray", %"struct.btAlignedObjectArray", %struct.btSimdScalar, %struct.btMatrix3x3, %struct.btMatrix3x3, %struct.btMatrix3x3 }
60 %"struct.btSoftBody::RContact" = type { %"struct.btSoftBody::sCti", %"struct.btSoftBody::Node"*, %struct.btMatrix3x3, %struct.btSimdScalar, float, float, float }
61 %"struct.btSoftBody::SContact" = type { %"struct.btSoftBody::Node"*, %"struct.btSoftBody::Face"*, %struct.btSimdScalar, %struct.btSimdScalar, float, float, [2 x float] }
62 %"struct.btSoftBody::Tetra" = type { %"struct.btSoftBody::Feature", [4 x %"struct.btSoftBody::Node"*], float, %struct.btDbvtNode*, [4 x %struct.btSimdScalar], float, float }
63 %"struct.btSoftBody::sCti" = type { %struct.btCollisionObject*, %struct.btSimdScalar, float }
64 %struct.btSoftBodyWorldInfo = type { float, float, float, %struct.btSimdScalar, %struct.btActionInterface*, %struct.btActionInterface*, %struct.btSimdScalar, %"struct.btSparseSdf<3>" }
65 %"struct.btSparseSdf<3>" = type { %"struct.btAlignedObjectArray::Cell*>", float, i32, i32, i32, i32 }
66 %"struct.btSparseSdf<3>::Cell" = type { [4 x [4 x [4 x float]]], [3 x i32], i32, i32, %struct.btCollisionShape*, %"struct.btSparseSdf<3>::Cell"* }
67 %struct.btTransform = type { %struct.btMatrix3x3, %struct.btSimdScalar }
68 %struct.btTypedConstraint = type { i32 (...)**, %"struct.btHashKey", i32, i32, i8, %struct.btRigidBody*, %struct.btRigidBody*, float, float, %struct.btSimdScalar, %struct.btSimdScalar, %struct.btSimdScalar }
69 %struct.int3 = type { i32, i32, i32 }
70 %"union.btDbvtNode::$_12" = type { [2 x %struct.btDbvtNode*] }
71 %"union.btSimdScalar::$_13" = type { <4 x float> }
72
73 declare i32 @_ZN11HullLibrary16CreateConvexHullERK8HullDescR10HullResult(%struct.HullLibrary*, %struct.HullDesc* nocapture, %struct.HullResult* nocapture) ssp align 2
74
75 define void @_ZN17btSoftBodyHelpers4DrawEP10btSoftBodyP12btIDebugDrawi(%struct.btSoftBody* %psb, %struct.btActionInterface* %idraw, i32 %drawflags) ssp align 2 {
76 entry:
77 br i1 undef, label %bb92, label %bb58
78
79 bb58: ; preds = %entry
80 %0 = invoke i32 @_ZN11HullLibrary16CreateConvexHullERK8HullDescR10HullResult(%struct.HullLibrary* undef, %struct.HullDesc* undef, %struct.HullResult* undef)
81 to label %invcont64 unwind label %lpad159 ; [#uses=0]
82
83 invcont64: ; preds = %bb58
84 br i1 undef, label %invcont65, label %bb.i.i
85
86 bb.i.i: ; preds = %invcont64
87 %1 = load <4 x float>* undef, align 16 ; <<4 x float>> [#uses=5]
88 br i1 undef, label %bb.nph.i.i, label %invcont65
89
90 bb.nph.i.i: ; preds = %bb.i.i
91 %tmp22.i.i = bitcast <4 x float> %1 to i128 ; [#uses=1]
92 %tmp23.i.i = trunc i128 %tmp22.i.i to i32 ; [#uses=1]
93 %2 = bitcast i32 %tmp23.i.i to float ; [#uses=1]
94 %tmp6.i = extractelement <4 x float> %1, i32 1 ; [#uses=1]
95 %tmp2.i = extractelement <4 x float> %1, i32 2 ; [#uses=1]
96 br label %bb1.i.i
97
98 bb1.i.i: ; preds = %bb1.i.i, %bb.nph.i.i
99 %.tmp6.0.i.i = phi float [ %tmp2.i, %bb.nph.i.i ], [ %5, %bb1.i.i ] ; [#uses=1]
100 %.tmp5.0.i.i = phi float [ %tmp6.i, %bb.nph.i.i ], [ %4, %bb1.i.i ] ; [#uses=1]
101 %.tmp.0.i.i = phi float [ %2, %bb.nph.i.i ], [ %3, %bb1.i.i ] ; [#uses=1]
102 %3 = fadd float %.tmp.0.i.i, undef ; [#uses=2]
103 %4 = fadd float %.tmp5.0.i.i, undef ; [#uses=2]
104 %5 = fadd float %.tmp6.0.i.i, undef ; [#uses=2]
105 br i1 undef, label %bb2.return.loopexit_crit_edge.i.i, label %bb1.i.i
106
107 bb2.return.loopexit_crit_edge.i.i: ; preds = %bb1.i.i
108 %tmp8.i = insertelement <4 x float> %1, float %3, i32 0 ; <<4 x float>> [#uses=1]
109 %tmp4.i = insertelement <4 x float> %tmp8.i, float %4, i32 1 ; <<4 x float>> [#uses=1]
110 %tmp.i = insertelement <4 x float> %tmp4.i, float %5, i32 2 ; <<4 x float>> [#uses=1]
111 br label %invcont65
112
113 invcont65: ; preds = %bb2.return.loopexit_crit_edge.i.i, %bb.i.i, %invcont64
114 %.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]
115 %tmp15.i = extractelement <4 x float> %.0.i, i32 2 ; [#uses=1]
116 %6 = fmul float %tmp15.i, undef ; [#uses=1]
117 br label %bb.i265
118
119 bb.i265: ; preds = %bb.i265, %invcont65
120 %7 = fsub float 0.000000e+00, %6 ; [#uses=1]
121 store float %7, float* undef, align 4
122 br label %bb.i265
123
124 bb92: ; preds = %entry
125 unreachable
126
127 lpad159: ; preds = %bb58
128 unreachable
129 }