llvm.org GIT mirror llvm / cb48593
Merge from mainline.. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_24@57708 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
2 changed file(s) with 169 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
634634 /// marked kill, then it must be due to register reuse. Transfer the kill info
635635 /// over.
636636 static void UpdateKills(MachineInstr &MI, BitVector &RegKills,
637 std::vector &KillOps) {
637 std::vector &KillOps,
638 const TargetRegisterInfo* TRI) {
638639 const TargetInstrDesc &TID = MI.getDesc();
639640 for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
640641 MachineOperand &MO = MI.getOperand(i);
668669 unsigned Reg = MO.getReg();
669670 RegKills.reset(Reg);
670671 KillOps[Reg] = NULL;
672 // It also defines (or partially define) aliases.
673 for (const unsigned *AS = TRI->getAliasSet(Reg); *AS; ++AS) {
674 RegKills.reset(*AS);
675 KillOps[*AS] = NULL;
676 }
671677 }
672678 }
673679
838844
839845 Spills.addAvailable(NewOp.StackSlotOrReMat, MI, NewPhysReg);
840846 --MII;
841 UpdateKills(*MII, RegKills, KillOps);
847 UpdateKills(*MII, RegKills, KillOps, TRI);
842848 DOUT << '\t' << *MII;
843849
844850 DOUT << "Reuse undone!\n";
12821288 }
12831289 // This invalidates Phys.
12841290 Spills.ClobberPhysReg(Phys);
1285 UpdateKills(*prior(MII), RegKills, KillOps);
1291 UpdateKills(*prior(MII), RegKills, KillOps, TRI);
12861292 DOUT << '\t' << *prior(MII);
12871293 }
12881294 }
14991505 TII->copyRegToReg(MBB, &MI, DesignatedReg, PhysReg, RC, RC);
15001506
15011507 MachineInstr *CopyMI = prior(MII);
1502 UpdateKills(*CopyMI, RegKills, KillOps);
1508 UpdateKills(*CopyMI, RegKills, KillOps, TRI);
15031509
15041510 // This invalidates DesignatedReg.
15051511 Spills.ClobberPhysReg(DesignatedReg);
15491555 MI.getOperand(i).setIsKill();
15501556 unsigned RReg = SubIdx ? TRI->getSubReg(PhysReg, SubIdx) : PhysReg;
15511557 MI.getOperand(i).setReg(RReg);
1552 UpdateKills(*prior(MII), RegKills, KillOps);
1558 UpdateKills(*prior(MII), RegKills, KillOps, TRI);
15531559 DOUT << '\t' << *prior(MII);
15541560 }
15551561
16491655 // super-register is needed below.
16501656 if (KillOpnd && !KillOpnd->getSubReg() &&
16511657 TII->unfoldMemoryOperand(MF, &MI, PhysReg, false, true,NewMIs)){
1652 MBB.insert(MII, NewMIs[0]);
1658 MBB.insert(MII, NewMIs[0]);
16531659 NewStore = NewMIs[1];
16541660 MBB.insert(MII, NewStore);
16551661 VRM.addSpillSlotUse(SS, NewStore);
18241830 VRM.RemoveMachineInstrFromMaps(&MI);
18251831 MBB.erase(&MI);
18261832 Erased = true;
1827 UpdateKills(*LastStore, RegKills, KillOps);
1833 UpdateKills(*LastStore, RegKills, KillOps, TRI);
18281834 goto ProcessNextInst;
18291835 }
18301836 }
18341840 DistanceMap.insert(std::make_pair(&MI, Dist++));
18351841 if (!Erased && !BackTracked) {
18361842 for (MachineBasicBlock::iterator II = &MI; II != NextMII; ++II)
1837 UpdateKills(*II, RegKills, KillOps);
1843 UpdateKills(*II, RegKills, KillOps, TRI);
18381844 }
18391845 MII = NextMII;
18401846 }
0 ; RUN: llvm-as < %s | llc -relocation-model=pic -disable-fp-elim -mtriple=i386-apple-darwin | grep and | grep 7 | grep ebp
1
2 %struct.XXDActiveTextureTargets = type { i64, i64, i64, i64, i64, i64 }
3 %struct.XXDAlphaTest = type { float, i16, i8, i8 }
4 %struct.XXDArrayRange = type { i8, i8, i8, i8 }
5 %struct.XXDBlendMode = type { i16, i16, i16, i16, %struct.XXTColor4, i16, i16, i8, i8, i8, i8 }
6 %struct.XXDClearColor = type { double, %struct.XXTColor4, %struct.XXTColor4, float, i32 }
7 %struct.XXDClipPlane = type { i32, [6 x %struct.XXTColor4] }
8 %struct.XXDColorBuffer = type { i16, i8, i8, [8 x i16], i8, i8, i8, i8 }
9 %struct.XXDColorMatrix = type { [16 x float]*, %struct.XXDImagingCC }
10 %struct.XXDConvolution = type { %struct.XXTColor4, %struct.XXDImagingCC, i16, i16, [0 x i32], float*, i32, i32 }
11 %struct.XXDDepthTest = type { i16, i16, i8, i8, i8, i8, double, double }
12 %struct.XXDFixedFunction = type { %struct.YYToken* }
13 %struct.XXDFogMode = type { %struct.XXTColor4, float, float, float, float, float, i16, i16, i16, i8, i8 }
14 %struct.XXDHintMode = type { i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }
15 %struct.XXDHistogram = type { %struct.XXTFixedColor4*, i32, i16, i8, i8 }
16 %struct.XXDImagingCC = type { { float, float }, { float, float }, { float, float }, { float, float } }
17 %struct.XXDImagingSubset = type { %struct.XXDConvolution, %struct.XXDConvolution, %struct.XXDConvolution, %struct.XXDColorMatrix, %struct.XXDMinmax, %struct.XXDHistogram, %struct.XXDImagingCC, %struct.XXDImagingCC, %struct.XXDImagingCC, %struct.XXDImagingCC, i32, [0 x i32] }
18 %struct.XXDLight = type { %struct.XXTColor4, %struct.XXTColor4, %struct.XXTColor4, %struct.XXTColor4, %struct.XXTCoord3, float, float, float, float, float, %struct.XXTCoord3, float, %struct.XXTCoord3, float, %struct.XXTCoord3, float, float, float, float, float }
19 %struct.XXDLightModel = type { %struct.XXTColor4, [8 x %struct.XXDLight], [2 x %struct.XXDMaterial], i32, i16, i16, i16, i8, i8, i8, i8, i8, i8 }
20 %struct.XXDLightProduct = type { %struct.XXTColor4, %struct.XXTColor4, %struct.XXTColor4 }
21 %struct.XXDLineMode = type { float, i32, i16, i16, i8, i8, i8, i8 }
22 %struct.XXDLogicOp = type { i16, i8, i8 }
23 %struct.XXDMaskMode = type { i32, [3 x i32], i8, i8, i8, i8, i8, i8, i8, i8 }
24 %struct.XXDMaterial = type { %struct.XXTColor4, %struct.XXTColor4, %struct.XXTColor4, %struct.XXTColor4, float, float, float, float, [8 x %struct.XXDLightProduct], %struct.XXTColor4, [8 x i32] }
25 %struct.XXDMinmax = type { %struct.XXDMinmaxTable*, i16, i8, i8, [0 x i32] }
26 %struct.XXDMinmaxTable = type { %struct.XXTColor4, %struct.XXTColor4 }
27 %struct.XXDMultisample = type { float, i8, i8, i8, i8, i8, i8, i8, i8 }
28 %struct.XXDPipelineProgramState = type { i8, i8, i8, i8, [0 x i32], %struct.XXTColor4* }
29 %struct.XXDPixelMap = type { i32*, float*, float*, float*, float*, float*, float*, float*, float*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
30 %struct.XXDPixelMode = type { float, float, %struct.XXDPixelStore, %struct.XXDPixelTransfer, %struct.XXDPixelMap, %struct.XXDImagingSubset, i32, i32 }
31 %struct.XXDPixelPack = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8 }
32 %struct.XXDPixelStore = type { %struct.XXDPixelPack, %struct.XXDPixelPack }
33 %struct.XXDPixelTransfer = 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 }
34 %struct.XXDPointMode = type { float, float, float, float, %struct.XXTCoord3, float, i8, i8, i8, i8, i16, i16, i32, i16, i16 }
35 %struct.XXDPolygonMode = type { [128 x i8], float, float, i16, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8 }
36 %struct.XXDRegisterCombiners = type { i8, i8, i8, i8, i32, [2 x %struct.XXTColor4], [8 x %struct.XXDRegisterCombinersPerStageState], %struct.XXDRegisterCombinersFinalStageState }
37 %struct.XXDRegisterCombinersFinalStageState = type { i8, i8, i8, i8, [7 x %struct.XXDRegisterCombinersPerVariableState] }
38 %struct.XXDRegisterCombinersPerPortionState = type { [4 x %struct.XXDRegisterCombinersPerVariableState], i8, i8, i8, i8, i16, i16, i16, i16, i16, i16 }
39 %struct.XXDRegisterCombinersPerStageState = type { [2 x %struct.XXDRegisterCombinersPerPortionState], [2 x %struct.XXTColor4] }
40 %struct.XXDRegisterCombinersPerVariableState = type { i16, i16, i16, i16 }
41 %struct.XXDScissorTest = type { %struct.XXTFixedColor4, i8, i8, i8, i8 }
42 %struct.XXDState = type <{ i16, i16, i16, i16, i32, i32, [256 x %struct.XXTColor4], [128 x %struct.XXTColor4], %struct.XXDViewport, %struct.XXDTransform, %struct.XXDLightModel, %struct.XXDActiveTextureTargets, %struct.XXDAlphaTest, %struct.XXDBlendMode, %struct.XXDClearColor, %struct.XXDColorBuffer, %struct.XXDDepthTest, %struct.XXDArrayRange, %struct.XXDFogMode, %struct.XXDHintMode, %struct.XXDLineMode, %struct.XXDLogicOp, %struct.XXDMaskMode, %struct.XXDPixelMode, %struct.XXDPointMode, %struct.XXDPolygonMode, %struct.XXDScissorTest, i32, %struct.XXDStencilTest, [8 x %struct.XXDTextureMode], [16 x %struct.XXDTextureImageMode], %struct.XXDArrayRange, [8 x %struct.XXDTextureCoordGen], %struct.XXDClipPlane, %struct.XXDMultisample, %struct.XXDRegisterCombiners, %struct.XXDArrayRange, %struct.XXDArrayRange, [3 x %struct.XXDPipelineProgramState], %struct.XXDArrayRange, %struct.XXDTransformFeedback, i32*, %struct.XXDFixedFunction, [3 x i32], [2 x i32] }>
43 %struct.XXDStencilTest = type { [3 x { i32, i32, i16, i16, i16, i16 }], i32, [4 x i8] }
44 %struct.XXDTextureCoordGen = type { { i16, i16, %struct.XXTColor4, %struct.XXTColor4 }, { i16, i16, %struct.XXTColor4, %struct.XXTColor4 }, { i16, i16, %struct.XXTColor4, %struct.XXTColor4 }, { i16, i16, %struct.XXTColor4, %struct.XXTColor4 }, i8, i8, i8, i8 }
45 %struct.XXDTextureImageMode = type { float }
46 %struct.XXDTextureMode = type { %struct.XXTColor4, 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 }
47 %struct.XXDTextureRec = type opaque
48 %struct.XXDTransform = 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 }>
49 %struct.XXDTransformFeedback = type { i8, i8, i8, i8, [0 x i32], [16 x i32], [16 x i32] }
50 %struct.XXDViewport = 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 }
51 %struct.XXTColor4 = type { float, float, float, float }
52 %struct.XXTCoord3 = type { float, float, float }
53 %struct.XXTFixedColor4 = type { i32, i32, i32, i32 }
54 %struct.XXVMTextures = type { [16 x %struct.XXDTextureRec*] }
55 %struct.XXVMVPContext = type { i32 }
56 %struct.XXVMVPStack = type { i32, i32 }
57 %struct.YYToken = type { { i16, i16, i32 } }
58 %struct._XXVMConstants = 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], [4096 x i8], [8 x float], [48 x float], [128 x float], [528 x i8], { void (i8*, i8*, i32, i8*)*, float (float)*, float (float)*, float (float)*, i32 (float)* } }
59 @llvm.used = appending global [1 x i8*] [ i8* bitcast (void (%struct.XXDState*, <4 x float>*, <4 x float>**, %struct._XXVMConstants*, %struct.YYToken*, %struct.XXVMVPContext*, %struct.XXVMTextures*, %struct.XXVMVPStack*, <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 <4 x float>]*, i32*, <4 x i32>*, i64)* @t to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
60
61 define void @t(%struct.XXDState* %gldst, <4 x float>* %prgrm, <4 x float>** %buffs, %struct._XXVMConstants* %cnstn, %struct.YYToken* %pstrm, %struct.XXVMVPContext* %vmctx, %struct.XXVMTextures* %txtrs, %struct.XXVMVPStack* %vpstk, <4 x float>* %atr0, <4 x float>* %atr1, <4 x float>* %atr2, <4 x float>* %atr3, <4 x float>* %vtx0, <4 x float>* %vtx1, <4 x float>* %vtx2, <4 x float>* %vtx3, [4 x <4 x float>]* %tmpGbl, i32* %oldMsk, <4 x i32>* %adrGbl, i64 %key_token) nounwind {
62 entry:
63 %0 = trunc i64 %key_token to i32 ; [#uses=1]
64 %1 = getelementptr %struct.YYToken* %pstrm, i32 %0 ; <%struct.YYToken*> [#uses=5]
65 br label %bb1132
66
67 bb51: ; preds = %bb1132
68 %2 = getelementptr %struct.YYToken* %1, i32 %operation.0.rec, i32 0, i32 0 ; [#uses=1]
69 %3 = load i16* %2, align 1 ; [#uses=3]
70 %4 = lshr i16 %3, 6 ; [#uses=1]
71 %5 = trunc i16 %4 to i8 ; [#uses=1]
72 %6 = zext i8 %5 to i32 ; [#uses=1]
73 %7 = trunc i16 %3 to i8 ; [#uses=1]
74 %8 = and i8 %7, 7 ; [#uses=1]
75 %mask5556 = zext i8 %8 to i32 ; [#uses=3]
76 %.sum1324 = add i32 %mask5556, 2 ; [#uses=1]
77 %.rec = add i32 %operation.0.rec, %.sum1324 ; [#uses=1]
78 %9 = bitcast %struct.YYToken* %operation.0 to i32* ; [#uses=1]
79 %10 = load i32* %9, align 1 ; [#uses=1]
80 %11 = lshr i32 %10, 16 ; [#uses=2]
81 %12 = trunc i32 %11 to i8 ; [#uses=1]
82 %13 = and i8 %12, 1 ; [#uses=1]
83 %14 = lshr i16 %3, 15 ; [#uses=1]
84 %15 = trunc i16 %14 to i8 ; [#uses=1]
85 %16 = or i8 %13, %15 ; [#uses=1]
86 %17 = icmp eq i8 %16, 0 ; [#uses=1]
87 br i1 %17, label %bb94, label %bb75
88
89 bb75: ; preds = %bb51
90 %18 = getelementptr %struct.YYToken* %1, i32 0, i32 0, i32 0 ; [#uses=1]
91 %19 = load i16* %18, align 4 ; [#uses=1]
92 %20 = load i16* null, align 2 ; [#uses=1]
93 %21 = zext i16 %19 to i64 ; [#uses=1]
94 %22 = zext i16 %20 to i64 ; [#uses=1]
95 %23 = shl i64 %22, 16 ; [#uses=1]
96 %.ins1177 = or i64 %23, %21 ; [#uses=1]
97 %.ins1175 = or i64 %.ins1177, 0 ; [#uses=1]
98 %24 = and i32 %11, 1 ; [#uses=1]
99 %.neg1333 = sub i32 %mask5556, %24 ; [#uses=1]
100 %.neg1335 = sub i32 %.neg1333, 0 ; [#uses=1]
101 %25 = sub i32 %.neg1335, 0 ; [#uses=1]
102 br label %bb94
103
104 bb94: ; preds = %bb75, %bb51
105 %extraToken.0 = phi i64 [ %.ins1175, %bb75 ], [ %extraToken.1, %bb51 ] ; [#uses=1]
106 %argCount.0 = phi i32 [ %25, %bb75 ], [ %mask5556, %bb51 ] ; [#uses=1]
107 %operation.0.sum1392 = add i32 %operation.0.rec, 1 ; [#uses=2]
108 %26 = getelementptr %struct.YYToken* %1, i32 %operation.0.sum1392, i32 0, i32 0 ; [#uses=1]
109 %27 = load i16* %26, align 4 ; [#uses=1]
110 %28 = getelementptr %struct.YYToken* %1, i32 %operation.0.sum1392, i32 0, i32 1 ; [#uses=1]
111 %29 = load i16* %28, align 2 ; [#uses=1]
112 store i16 %27, i16* null, align 8
113 store i16 %29, i16* null, align 2
114 br i1 false, label %bb1132, label %bb110
115
116 bb110: ; preds = %bb94
117 switch i32 %6, label %bb1078 [
118 i32 30, label %bb960
119 i32 32, label %bb801
120 i32 38, label %bb809
121 i32 78, label %bb1066
122 ]
123
124 bb801: ; preds = %bb110
125 unreachable
126
127 bb809: ; preds = %bb110
128 unreachable
129
130 bb960: ; preds = %bb110
131 %30 = icmp eq i32 %argCount.0, 1 ; [#uses=1]
132 br i1 %30, label %bb962, label %bb965
133
134 bb962: ; preds = %bb960
135 unreachable
136
137 bb965: ; preds = %bb960
138 unreachable
139
140 bb1066: ; preds = %bb110
141 unreachable
142
143 bb1078: ; preds = %bb110
144 unreachable
145
146 bb1132: ; preds = %bb94, %entry
147 %extraToken.1 = phi i64 [ undef, %entry ], [ %extraToken.0, %bb94 ] ; [#uses=1]
148 %operation.0.rec = phi i32 [ 0, %entry ], [ %.rec, %bb94 ] ; [#uses=4]
149 %operation.0 = getelementptr %struct.YYToken* %1, i32 %operation.0.rec ; <%struct.YYToken*> [#uses=1]
150 br i1 false, label %bb1134, label %bb51
151
152 bb1134: ; preds = %bb1132
153 ret void
154 }