Construct SSA form, materializing a value that is live in the middle of the specified block.

Synopsis

Declared in <llvm/Transforms/Utils/SSAUpdater.h>

Value*
GetValueInMiddleOfBlock(BasicBlock* BB);

Description

GetValueInMiddleOfBlock is the same as GetValueAtEndOfBlock except in one important case: if there is a definition of the rewritten value after the 'use' in BB. Consider code like this:

   X1 = ...
SomeBB:
   use(X)
   X2 = ...
   br Cond, SomeBB, OutBB

In this case, there are two values (X1 and X2) added to the AvailableVals set by the client of the rewriter, and those values are both live out of their respective blocks. However, the use of X happens in the middle of a block. Because of this, we need to insert a new PHI node in SomeBB to merge the appropriate values, and this value isn't live out of the block.

Return Value

The value live in the middle of BB.

Parameters

Name

Description

BB

Block in whose middle the live value is materialized.

Created with MrDocs