Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT: Add explicit successor for BBJ_COND false branch #95773

Merged
merged 34 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7075361
Introduce bbNormalJumpDest
amanasifkhalid Dec 7, 2023
edcd975
Replace Next() with GetNormalJumpDest()
amanasifkhalid Dec 7, 2023
bdc886d
Replace NextIs() with HasNormalJumpTo()
amanasifkhalid Dec 7, 2023
4c71330
Style
amanasifkhalid Dec 7, 2023
bdcf9ea
Update TODO comments
amanasifkhalid Dec 8, 2023
4e94533
Style
amanasifkhalid Dec 8, 2023
3855094
Add comment explaining assert
amanasifkhalid Dec 8, 2023
f630b5d
Rename bbNormalJumpDest to bbFalseTarget
amanasifkhalid Dec 8, 2023
5be6ed2
Rename bbJumpDest to bbTarget
amanasifkhalid Dec 8, 2023
a286d86
Rename SetJumpKindAndTarget variants
amanasifkhalid Dec 8, 2023
9ff966b
Rename bbJumpKind
amanasifkhalid Dec 8, 2023
e632217
Rename bbJumpOffs
amanasifkhalid Dec 8, 2023
dcf7ce9
Rename bbJumpSwt
amanasifkhalid Dec 8, 2023
07ff2dd
Rename bbJumpEhf
amanasifkhalid Dec 8, 2023
e2ab378
Rename HasJumpTo
amanasifkhalid Dec 8, 2023
92139e3
Rename method args, dspJumpKind
amanasifkhalid Dec 8, 2023
6802c17
Introduce getters/setters/checkers for bbTrueTarget
amanasifkhalid Dec 8, 2023
2bddac2
Replace GetTarget with GetTrueTarget for BBJ_COND
amanasifkhalid Dec 8, 2023
32174ab
Replace SetTarget with SetTrueTarget for BBJ_COND
amanasifkhalid Dec 8, 2023
5cbd2c4
Replace TargetIs with TrueTargetIs for BBJ_COND
amanasifkhalid Dec 8, 2023
69cbbc7
Style
amanasifkhalid Dec 8, 2023
a35bd40
Fix comment
amanasifkhalid Dec 8, 2023
f45a824
Fix bbNext/bbTarget access for BBJ_COND in BBSuccList
amanasifkhalid Dec 8, 2023
2e5fc28
Split out SetSwtKindAndTarget and SetEhfKindAndTarget
amanasifkhalid Dec 9, 2023
a8f3ffd
Add SetCondKindAndTarget
amanasifkhalid Dec 9, 2023
b1de3c6
Rename to SetCond
amanasifkhalid Dec 9, 2023
a038073
Rename to SetSwitch
amanasifkhalid Dec 9, 2023
3625c39
Rename to SetEhf
amanasifkhalid Dec 9, 2023
fbd3943
Rename to GetSwitchTarget (for consistency)
amanasifkhalid Dec 9, 2023
ed0b149
Rename GetSwitchTarget > GetSwitchTargets
amanasifkhalid Dec 11, 2023
7f1fbb7
Rename GetEhfTarget > GetEhfTargets
amanasifkhalid Dec 11, 2023
e453580
Rename bbSwtTarget > bbSwtTargets
amanasifkhalid Dec 11, 2023
c78e766
Rename bbEhfTarget/SetEhfTarget
amanasifkhalid Dec 11, 2023
f445e29
Add asserts
amanasifkhalid Dec 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5550,15 +5550,15 @@ class AssertionPropFlowCallback
{
ASSERT_TP pAssertionOut;

if (predBlock->KindIs(BBJ_COND) && predBlock->HasJumpTo(block))
if (predBlock->KindIs(BBJ_COND) && predBlock->TrueTargetIs(block))
{
pAssertionOut = mJumpDestOut[predBlock->bbNum];

if (dupCount > 1)
{
// Scenario where next block and conditional block, both point to the same block.
// In such case, intersect the assertions present on both the out edges of predBlock.
assert(predBlock->NextIs(block));
assert(predBlock->FalseTargetIs(block));
BitVecOps::IntersectionD(apTraits, pAssertionOut, predBlock->bbAssertionOut);

if (VerboseDataflow())
Expand Down Expand Up @@ -5728,7 +5728,7 @@ ASSERT_TP* Compiler::optComputeAssertionGen()

if (jumpDestAssertionIndex != NO_ASSERTION_INDEX)
{
// Update jumpDestValueGen if we have an assertion for the bbJumpDest edge
// Update jumpDestValueGen if we have an assertion for the bbTarget edge
optImpliedAssertions(jumpDestAssertionIndex, jumpDestValueGen);
BitVecOps::AddElemD(apTraits, jumpDestValueGen, jumpDestAssertionIndex - 1);
}
Expand All @@ -5755,7 +5755,7 @@ ASSERT_TP* Compiler::optComputeAssertionGen()
optPrintAssertionIndices(block->bbAssertionGen);
if (block->KindIs(BBJ_COND))
{
printf(" => " FMT_BB " valueGen = ", block->GetJumpDest()->bbNum);
printf(" => " FMT_BB " valueGen = ", block->GetTrueTarget()->bbNum);
optPrintAssertionIndices(jumpDestGen[block->bbNum]);
}
printf("\n");
Expand Down Expand Up @@ -6315,7 +6315,7 @@ PhaseStatus Compiler::optAssertionPropMain()
optDumpAssertionIndices(" out = ", block->bbAssertionOut, "\n");
if (block->KindIs(BBJ_COND))
{
printf(" " FMT_BB " = ", block->GetJumpDest()->bbNum);
printf(" " FMT_BB " = ", block->GetTrueTarget()->bbNum);
optDumpAssertionIndices(bbJtrueAssertionOut[block->bbNum], "\n");
}
}
Expand Down
Loading