@@ -406,44 +406,38 @@ enum BasicBlockFlags : unsigned __int64
406
406
407
407
BBF_RETLESS_CALL = MAKE_BBFLAG (24 ), // BBJ_CALLFINALLY that will never return (and therefore, won't need a paired
408
408
// BBJ_CALLFINALLYRET); see isBBCallFinallyPair().
409
- BBF_LOOP_PREHEADER = MAKE_BBFLAG (25 ), // BB is a loop preheader block
410
- BBF_COLD = MAKE_BBFLAG (26 ), // BB is cold
411
- BBF_PROF_WEIGHT = MAKE_BBFLAG (27 ), // BB weight is computed from profile data
412
- BBF_KEEP_BBJ_ALWAYS = MAKE_BBFLAG (28 ), // A special BBJ_ALWAYS block, used by EH code generation. Keep the jump kind
409
+ BBF_COLD = MAKE_BBFLAG (25 ), // BB is cold
410
+ BBF_PROF_WEIGHT = MAKE_BBFLAG (26 ), // BB weight is computed from profile data
411
+ BBF_KEEP_BBJ_ALWAYS = MAKE_BBFLAG (27 ), // A special BBJ_ALWAYS block, used by EH code generation. Keep the jump kind
413
412
// as BBJ_ALWAYS. Used on x86 for the final step block out of a finally.
414
- BBF_HAS_CALL = MAKE_BBFLAG (29 ), // BB contains a call
415
- BBF_DOMINATED_BY_EXCEPTIONAL_ENTRY = MAKE_BBFLAG (30 ), // Block is dominated by exceptional entry.
416
- BBF_BACKWARD_JUMP = MAKE_BBFLAG (31 ), // BB is surrounded by a backward jump/switch arc
417
- BBF_BACKWARD_JUMP_SOURCE = MAKE_BBFLAG (32 ), // Block is a source of a backward jump
418
- BBF_BACKWARD_JUMP_TARGET = MAKE_BBFLAG (33 ), // Block is a target of a backward jump
419
- BBF_PATCHPOINT = MAKE_BBFLAG (34 ), // Block is a patchpoint
420
- BBF_PARTIAL_COMPILATION_PATCHPOINT = MAKE_BBFLAG (35 ), // Block is a partial compilation patchpoint
421
- BBF_HAS_HISTOGRAM_PROFILE = MAKE_BBFLAG (36 ), // BB contains a call needing a histogram profile
422
- BBF_TAILCALL_SUCCESSOR = MAKE_BBFLAG (37 ), // BB has pred that has potential tail call
423
- BBF_RECURSIVE_TAILCALL = MAKE_BBFLAG (38 ), // Block has recursive tailcall that may turn into a loop
424
- BBF_NO_CSE_IN = MAKE_BBFLAG (39 ), // Block should kill off any incoming CSE
425
- BBF_CAN_ADD_PRED = MAKE_BBFLAG (40 ), // Ok to add pred edge to this block, even when "safe" edge creation disabled
426
- BBF_NONE_QUIRK = MAKE_BBFLAG (41 ), // Block was created as a BBJ_ALWAYS to the next block,
413
+ BBF_HAS_CALL = MAKE_BBFLAG (28 ), // BB contains a call
414
+ BBF_DOMINATED_BY_EXCEPTIONAL_ENTRY = MAKE_BBFLAG (29 ), // Block is dominated by exceptional entry.
415
+ BBF_BACKWARD_JUMP = MAKE_BBFLAG (30 ), // BB is surrounded by a backward jump/switch arc
416
+ BBF_BACKWARD_JUMP_SOURCE = MAKE_BBFLAG (31 ), // Block is a source of a backward jump
417
+ BBF_BACKWARD_JUMP_TARGET = MAKE_BBFLAG (32 ), // Block is a target of a backward jump
418
+ BBF_PATCHPOINT = MAKE_BBFLAG (33 ), // Block is a patchpoint
419
+ BBF_PARTIAL_COMPILATION_PATCHPOINT = MAKE_BBFLAG (34 ), // Block is a partial compilation patchpoint
420
+ BBF_HAS_HISTOGRAM_PROFILE = MAKE_BBFLAG (35 ), // BB contains a call needing a histogram profile
421
+ BBF_TAILCALL_SUCCESSOR = MAKE_BBFLAG (36 ), // BB has pred that has potential tail call
422
+ BBF_RECURSIVE_TAILCALL = MAKE_BBFLAG (37 ), // Block has recursive tailcall that may turn into a loop
423
+ BBF_NO_CSE_IN = MAKE_BBFLAG (38 ), // Block should kill off any incoming CSE
424
+ BBF_CAN_ADD_PRED = MAKE_BBFLAG (39 ), // Ok to add pred edge to this block, even when "safe" edge creation disabled
425
+ BBF_NONE_QUIRK = MAKE_BBFLAG (40 ), // Block was created as a BBJ_ALWAYS to the next block,
427
426
// and should be treated as if it falls through.
428
427
// This is just to reduce diffs from removing BBJ_NONE.
429
428
// (TODO: Remove this quirk after refactoring Compiler::fgFindInsertPoint)
430
- BBF_OLD_LOOP_HEADER_QUIRK = MAKE_BBFLAG (42 ), // Block was the header ('entry') of a loop recognized by old loop finding
431
- BBF_HAS_VALUE_PROFILE = MAKE_BBFLAG (43 ), // Block has a node that needs a value probing
429
+ BBF_HAS_VALUE_PROFILE = MAKE_BBFLAG (41 ), // Block has a node that needs a value probing
432
430
433
431
// The following are sets of flags.
434
432
435
- // Flags that relate blocks to loop structure.
436
-
437
- BBF_LOOP_FLAGS = BBF_LOOP_PREHEADER | BBF_LOOP_HEAD | BBF_LOOP_ALIGN,
438
-
439
433
// Flags to update when two blocks are compacted
440
434
441
435
BBF_COMPACT_UPD = BBF_GC_SAFE_POINT | BBF_NEEDS_GCPOLL | BBF_HAS_JMP | BBF_HAS_IDX_LEN | BBF_HAS_MD_IDX_LEN | BBF_BACKWARD_JUMP | \
442
- BBF_HAS_NEWOBJ | BBF_HAS_NULLCHECK | BBF_HAS_MDARRAYREF | BBF_LOOP_PREHEADER | BBF_OLD_LOOP_HEADER_QUIRK ,
436
+ BBF_HAS_NEWOBJ | BBF_HAS_NULLCHECK | BBF_HAS_MDARRAYREF,
443
437
444
438
// Flags a block should not have had before it is split.
445
439
446
- BBF_SPLIT_NONEXIST = BBF_LOOP_HEAD | BBF_RETLESS_CALL | BBF_LOOP_PREHEADER | BBF_COLD,
440
+ BBF_SPLIT_NONEXIST = BBF_LOOP_HEAD | BBF_RETLESS_CALL | BBF_COLD,
447
441
448
442
// Flags lost by the top block when a block is split.
449
443
// Note, this is a conservative guess.
@@ -616,7 +610,7 @@ struct BasicBlock : private LIR::Range
616
610
617
611
bool CanRemoveJumpToNext (Compiler* compiler) const ;
618
612
619
- bool CanRemoveJumpToFalseTarget ( Compiler* compiler) const ;
613
+ bool CanRemoveJumpToTarget (BasicBlock* target, Compiler* compiler) const ;
620
614
621
615
unsigned GetTargetOffs () const
622
616
{
@@ -669,19 +663,13 @@ struct BasicBlock : private LIR::Range
669
663
{
670
664
assert (KindIs (BBJ_COND));
671
665
assert (bbTrueTarget != nullptr );
672
- assert (target != nullptr );
673
666
return (bbTrueTarget == target);
674
667
}
675
668
676
669
BasicBlock* GetFalseTarget () const
677
670
{
678
671
assert (KindIs (BBJ_COND));
679
-
680
- // So long as bbFalseTarget tracks bbNext in SetNext(), it is possible for bbFalseTarget to be null
681
- // if this block is unlinked from the block list.
682
- // So check bbNext before triggering the assert if bbFalseTarget is null.
683
- // TODO-NoFallThrough: Remove IsLast() check once bbFalseTarget isn't hard-coded to bbNext
684
- assert ((bbFalseTarget != nullptr ) || IsLast ());
672
+ assert (bbFalseTarget != nullptr );
685
673
return bbFalseTarget;
686
674
}
687
675
@@ -696,15 +684,12 @@ struct BasicBlock : private LIR::Range
696
684
{
697
685
assert (KindIs (BBJ_COND));
698
686
assert (bbFalseTarget != nullptr );
699
- assert (target != nullptr );
700
687
return (bbFalseTarget == target);
701
688
}
702
689
703
690
void SetCond (BasicBlock* trueTarget, BasicBlock* falseTarget)
704
691
{
705
692
assert (trueTarget != nullptr );
706
- // TODO-NoFallThrough: Allow falseTarget to diverge from bbNext
707
- assert (falseTarget == bbNext);
708
693
bbKind = BBJ_COND;
709
694
bbTrueTarget = trueTarget;
710
695
bbFalseTarget = falseTarget;
0 commit comments