blob: 6b3f6261dfaa732ce86cac885678da4caa899d57 [file] [log] [blame]
Tom Stellardf98f2ce2012-12-11 21:25:42 +00001//===-- SILowerControlFlow.cpp - Use predicates for control flow ----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10/// \file
Tom Stellard6b7d99d2012-12-19 22:10:31 +000011/// \brief This pass lowers the pseudo control flow instructions to real
12/// machine instructions.
Tom Stellardf98f2ce2012-12-11 21:25:42 +000013///
Tom Stellard6b7d99d2012-12-19 22:10:31 +000014/// All control flow is handled using predicated instructions and
Tom Stellardf98f2ce2012-12-11 21:25:42 +000015/// a predicate stack. Each Scalar ALU controls the operations of 64 Vector
16/// ALUs. The Scalar ALU can update the predicate for any of the Vector ALUs
17/// by writting to the 64-bit EXEC register (each bit corresponds to a
18/// single vector ALU). Typically, for predicates, a vector ALU will write
19/// to its bit of the VCC register (like EXEC VCC is 64-bits, one for each
20/// Vector ALU) and then the ScalarALU will AND the VCC register with the
21/// EXEC to update the predicates.
22///
23/// For example:
24/// %VCC = V_CMP_GT_F32 %VGPR1, %VGPR2
Tom Stellard6b7d99d2012-12-19 22:10:31 +000025/// %SGPR0 = SI_IF %VCC
Tom Stellardf98f2ce2012-12-11 21:25:42 +000026/// %VGPR0 = V_ADD_F32 %VGPR0, %VGPR0
Tom Stellard6b7d99d2012-12-19 22:10:31 +000027/// %SGPR0 = SI_ELSE %SGPR0
Tom Stellardf98f2ce2012-12-11 21:25:42 +000028/// %VGPR0 = V_SUB_F32 %VGPR0, %VGPR0
Tom Stellard6b7d99d2012-12-19 22:10:31 +000029/// SI_END_CF %SGPR0
Tom Stellardf98f2ce2012-12-11 21:25:42 +000030///
31/// becomes:
32///
33/// %SGPR0 = S_AND_SAVEEXEC_B64 %VCC // Save and update the exec mask
34/// %SGPR0 = S_XOR_B64 %SGPR0, %EXEC // Clear live bits from saved exec mask
Tom Stellard6b7d99d2012-12-19 22:10:31 +000035/// S_CBRANCH_EXECZ label0 // This instruction is an optional
Tom Stellardf98f2ce2012-12-11 21:25:42 +000036/// // optimization which allows us to
37/// // branch if all the bits of
38/// // EXEC are zero.
39/// %VGPR0 = V_ADD_F32 %VGPR0, %VGPR0 // Do the IF block of the branch
40///
41/// label0:
42/// %SGPR0 = S_OR_SAVEEXEC_B64 %EXEC // Restore the exec mask for the Then block
43/// %EXEC = S_XOR_B64 %SGPR0, %EXEC // Clear live bits from saved exec mask
44/// S_BRANCH_EXECZ label1 // Use our branch optimization
45/// // instruction again.
46/// %VGPR0 = V_SUB_F32 %VGPR0, %VGPR // Do the THEN block
47/// label1:
Tom Stellard6b7d99d2012-12-19 22:10:31 +000048/// %EXEC = S_OR_B64 %EXEC, %SGPR0 // Re-enable saved exec mask bits
Tom Stellardf98f2ce2012-12-11 21:25:42 +000049//===----------------------------------------------------------------------===//
50
51#include "AMDGPU.h"
52#include "SIInstrInfo.h"
53#include "SIMachineFunctionInfo.h"
54#include "llvm/CodeGen/MachineFunction.h"
55#include "llvm/CodeGen/MachineFunctionPass.h"
56#include "llvm/CodeGen/MachineInstrBuilder.h"
57#include "llvm/CodeGen/MachineRegisterInfo.h"
58
59using namespace llvm;
60
61namespace {
62
63class SILowerControlFlowPass : public MachineFunctionPass {
64
65private:
Tom Stellardd09d43a2012-12-19 22:10:33 +000066 static const unsigned SkipThreshold = 12;
67
Tom Stellardf98f2ce2012-12-11 21:25:42 +000068 static char ID;
Christian Konigb9e86782013-03-18 11:34:16 +000069 const TargetRegisterInfo *TRI;
Tom Stellardf98f2ce2012-12-11 21:25:42 +000070 const TargetInstrInfo *TII;
Tom Stellardf98f2ce2012-12-11 21:25:42 +000071
Tom Stellard935a9152013-01-18 21:15:50 +000072 bool shouldSkip(MachineBasicBlock *From, MachineBasicBlock *To);
73
74 void Skip(MachineInstr &From, MachineOperand &To);
75 void SkipIfDead(MachineInstr &MI);
Tom Stellardd09d43a2012-12-19 22:10:33 +000076
Tom Stellard6b7d99d2012-12-19 22:10:31 +000077 void If(MachineInstr &MI);
78 void Else(MachineInstr &MI);
79 void Break(MachineInstr &MI);
80 void IfBreak(MachineInstr &MI);
81 void ElseBreak(MachineInstr &MI);
82 void Loop(MachineInstr &MI);
83 void EndCf(MachineInstr &MI);
Tom Stellardf98f2ce2012-12-11 21:25:42 +000084
Tom Stellard935a9152013-01-18 21:15:50 +000085 void Kill(MachineInstr &MI);
Tom Stellardd09d43a2012-12-19 22:10:33 +000086 void Branch(MachineInstr &MI);
87
Christian Konigb9e86782013-03-18 11:34:16 +000088 void LoadM0(MachineInstr &MI, MachineInstr *MovRel);
89 void IndirectSrc(MachineInstr &MI);
90 void IndirectDst(MachineInstr &MI);
91
Tom Stellardf98f2ce2012-12-11 21:25:42 +000092public:
93 SILowerControlFlowPass(TargetMachine &tm) :
Christian Konigb9e86782013-03-18 11:34:16 +000094 MachineFunctionPass(ID), TRI(tm.getRegisterInfo()),
95 TII(tm.getInstrInfo()) { }
Tom Stellardf98f2ce2012-12-11 21:25:42 +000096
97 virtual bool runOnMachineFunction(MachineFunction &MF);
98
99 const char *getPassName() const {
100 return "SI Lower control flow instructions";
101 }
102
103};
104
105} // End anonymous namespace
106
107char SILowerControlFlowPass::ID = 0;
108
109FunctionPass *llvm::createSILowerControlFlowPass(TargetMachine &tm) {
110 return new SILowerControlFlowPass(tm);
111}
112
Tom Stellard935a9152013-01-18 21:15:50 +0000113bool SILowerControlFlowPass::shouldSkip(MachineBasicBlock *From,
114 MachineBasicBlock *To) {
115
Tom Stellardd09d43a2012-12-19 22:10:33 +0000116 unsigned NumInstr = 0;
117
Tom Stellard935a9152013-01-18 21:15:50 +0000118 for (MachineBasicBlock *MBB = From; MBB != To && !MBB->succ_empty();
Tom Stellardd09d43a2012-12-19 22:10:33 +0000119 MBB = *MBB->succ_begin()) {
120
121 for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end();
122 NumInstr < SkipThreshold && I != E; ++I) {
123
124 if (I->isBundle() || !I->isBundled())
Tom Stellard935a9152013-01-18 21:15:50 +0000125 if (++NumInstr >= SkipThreshold)
126 return true;
Tom Stellardd09d43a2012-12-19 22:10:33 +0000127 }
128 }
129
Tom Stellard935a9152013-01-18 21:15:50 +0000130 return false;
131}
132
133void SILowerControlFlowPass::Skip(MachineInstr &From, MachineOperand &To) {
134
135 if (!shouldSkip(*From.getParent()->succ_begin(), To.getMBB()))
Tom Stellardd09d43a2012-12-19 22:10:33 +0000136 return;
137
138 DebugLoc DL = From.getDebugLoc();
139 BuildMI(*From.getParent(), &From, DL, TII->get(AMDGPU::S_CBRANCH_EXECZ))
140 .addOperand(To)
141 .addReg(AMDGPU::EXEC);
142}
143
Tom Stellard935a9152013-01-18 21:15:50 +0000144void SILowerControlFlowPass::SkipIfDead(MachineInstr &MI) {
145
146 MachineBasicBlock &MBB = *MI.getParent();
147 DebugLoc DL = MI.getDebugLoc();
148
149 if (!shouldSkip(&MBB, &MBB.getParent()->back()))
150 return;
151
152 MachineBasicBlock::iterator Insert = &MI;
153 ++Insert;
154
155 // If the exec mask is non-zero, skip the next two instructions
156 BuildMI(MBB, Insert, DL, TII->get(AMDGPU::S_CBRANCH_EXECNZ))
157 .addImm(3)
158 .addReg(AMDGPU::EXEC);
159
160 // Exec mask is zero: Export to NULL target...
161 BuildMI(MBB, Insert, DL, TII->get(AMDGPU::EXP))
162 .addImm(0)
163 .addImm(0x09) // V_008DFC_SQ_EXP_NULL
164 .addImm(0)
165 .addImm(1)
166 .addImm(1)
Christian Konige25e4902013-02-16 11:28:22 +0000167 .addReg(AMDGPU::VGPR0)
168 .addReg(AMDGPU::VGPR0)
169 .addReg(AMDGPU::VGPR0)
170 .addReg(AMDGPU::VGPR0);
Tom Stellard935a9152013-01-18 21:15:50 +0000171
172 // ... and terminate wavefront
173 BuildMI(MBB, Insert, DL, TII->get(AMDGPU::S_ENDPGM));
174}
175
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000176void SILowerControlFlowPass::If(MachineInstr &MI) {
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000177 MachineBasicBlock &MBB = *MI.getParent();
178 DebugLoc DL = MI.getDebugLoc();
179 unsigned Reg = MI.getOperand(0).getReg();
180 unsigned Vcc = MI.getOperand(1).getReg();
181
182 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_AND_SAVEEXEC_B64), Reg)
183 .addReg(Vcc);
184
185 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_XOR_B64), Reg)
186 .addReg(AMDGPU::EXEC)
187 .addReg(Reg);
188
Tom Stellardd09d43a2012-12-19 22:10:33 +0000189 Skip(MI, MI.getOperand(2));
190
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000191 MI.eraseFromParent();
192}
193
194void SILowerControlFlowPass::Else(MachineInstr &MI) {
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000195 MachineBasicBlock &MBB = *MI.getParent();
196 DebugLoc DL = MI.getDebugLoc();
197 unsigned Dst = MI.getOperand(0).getReg();
198 unsigned Src = MI.getOperand(1).getReg();
199
Christian Konige9818022013-03-26 14:03:44 +0000200 BuildMI(MBB, MBB.getFirstNonPHI(), DL,
201 TII->get(AMDGPU::S_OR_SAVEEXEC_B64), Dst)
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000202 .addReg(Src); // Saved EXEC
203
204 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_XOR_B64), AMDGPU::EXEC)
205 .addReg(AMDGPU::EXEC)
206 .addReg(Dst);
207
Tom Stellardd09d43a2012-12-19 22:10:33 +0000208 Skip(MI, MI.getOperand(2));
209
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000210 MI.eraseFromParent();
211}
212
213void SILowerControlFlowPass::Break(MachineInstr &MI) {
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000214 MachineBasicBlock &MBB = *MI.getParent();
215 DebugLoc DL = MI.getDebugLoc();
216
217 unsigned Dst = MI.getOperand(0).getReg();
218 unsigned Src = MI.getOperand(1).getReg();
219
220 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_OR_B64), Dst)
221 .addReg(AMDGPU::EXEC)
222 .addReg(Src);
223
224 MI.eraseFromParent();
225}
226
227void SILowerControlFlowPass::IfBreak(MachineInstr &MI) {
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000228 MachineBasicBlock &MBB = *MI.getParent();
229 DebugLoc DL = MI.getDebugLoc();
230
231 unsigned Dst = MI.getOperand(0).getReg();
232 unsigned Vcc = MI.getOperand(1).getReg();
233 unsigned Src = MI.getOperand(2).getReg();
234
235 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_OR_B64), Dst)
236 .addReg(Vcc)
237 .addReg(Src);
238
239 MI.eraseFromParent();
240}
241
242void SILowerControlFlowPass::ElseBreak(MachineInstr &MI) {
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000243 MachineBasicBlock &MBB = *MI.getParent();
244 DebugLoc DL = MI.getDebugLoc();
245
246 unsigned Dst = MI.getOperand(0).getReg();
247 unsigned Saved = MI.getOperand(1).getReg();
248 unsigned Src = MI.getOperand(2).getReg();
249
250 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_OR_B64), Dst)
251 .addReg(Saved)
252 .addReg(Src);
253
254 MI.eraseFromParent();
255}
256
257void SILowerControlFlowPass::Loop(MachineInstr &MI) {
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000258 MachineBasicBlock &MBB = *MI.getParent();
259 DebugLoc DL = MI.getDebugLoc();
260 unsigned Src = MI.getOperand(0).getReg();
261
262 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_ANDN2_B64), AMDGPU::EXEC)
263 .addReg(AMDGPU::EXEC)
264 .addReg(Src);
265
266 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_CBRANCH_EXECNZ))
267 .addOperand(MI.getOperand(1))
268 .addReg(AMDGPU::EXEC);
269
270 MI.eraseFromParent();
271}
272
273void SILowerControlFlowPass::EndCf(MachineInstr &MI) {
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000274 MachineBasicBlock &MBB = *MI.getParent();
275 DebugLoc DL = MI.getDebugLoc();
276 unsigned Reg = MI.getOperand(0).getReg();
277
278 BuildMI(MBB, MBB.getFirstNonPHI(), DL,
279 TII->get(AMDGPU::S_OR_B64), AMDGPU::EXEC)
280 .addReg(AMDGPU::EXEC)
281 .addReg(Reg);
282
283 MI.eraseFromParent();
284}
285
Tom Stellardd09d43a2012-12-19 22:10:33 +0000286void SILowerControlFlowPass::Branch(MachineInstr &MI) {
Tom Stellardd09d43a2012-12-19 22:10:33 +0000287 MachineBasicBlock *Next = MI.getParent()->getNextNode();
288 MachineBasicBlock *Target = MI.getOperand(0).getMBB();
289 if (Target == Next)
290 MI.eraseFromParent();
291 else
292 assert(0);
293}
294
Tom Stellard935a9152013-01-18 21:15:50 +0000295void SILowerControlFlowPass::Kill(MachineInstr &MI) {
296
297 MachineBasicBlock &MBB = *MI.getParent();
298 DebugLoc DL = MI.getDebugLoc();
299
300 // Kill is only allowed in pixel shaders
NAKAMURA Takumi9262a642013-01-21 14:06:48 +0000301 assert(MBB.getParent()->getInfo<SIMachineFunctionInfo>()->ShaderType ==
302 ShaderType::PIXEL);
Tom Stellard935a9152013-01-18 21:15:50 +0000303
304 // Clear this pixel from the exec mask if the operand is negative
305 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::V_CMPX_LE_F32_e32), AMDGPU::VCC)
Christian Konige25e4902013-02-16 11:28:22 +0000306 .addImm(0)
Tom Stellard935a9152013-01-18 21:15:50 +0000307 .addOperand(MI.getOperand(0));
308
309 MI.eraseFromParent();
310}
311
Christian Konigb9e86782013-03-18 11:34:16 +0000312void SILowerControlFlowPass::LoadM0(MachineInstr &MI, MachineInstr *MovRel) {
313
314 MachineBasicBlock &MBB = *MI.getParent();
315 DebugLoc DL = MI.getDebugLoc();
316 MachineBasicBlock::iterator I = MI;
317
318 unsigned Save = MI.getOperand(1).getReg();
319 unsigned Idx = MI.getOperand(3).getReg();
320
321 if (AMDGPU::SReg_32RegClass.contains(Idx)) {
322 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_MOV_B32), AMDGPU::M0)
323 .addReg(Idx);
324 MBB.insert(I, MovRel);
325 MI.eraseFromParent();
326 return;
327 }
328
329 assert(AMDGPU::SReg_64RegClass.contains(Save));
330 assert(AMDGPU::VReg_32RegClass.contains(Idx));
331
332 // Save the EXEC mask
333 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_MOV_B64), Save)
334 .addReg(AMDGPU::EXEC);
335
336 // Read the next variant into VCC (lower 32 bits) <- also loop target
337 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::V_READFIRSTLANE_B32_e32), AMDGPU::VCC)
338 .addReg(Idx);
339
340 // Move index from VCC into M0
341 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_MOV_B32), AMDGPU::M0)
342 .addReg(AMDGPU::VCC);
343
344 // Compare the just read M0 value to all possible Idx values
345 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::V_CMP_EQ_U32_e32), AMDGPU::VCC)
346 .addReg(AMDGPU::M0)
347 .addReg(Idx);
348
349 // Update EXEC, save the original EXEC value to VCC
350 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_AND_SAVEEXEC_B64), AMDGPU::VCC)
351 .addReg(AMDGPU::VCC);
352
353 // Do the actual move
354 MBB.insert(I, MovRel);
355
356 // Update EXEC, switch all done bits to 0 and all todo bits to 1
357 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_XOR_B64), AMDGPU::EXEC)
358 .addReg(AMDGPU::EXEC)
359 .addReg(AMDGPU::VCC);
360
361 // Loop back to V_READFIRSTLANE_B32 if there are still variants to cover
362 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_CBRANCH_EXECNZ))
363 .addImm(-7)
364 .addReg(AMDGPU::EXEC);
365
366 // Restore EXEC
367 BuildMI(MBB, &MI, DL, TII->get(AMDGPU::S_MOV_B64), AMDGPU::EXEC)
368 .addReg(Save);
369
370 MI.eraseFromParent();
371}
372
373void SILowerControlFlowPass::IndirectSrc(MachineInstr &MI) {
374
375 MachineBasicBlock &MBB = *MI.getParent();
376 DebugLoc DL = MI.getDebugLoc();
377
378 unsigned Dst = MI.getOperand(0).getReg();
379 unsigned Vec = MI.getOperand(2).getReg();
380 unsigned Off = MI.getOperand(4).getImm();
381
382 MachineInstr *MovRel =
383 BuildMI(*MBB.getParent(), DL, TII->get(AMDGPU::V_MOVRELS_B32_e32), Dst)
384 .addReg(TRI->getSubReg(Vec, AMDGPU::sub0) + Off)
385 .addReg(AMDGPU::M0, RegState::Implicit)
386 .addReg(Vec, RegState::Implicit);
387
388 LoadM0(MI, MovRel);
389}
390
391void SILowerControlFlowPass::IndirectDst(MachineInstr &MI) {
392
393 MachineBasicBlock &MBB = *MI.getParent();
394 DebugLoc DL = MI.getDebugLoc();
395
396 unsigned Dst = MI.getOperand(0).getReg();
397 unsigned Off = MI.getOperand(4).getImm();
398 unsigned Val = MI.getOperand(5).getReg();
399
400 MachineInstr *MovRel =
401 BuildMI(*MBB.getParent(), DL, TII->get(AMDGPU::V_MOVRELD_B32_e32))
402 .addReg(TRI->getSubReg(Dst, AMDGPU::sub0) + Off, RegState::Define)
403 .addReg(Val)
404 .addReg(AMDGPU::M0, RegState::Implicit)
405 .addReg(Dst, RegState::Implicit);
406
407 LoadM0(MI, MovRel);
408}
409
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000410bool SILowerControlFlowPass::runOnMachineFunction(MachineFunction &MF) {
Tom Stellard935a9152013-01-18 21:15:50 +0000411
412 bool HaveKill = false;
413 unsigned Depth = 0;
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000414
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000415 for (MachineFunction::iterator BI = MF.begin(), BE = MF.end();
416 BI != BE; ++BI) {
417
418 MachineBasicBlock &MBB = *BI;
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000419 for (MachineBasicBlock::iterator I = MBB.begin(), Next = llvm::next(I);
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000420 I != MBB.end(); I = Next) {
421
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000422 Next = llvm::next(I);
423 MachineInstr &MI = *I;
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000424 switch (MI.getOpcode()) {
425 default: break;
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000426 case AMDGPU::SI_IF:
Tom Stellard935a9152013-01-18 21:15:50 +0000427 ++Depth;
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000428 If(MI);
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000429 break;
430
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000431 case AMDGPU::SI_ELSE:
432 Else(MI);
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000433 break;
434
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000435 case AMDGPU::SI_BREAK:
436 Break(MI);
437 break;
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000438
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000439 case AMDGPU::SI_IF_BREAK:
440 IfBreak(MI);
441 break;
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000442
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000443 case AMDGPU::SI_ELSE_BREAK:
444 ElseBreak(MI);
445 break;
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000446
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000447 case AMDGPU::SI_LOOP:
Tom Stellard935a9152013-01-18 21:15:50 +0000448 ++Depth;
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000449 Loop(MI);
450 break;
451
452 case AMDGPU::SI_END_CF:
Tom Stellard935a9152013-01-18 21:15:50 +0000453 if (--Depth == 0 && HaveKill) {
454 SkipIfDead(MI);
455 HaveKill = false;
456 }
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000457 EndCf(MI);
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000458 break;
Tom Stellardd09d43a2012-12-19 22:10:33 +0000459
Tom Stellard935a9152013-01-18 21:15:50 +0000460 case AMDGPU::SI_KILL:
461 if (Depth == 0)
462 SkipIfDead(MI);
463 else
464 HaveKill = true;
465 Kill(MI);
466 break;
467
Tom Stellardd09d43a2012-12-19 22:10:33 +0000468 case AMDGPU::S_BRANCH:
469 Branch(MI);
470 break;
Christian Konigb9e86782013-03-18 11:34:16 +0000471
472 case AMDGPU::SI_INDIRECT_SRC:
473 IndirectSrc(MI);
474 break;
475
476 case AMDGPU::SI_INDIRECT_DST_V2:
477 case AMDGPU::SI_INDIRECT_DST_V4:
478 case AMDGPU::SI_INDIRECT_DST_V8:
479 case AMDGPU::SI_INDIRECT_DST_V16:
480 IndirectDst(MI);
481 break;
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000482 }
483 }
484 }
Tom Stellard6b7d99d2012-12-19 22:10:31 +0000485
Tom Stellardf98f2ce2012-12-11 21:25:42 +0000486 return true;
487}