GP-3840 Adjustment to FlowBlock::restrictedByConditional

This commit is contained in:
caheckman 2023-09-13 20:38:46 +00:00
parent c072972153
commit 0a23876e01
21 changed files with 147 additions and 34 deletions

View file

@ -407,9 +407,15 @@ bool FlowBlock::restrictedByConditional(const FlowBlock *cond) const
{
if (sizeIn() == 1) return true; // Its impossible for any path to come through sibling to this
if (getImmedDom() != cond) return false; // This is not dominated by conditional block at all
bool seenCond = false;
for(int4 i=0;i<sizeIn();++i) {
const FlowBlock *inBlock = getIn(i);
if (inBlock == cond) continue; // The unique edge from cond to this
if (inBlock == cond) {
if (seenCond)
return false; // Coming in from cond block on multiple direct edges
seenCond = true;
continue;
}
while(inBlock != this) {
if (inBlock == cond) return false; // Must have come through sibling
inBlock = inBlock->getImmedDom();