Move null checks to bvector utility callers
It's generally ok to encounter basic blocks with no interesting
dataflow info, but better to skip in the callers of the utilities
than in the utilities themselves (to make it explicit).
Change-Id: I27b2c774381d4315d51436527ddf0378e5c05d32
diff --git a/src/compiler/SSATransformation.cc b/src/compiler/SSATransformation.cc
index dea1971..1a488bb 100644
--- a/src/compiler/SSATransformation.cc
+++ b/src/compiler/SSATransformation.cc
@@ -247,7 +247,9 @@
BasicBlock* predBB = (BasicBlock* ) oatGrowableListGetElement(
blockList, predIdx);
/* tempBlockV = tempBlockV ^ dominators */
- oatIntersectBitVectors(tempBlockV, tempBlockV, predBB->dominators);
+ if (predBB->dominators != NULL) {
+ oatIntersectBitVectors(tempBlockV, tempBlockV, predBB->dominators);
+ }
}
oatSetBit(tempBlockV, bb->id);
if (oatCompareBitVectors(tempBlockV, bb->dominators)) {
@@ -452,7 +454,9 @@
(BasicBlock* ) oatGrowableListGetElement(blockList, idx);
/* Merge the dominance frontier to tmpBlocks */
- oatUnifyBitVectors(tmpBlocks, tmpBlocks, defBB->domFrontier);
+ if (defBB->domFrontier != NULL) {
+ oatUnifyBitVectors(tmpBlocks, tmpBlocks, defBB->domFrontier);
+ }
}
if (oatCompareBitVectors(phiBlocks, tmpBlocks)) {
change = true;