File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed
IGC/VectorCompiler/lib/GenXCodeGen Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -1767,14 +1767,20 @@ unsigned LiveRange::getLength(bool WithWeak) const {
17671767 */
17681768void LiveRange::print (raw_ostream &OS) const
17691769{
1770+ if (Values.empty ()) {
1771+ OS << " Empty LR" ;
1772+ return ;
1773+ }
1774+
17701775 auto vi = Values.begin (), ve = Values.end ();
1771- IGC_ASSERT (vi != ve) ;
1772- for (;;) {
1776+ bool AllNamesPrinted = false ;
1777+ do {
17731778 vi->printName (OS);
1774- if (++vi == ve)
1775- break ;
1776- OS << " ," ;
1777- }
1779+ AllNamesPrinted = (++vi == ve);
1780+ if (!AllNamesPrinted)
1781+ OS << " ," ;
1782+ } while (!AllNamesPrinted);
1783+
17781784 OS << " :" ;
17791785 printSegments (OS);
17801786 const char *Cat = " ???" ;
@@ -1805,6 +1811,7 @@ void LiveRange::printSegments(raw_ostream &OS) const
18051811 switch (ri->Strength ) {
18061812 case Segment::WEAK: OS << " w" ; break ;
18071813 case Segment::PHICPY: OS << " ph" ; break ;
1814+ case Segment::STRONG: /* do nothing */ break ;
18081815 }
18091816 OS << ri->getStart () << " ," << ri->getEnd () << " )" ;
18101817 }
Original file line number Diff line number Diff line change @@ -295,15 +295,15 @@ class AssertingSV {
295295// Segment : a single range of instruction numbers in which a value is
296296// live
297297struct Segment {
298- enum { WEAK, PHICPY, STRONG };
299- unsigned Strength : 2 ; // whether it is a weak or phicpy or strong segment
298+ enum SegmentType : unsigned char { WEAK, PHICPY, STRONG };
299+ SegmentType Strength;
300300
301301private:
302- unsigned Start : 30 ; // inclusive start of range
303- unsigned End : 30 ; // exclusive end of range
302+ unsigned Start;
303+ unsigned End;
304304public:
305305 Segment () : Strength(STRONG), Start(0 ), End(0 ) {}
306- Segment (unsigned S, unsigned E, unsigned Strength = STRONG)
306+ Segment (unsigned S, unsigned E, SegmentType Strength = STRONG)
307307 : Strength(Strength) {
308308 IGC_ASSERT (E >= S);
309309 Start = S;
You can’t perform that action at this time.
0 commit comments