Skip to content

Commit 5754331

Browse files
committed
sort before kbits
1 parent 56f19c1 commit 5754331

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/scala/ir/IRCursor.scala

+4-2
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,14 @@ def dotBlockGraph(blocks: Iterable[Block], orphaned: Set[Block]): String = {
318318

319319
def dotBlockGraph(program: Procedure, labels: Map[CFGPosition, String]): String = {
320320
val domain = computeDomain[CFGPosition, Block](IntraProcBlockIRCursor, program.blocks.toSet)
321-
toDot[Block](domain.toSet, IntraProcBlockIRCursor, labels, Set())
321+
val o = getDetachedBlocks(program).reachableFromBlockEmptyPred
322+
toDot[Block](domain.toSet, IntraProcBlockIRCursor, labels, o)
322323
}
323324

324325
def dotBlockGraph(program: Program, labels: Map[CFGPosition, String] = Map.empty): String = {
325326
val domain = computeDomain[CFGPosition, Block](IntraProcBlockIRCursor, program.procedures.flatMap(_.blocks).toSet)
326-
toDot[Block](domain.toSet, IntraProcBlockIRCursor, labels, Set())
327+
val e = program.procedures.toSet.flatMap(getDetachedBlocks(_).reachableFromBlockEmptyPred)
328+
toDot[Block](domain.toSet, IntraProcBlockIRCursor, labels, e)
327329
}
328330

329331
def toDot[T <: CFGPosition](

src/main/scala/util/RunUtils.scala

+1
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ object RunUtils {
843843

844844
doSimplify(ctx, conf.staticAnalysis)
845845

846+
transforms.applyRPO(ctx.program)
846847
val (kbb, kba) = transforms.knownBitsAnalysis(ctx.program)
847848
DebugDumpIRLogger.writeToFile(
848849
File("known-bits.il"),

0 commit comments

Comments
 (0)