dominates: Determine whether an Instruction dominates another...

dominatesR Documentation

Determine whether an Instruction dominates another Instruction or BasicBlock

Description

These methods determine dominance in the sense of whether an instruction will always be evaluated before another (or BasicBlock-class) regardless of the path through the Function.

If one is querying several instructions in a given Function-class, it can be best to compute the DominatorTree once and use that as the first argument in each of the calls to dominates. This avoids recomputing it each time.

Usage

dominates(x, y, z, ...)
postDominates(x, y, ...)

Arguments

x, y, z

one can either specify the Instruction and the Instruction and BasicBlock, or pass the (Post)DominatorTree as the first argument and then the Instruction and Instruction/BasicBlock.

...

arguments for methods. Currently ignored for the DominatorTree functions

Author(s)

DTL

Examples

f = system.file("IR/loop.ir", package = "Rllvm")
m = parseIR(f)
stripDebugInfo(m)

b = getBlocks(m$loop)
dominates(b[[1]], b[[2]])

dominates(b[[1]][[1]], b[[2]])
dominates(b[[3]], b[[2]])

dtree = DominatorTree(m$loop)
dominates(dtree, b[[1]], b[[2]])

duncantl/Rllvm documentation built on April 23, 2024, 6:14 p.m.