]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp
Merge ^/head r317281 through r317502.
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / Hexagon / MCTargetDesc / HexagonMCChecker.cpp
1 //===----- HexagonMCChecker.cpp - Instruction bundle checking -------------===//
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 // This implements the checking of insns inside a bundle according to the
11 // packet constraint rules of the Hexagon ISA.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #include "HexagonMCChecker.h"
16
17 #include "HexagonBaseInfo.h"
18
19 #include "llvm/MC/MCInstrDesc.h"
20 #include "llvm/MC/MCInstrInfo.h"
21 #include "llvm/Support/CommandLine.h"
22 #include "llvm/Support/Debug.h"
23 #include "llvm/Support/raw_ostream.h"
24
25 using namespace llvm;
26
27 static cl::opt<bool> RelaxNVChecks("relax-nv-checks", cl::init(false),
28   cl::ZeroOrMore, cl::Hidden, cl::desc("Relax checks of new-value validity"));
29
30 const HexagonMCChecker::PredSense
31   HexagonMCChecker::Unconditional(Hexagon::NoRegister, false);
32
33 void HexagonMCChecker::init() {
34   // Initialize read-only registers set.
35   ReadOnly.insert(Hexagon::PC);
36
37   // Figure out the loop-registers definitions.
38   if (HexagonMCInstrInfo::isInnerLoop(MCB)) {
39     Defs[Hexagon::SA0].insert(Unconditional); // FIXME: define or change SA0?
40     Defs[Hexagon::LC0].insert(Unconditional);
41   }
42   if (HexagonMCInstrInfo::isOuterLoop(MCB)) {
43     Defs[Hexagon::SA1].insert(Unconditional); // FIXME: define or change SA0?
44     Defs[Hexagon::LC1].insert(Unconditional);
45   }
46
47   if (HexagonMCInstrInfo::isBundle(MCB))
48     // Unfurl a bundle.
49     for (auto const&I : HexagonMCInstrInfo::bundleInstructions(MCB)) {
50       MCInst const &Inst = *I.getInst();
51       if (HexagonMCInstrInfo::isDuplex(MCII, Inst)) {
52         init(*Inst.getOperand(0).getInst());
53         init(*Inst.getOperand(1).getInst());
54       }
55       else
56         init(Inst);
57     }
58   else
59     init(MCB);
60 }
61
62 void HexagonMCChecker::initReg(MCInst const &MCI, unsigned R, unsigned &PredReg,
63                                bool &isTrue) {
64   if (HexagonMCInstrInfo::isPredicated(MCII, MCI) && isPredicateRegister(R)) {
65     // Note an used predicate register.
66     PredReg = R;
67     isTrue = HexagonMCInstrInfo::isPredicatedTrue(MCII, MCI);
68
69     // Note use of new predicate register.
70     if (HexagonMCInstrInfo::isPredicatedNew(MCII, MCI))
71       NewPreds.insert(PredReg);
72   }
73   else
74     // Note register use.  Super-registers are not tracked directly,
75     // but their components.
76     for(MCRegAliasIterator SRI(R, &RI, !MCSubRegIterator(R, &RI).isValid());
77         SRI.isValid();
78         ++SRI)
79       if (!MCSubRegIterator(*SRI, &RI).isValid())
80         // Skip super-registers used indirectly.
81         Uses.insert(*SRI);
82 }
83
84 void HexagonMCChecker::init(MCInst const& MCI) {
85   const MCInstrDesc& MCID = HexagonMCInstrInfo::getDesc(MCII, MCI);
86   unsigned PredReg = Hexagon::NoRegister;
87   bool isTrue = false;
88
89   // Get used registers.
90   for (unsigned i = MCID.getNumDefs(); i < MCID.getNumOperands(); ++i)
91     if (MCI.getOperand(i).isReg())
92       initReg(MCI, MCI.getOperand(i).getReg(), PredReg, isTrue);
93   for (unsigned i = 0; i < MCID.getNumImplicitUses(); ++i)
94     initReg(MCI, MCID.getImplicitUses()[i], PredReg, isTrue);
95
96   // Get implicit register definitions.
97   if (const MCPhysReg *ImpDef = MCID.getImplicitDefs())
98     for (; *ImpDef; ++ImpDef) {
99       unsigned R = *ImpDef;
100
101       if (Hexagon::R31 != R && MCID.isCall())
102         // Any register other than the LR and the PC are actually volatile ones
103         // as defined by the ABI, not modified implicitly by the call insn.
104         continue;
105       if (Hexagon::PC == R)
106         // Branches are the only insns that can change the PC,
107         // otherwise a read-only register.
108         continue;
109
110       if (Hexagon::USR_OVF == R)
111         // Many insns change the USR implicitly, but only one or another flag.
112         // The instruction table models the USR.OVF flag, which can be implicitly
113         // modified more than once, but cannot be modified in the same packet
114         // with an instruction that modifies is explicitly. Deal with such situ-
115         // ations individually.
116         SoftDefs.insert(R);
117       else if (isPredicateRegister(R) &&
118                HexagonMCInstrInfo::isPredicateLate(MCII, MCI))
119         // Include implicit late predicates.
120         LatePreds.insert(R);
121       else
122         Defs[R].insert(PredSense(PredReg, isTrue));
123     }
124
125   // Figure out explicit register definitions.
126   for (unsigned i = 0; i < MCID.getNumDefs(); ++i) {
127     unsigned R = MCI.getOperand(i).getReg(),
128              S = Hexagon::NoRegister;
129     // USR has subregisters (while C8 does not for technical reasons), so
130     // reset R to USR, since we know how to handle multiple defs of USR,
131     // taking into account its subregisters.
132     if (R == Hexagon::C8)
133       R = Hexagon::USR;
134
135     // Note register definitions, direct ones as well as indirect side-effects.
136     // Super-registers are not tracked directly, but their components.
137     for(MCRegAliasIterator SRI(R, &RI, !MCSubRegIterator(R, &RI).isValid());
138         SRI.isValid();
139         ++SRI) {
140       if (MCSubRegIterator(*SRI, &RI).isValid())
141         // Skip super-registers defined indirectly.
142         continue;
143
144       if (R == *SRI) {
145         if (S == R)
146           // Avoid scoring the defined register multiple times.
147           continue;
148         else
149           // Note that the defined register has already been scored.
150           S = R;
151       }
152
153       if (Hexagon::P3_0 != R && Hexagon::P3_0 == *SRI)
154         // P3:0 is a special case, since multiple predicate register definitions
155         // in a packet is allowed as the equivalent of their logical "and".
156         // Only an explicit definition of P3:0 is noted as such; if a
157         // side-effect, then note as a soft definition.
158         SoftDefs.insert(*SRI);
159       else if (HexagonMCInstrInfo::isPredicateLate(MCII, MCI) && isPredicateRegister(*SRI))
160         // Some insns produce predicates too late to be used in the same packet.
161         LatePreds.insert(*SRI);
162       else if (i == 0 && llvm::HexagonMCInstrInfo::getType(MCII, MCI) == HexagonII::TypeCVI_VM_CUR_LD)
163         // Current loads should be used in the same packet.
164         // TODO: relies on the impossibility of a current and a temporary loads
165         // in the same packet.
166         CurDefs.insert(*SRI), Defs[*SRI].insert(PredSense(PredReg, isTrue));
167       else if (i == 0 && llvm::HexagonMCInstrInfo::getType(MCII, MCI) == HexagonII::TypeCVI_VM_TMP_LD)
168         // Temporary loads should be used in the same packet, but don't commit
169         // results, so it should be disregarded if another insn changes the same
170         // register.
171         // TODO: relies on the impossibility of a current and a temporary loads
172         // in the same packet.
173         TmpDefs.insert(*SRI);
174       else if (i <= 1 && llvm::HexagonMCInstrInfo::hasNewValue2(MCII, MCI) )
175         // vshuff(Vx, Vy, Rx) <- Vx(0) and Vy(1) are both source and
176         // destination registers with this instruction. same for vdeal(Vx,Vy,Rx)
177         Uses.insert(*SRI);
178       else
179         Defs[*SRI].insert(PredSense(PredReg, isTrue));
180     }
181   }
182
183   // Figure out register definitions that produce new values.
184   if (HexagonMCInstrInfo::hasNewValue(MCII, MCI)) {
185     unsigned R = HexagonMCInstrInfo::getNewValueOperand(MCII, MCI).getReg();
186
187     if (HexagonMCInstrInfo::isCompound(MCII, MCI))
188       compoundRegisterMap(R); // Compound insns have a limited register range.
189
190     for(MCRegAliasIterator SRI(R, &RI, !MCSubRegIterator(R, &RI).isValid());
191         SRI.isValid();
192         ++SRI)
193       if (!MCSubRegIterator(*SRI, &RI).isValid())
194         // No super-registers defined indirectly.
195         NewDefs[*SRI].push_back(NewSense::Def(PredReg, HexagonMCInstrInfo::isPredicatedTrue(MCII, MCI),
196                                               HexagonMCInstrInfo::isFloat(MCII, MCI)));
197
198     // For fairly unique 2-dot-new producers, example:
199     // vdeal(V1, V9, R0) V1.new and V9.new can be used by consumers.
200     if (HexagonMCInstrInfo::hasNewValue2(MCII, MCI)) {
201       unsigned R2 = HexagonMCInstrInfo::getNewValueOperand2(MCII, MCI).getReg();
202
203       for(MCRegAliasIterator SRI(R2, &RI, !MCSubRegIterator(R2, &RI).isValid());
204           SRI.isValid();
205           ++SRI)
206         if (!MCSubRegIterator(*SRI, &RI).isValid())
207           NewDefs[*SRI].push_back(NewSense::Def(PredReg, HexagonMCInstrInfo::isPredicatedTrue(MCII, MCI),
208                                                 HexagonMCInstrInfo::isFloat(MCII, MCI)));
209     }
210   }
211
212   // Figure out definitions of new predicate registers.
213   if (HexagonMCInstrInfo::isPredicatedNew(MCII, MCI))
214     for (unsigned i = MCID.getNumDefs(); i < MCID.getNumOperands(); ++i)
215       if (MCI.getOperand(i).isReg()) {
216         unsigned P = MCI.getOperand(i).getReg();
217
218         if (isPredicateRegister(P))
219           NewPreds.insert(P);
220       }
221
222   // Figure out uses of new values.
223   if (HexagonMCInstrInfo::isNewValue(MCII, MCI)) {
224     unsigned N = HexagonMCInstrInfo::getNewValueOperand(MCII, MCI).getReg();
225
226     if (!MCSubRegIterator(N, &RI).isValid()) {
227       // Super-registers cannot use new values.
228       if (MCID.isBranch())
229         NewUses[N] = NewSense::Jmp(
230           llvm::HexagonMCInstrInfo::getType(MCII, MCI) == HexagonII::TypeNCJ);
231       else
232         NewUses[N] = NewSense::Use(
233           PredReg, HexagonMCInstrInfo::isPredicatedTrue(MCII, MCI));
234     }
235   }
236 }
237
238 HexagonMCChecker::HexagonMCChecker(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &mcb, MCInst &mcbdx,
239                                    MCRegisterInfo const &ri)
240     : MCB(mcb), MCBDX(mcbdx), RI(ri), MCII(MCII), STI(STI),
241       bLoadErrInfo(false) {
242   init();
243 }
244
245 bool HexagonMCChecker::check(bool FullCheck) {
246   bool chkB = checkBranches();
247   bool chkP = checkPredicates();
248   bool chkNV = checkNewValues();
249   bool chkR = checkRegisters();
250   bool chkS = checkSolo();
251   bool chkSh = true;
252   if (FullCheck)
253    chkSh = checkShuffle();
254   bool chkSl = true;
255   if (FullCheck)
256    chkSl = checkSlots();
257   bool chk = chkB && chkP && chkNV && chkR && chkS && chkSh && chkSl;
258
259   return chk;
260 }
261
262 bool HexagonMCChecker::checkSlots()
263
264 {
265   unsigned slotsUsed = 0;
266   for (auto HMI: HexagonMCInstrInfo::bundleInstructions(MCBDX)) {
267     MCInst const& MCI = *HMI.getInst();
268     if (HexagonMCInstrInfo::isImmext(MCI))
269       continue;
270     if (HexagonMCInstrInfo::isDuplex(MCII, MCI))
271       slotsUsed += 2;
272     else
273       ++slotsUsed;
274   }
275
276   if (slotsUsed > HEXAGON_PACKET_SIZE) {
277     HexagonMCErrInfo errInfo;
278     errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_NOSLOTS);
279     addErrInfo(errInfo);
280     return false;
281   }
282   return true;
283 }
284
285 // Check legal use of branches.
286 bool HexagonMCChecker::checkBranches() {
287   HexagonMCErrInfo errInfo;
288   if (HexagonMCInstrInfo::isBundle(MCB)) {
289     bool hasConditional = false;
290     unsigned Branches = 0,
291              Conditional = HEXAGON_PRESHUFFLE_PACKET_SIZE,
292              Unconditional = HEXAGON_PRESHUFFLE_PACKET_SIZE;
293
294     for (unsigned i = HexagonMCInstrInfo::bundleInstructionsOffset;
295          i < MCB.size(); ++i) {
296       MCInst const &MCI = *MCB.begin()[i].getInst();
297
298       if (HexagonMCInstrInfo::isImmext(MCI))
299         continue;
300       if (HexagonMCInstrInfo::getDesc(MCII, MCI).isBranch() ||
301           HexagonMCInstrInfo::getDesc(MCII, MCI).isCall()) {
302         ++Branches;
303         if (HexagonMCInstrInfo::isPredicated(MCII, MCI) ||
304             HexagonMCInstrInfo::isPredicatedNew(MCII, MCI)) {
305           hasConditional = true;
306           Conditional = i; // Record the position of the conditional branch.
307         } else {
308           Unconditional = i; // Record the position of the unconditional branch.
309         }
310       }
311     }
312
313     if (Branches) // FIXME: should "Defs.count(Hexagon::PC)" be here too?
314       if (HexagonMCInstrInfo::isInnerLoop(MCB) ||
315           HexagonMCInstrInfo::isOuterLoop(MCB)) {
316         // Error out if there's any branch in a loop-end packet.
317         errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_ENDLOOP, Hexagon::PC);
318         addErrInfo(errInfo);
319         return false;
320       }
321     if (Branches > 1)
322       if (!hasConditional || Conditional > Unconditional) {
323         // Error out if more than one unconditional branch or
324         // the conditional branch appears after the unconditional one.
325         errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_BRANCHES);
326         addErrInfo(errInfo);
327         return false;
328       }
329   }
330
331   return true;
332 }
333
334 // Check legal use of predicate registers.
335 bool HexagonMCChecker::checkPredicates() {
336   HexagonMCErrInfo errInfo;
337   // Check for proper use of new predicate registers.
338   for (const auto& I : NewPreds) {
339     unsigned P = I;
340
341     if (!Defs.count(P) || LatePreds.count(P)) {
342       // Error out if the new predicate register is not defined,
343       // or defined "late"
344       // (e.g., "{ if (p3.new)... ; p3 = sp1loop0(#r7:2, Rs) }").
345       errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_NEWP, P);
346       addErrInfo(errInfo);
347       return false;
348     }
349   }
350
351   // Check for proper use of auto-anded of predicate registers.
352   for (const auto& I : LatePreds) {
353     unsigned P = I;
354
355     if (LatePreds.count(P) > 1 || Defs.count(P)) {
356       // Error out if predicate register defined "late" multiple times or
357       // defined late and regularly defined
358       // (e.g., "{ p3 = sp1loop0(...); p3 = cmp.eq(...) }".
359       errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_REGISTERS, P);
360       addErrInfo(errInfo);
361       return false;
362     }
363   }
364
365   return true;
366 }
367
368 // Check legal use of new values.
369 bool HexagonMCChecker::checkNewValues() {
370   HexagonMCErrInfo errInfo;
371   memset(&errInfo, 0, sizeof(errInfo));
372   for (auto& I : NewUses) {
373     unsigned R = I.first;
374     NewSense &US = I.second;
375
376     if (!hasValidNewValueDef(US, NewDefs[R])) {
377       errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_NEWV, R);
378       addErrInfo(errInfo);
379       return false;
380     }
381   }
382
383   return true;
384 }
385
386 // Check for legal register uses and definitions.
387 bool HexagonMCChecker::checkRegisters() {
388   HexagonMCErrInfo errInfo;
389   // Check for proper register definitions.
390   for (const auto& I : Defs) {
391     unsigned R = I.first;
392
393     if (ReadOnly.count(R)) {
394       // Error out for definitions of read-only registers.
395       errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_READONLY, R);
396       addErrInfo(errInfo);
397       return false;
398     }
399     if (isLoopRegister(R) && Defs.count(R) > 1 &&
400         (HexagonMCInstrInfo::isInnerLoop(MCB) ||
401          HexagonMCInstrInfo::isOuterLoop(MCB))) {
402       // Error out for definitions of loop registers at the end of a loop.
403       errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_LOOP, R);
404       addErrInfo(errInfo);
405       return false;
406     }
407     if (SoftDefs.count(R)) {
408       // Error out for explicit changes to registers also weakly defined
409       // (e.g., "{ usr = r0; r0 = sfadd(...) }").
410       unsigned UsrR = Hexagon::USR; // Silence warning about mixed types in ?:.
411       unsigned BadR = RI.isSubRegister(Hexagon::USR, R) ? UsrR : R;
412       errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_REGISTERS, BadR);
413       addErrInfo(errInfo);
414       return false;
415     }
416     if (!isPredicateRegister(R) && Defs[R].size() > 1) {
417       // Check for multiple register definitions.
418       PredSet &PM = Defs[R];
419
420       // Check for multiple unconditional register definitions.
421       if (PM.count(Unconditional)) {
422         // Error out on an unconditional change when there are any other
423         // changes, conditional or not.
424         unsigned UsrR = Hexagon::USR;
425         unsigned BadR = RI.isSubRegister(Hexagon::USR, R) ? UsrR : R;
426         errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_REGISTERS, BadR);
427         addErrInfo(errInfo);
428         return false;
429       }
430       // Check for multiple conditional register definitions.
431       for (const auto& J : PM) {
432         PredSense P = J;
433
434         // Check for multiple uses of the same condition.
435         if (PM.count(P) > 1) {
436           // Error out on conditional changes based on the same predicate
437           // (e.g., "{ if (!p0) r0 =...; if (!p0) r0 =... }").
438           errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_REGISTERS, R);
439           addErrInfo(errInfo);
440           return false;
441         }
442         // Check for the use of the complementary condition.
443         P.second = !P.second;
444         if (PM.count(P) && PM.size() > 2) {
445           // Error out on conditional changes based on the same predicate
446           // multiple times
447           // (e.g., "{ if (p0) r0 =...; if (!p0) r0 =... }; if (!p0) r0 =... }").
448           errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_REGISTERS, R);
449           addErrInfo(errInfo);
450           return false;
451         }
452       }
453     }
454   }
455
456   // Check for use of current definitions.
457   for (const auto& I : CurDefs) {
458     unsigned R = I;
459
460     if (!Uses.count(R)) {
461       // Warn on an unused current definition.
462       errInfo.setWarning(HexagonMCErrInfo::CHECK_WARN_CURRENT, R);
463       addErrInfo(errInfo);
464       return true;
465     }
466   }
467
468   // Check for use of temporary definitions.
469   for (const auto& I : TmpDefs) {
470     unsigned R = I;
471
472     if (!Uses.count(R)) {
473       // special case for vhist
474       bool vHistFound = false;
475       for (auto const&HMI : HexagonMCInstrInfo::bundleInstructions(MCB)) {
476         if(llvm::HexagonMCInstrInfo::getType(MCII, *HMI.getInst()) == HexagonII::TypeCVI_HIST) {
477           vHistFound = true;  // vhist() implicitly uses ALL REGxx.tmp
478           break;
479         }
480       }
481       // Warn on an unused temporary definition.
482       if (vHistFound == false) {
483         errInfo.setWarning(HexagonMCErrInfo::CHECK_WARN_TEMPORARY, R);
484         addErrInfo(errInfo);
485         return true;
486       }
487     }
488   }
489
490   return true;
491 }
492
493 // Check for legal use of solo insns.
494 bool HexagonMCChecker::checkSolo() {
495   HexagonMCErrInfo errInfo;
496   if (HexagonMCInstrInfo::isBundle(MCB) &&
497       HexagonMCInstrInfo::bundleSize(MCB) > 1) {
498     for (auto const&I : HexagonMCInstrInfo::bundleInstructions(MCB)) {
499       if (llvm::HexagonMCInstrInfo::isSolo(MCII, *I.getInst())) {
500         errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_SOLO);
501         addErrInfo(errInfo);
502         return false;
503       }
504     }
505   }
506
507   return true;
508 }
509
510 bool HexagonMCChecker::checkShuffle() {
511   HexagonMCErrInfo errInfo;
512   // Branch info is lost when duplexing. The unduplexed insns must be
513   // checked and only branch errors matter for this case.
514   HexagonMCShuffler MCS(true, MCII, STI, MCB);
515   if (!MCS.check()) {
516     if (MCS.getError() == HexagonShuffler::SHUFFLE_ERROR_BRANCHES) {
517       errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_SHUFFLE);
518       errInfo.setShuffleError(MCS.getError());
519       addErrInfo(errInfo);
520       return false;
521     }
522   }
523   HexagonMCShuffler MCSDX(true, MCII, STI, MCBDX);
524   if (!MCSDX.check()) {
525     errInfo.setError(HexagonMCErrInfo::CHECK_ERROR_SHUFFLE);
526     errInfo.setShuffleError(MCSDX.getError());
527     addErrInfo(errInfo);
528     return false;
529   }
530   return true;
531 }
532
533 void HexagonMCChecker::compoundRegisterMap(unsigned& Register) {
534   switch (Register) {
535   default:
536     break;
537   case Hexagon::R15:
538     Register = Hexagon::R23;
539     break;
540   case Hexagon::R14:
541     Register = Hexagon::R22;
542     break;
543   case Hexagon::R13:
544     Register = Hexagon::R21;
545     break;
546   case Hexagon::R12:
547     Register = Hexagon::R20;
548     break;
549   case Hexagon::R11:
550     Register = Hexagon::R19;
551     break;
552   case Hexagon::R10:
553     Register = Hexagon::R18;
554     break;
555   case Hexagon::R9:
556     Register = Hexagon::R17;
557     break;
558   case Hexagon::R8:
559     Register = Hexagon::R16;
560     break;
561   }
562 }
563
564 bool HexagonMCChecker::hasValidNewValueDef(const NewSense &Use,
565       const NewSenseList &Defs) const {
566   bool Strict = !RelaxNVChecks;
567
568   for (unsigned i = 0, n = Defs.size(); i < n; ++i) {
569     const NewSense &Def = Defs[i];
570     // NVJ cannot use a new FP value [7.6.1]
571     if (Use.IsNVJ && (Def.IsFloat || Def.PredReg != 0))
572       continue;
573     // If the definition was not predicated, then it does not matter if
574     // the use is.
575     if (Def.PredReg == 0)
576       return true;
577     // With the strict checks, both the definition and the use must be
578     // predicated on the same register and condition.
579     if (Strict) {
580       if (Def.PredReg == Use.PredReg && Def.Cond == Use.Cond)
581         return true;
582     } else {
583       // With the relaxed checks, if the definition was predicated, the only
584       // detectable violation is if the use is predicated on the opposing
585       // condition, otherwise, it's ok.
586       if (Def.PredReg != Use.PredReg || Def.Cond == Use.Cond)
587         return true;
588     }
589   }
590   return false;
591 }
592