LLVM  6.0.0svn
Macros | Typedefs | Enumerations | Functions
CoroFrame.cpp File Reference
#include "CoroInternal.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/circular_raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
Include dependency graph for CoroFrame.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "coro-suspend-crossing"
 
#define DEBUG_TYPE   "coro-frame"
 

Typedefs

using SpillInfo = SmallVector< Spill, 8 >
 

Enumerations

enum  { SmallVectorThreshold = 32 }
 

Functions

static void dump (StringRef Title, SpillInfo const &Spills)
 
static StructTypebuildFrameType (Function &F, coro::Shape &Shape, SpillInfo &Spills)
 
static InstructionsplitBeforeCatchSwitch (CatchSwitchInst *CatchSwitch)
 
static InstructioninsertSpills (SpillInfo &Spills, coro::Shape &Shape)
 
static void setUnwindEdgeTo (TerminatorInst *TI, BasicBlock *Succ)
 
static void updatePhiNodes (BasicBlock *DestBB, BasicBlock *OldPred, BasicBlock *NewPred, PHINode *LandingPadReplacement)
 
static BasicBlockehAwareSplitEdge (BasicBlock *BB, BasicBlock *Succ, LandingPadInst *OriginalPad, PHINode *LandingPadReplacement)
 
static void rewritePHIs (BasicBlock &BB)
 
static void rewritePHIs (Function &F)
 
static bool materializable (Instruction &V)
 
static bool isCoroutineStructureIntrinsic (Instruction &I)
 
static void rewriteMaterializableInstructions (IRBuilder<> &IRB, SpillInfo const &Spills)
 
static void moveSpillUsesAfterCoroBegin (Function &F, SpillInfo const &Spills, CoroBeginInst *CoroBegin)
 
static BasicBlocksplitBlockIfNotFirst (Instruction *I, const Twine &Name)
 
static void splitAround (Instruction *I, const Twine &Name)
 

Macro Definition Documentation

◆ DEBUG_TYPE [1/2]

#define DEBUG_TYPE   "coro-suspend-crossing"

Definition at line 259 of file CoroFrame.cpp.

◆ DEBUG_TYPE [2/2]

#define DEBUG_TYPE   "coro-frame"

Definition at line 259 of file CoroFrame.cpp.

Typedef Documentation

◆ SpillInfo

using SpillInfo = SmallVector<Spill, 8>

Definition at line 280 of file CoroFrame.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SmallVectorThreshold 

Definition at line 38 of file CoroFrame.cpp.

Function Documentation

◆ buildFrameType()

static StructType* buildFrameType ( Function F,
coro::Shape Shape,
SpillInfo Spills 
)
static

◆ dump()

static void dump ( StringRef  Title,
SpillInfo const Spills 
)
static

◆ ehAwareSplitEdge()

static BasicBlock* ehAwareSplitEdge ( BasicBlock BB,
BasicBlock Succ,
LandingPadInst OriginalPad,
PHINode LandingPadReplacement 
)
static

◆ insertSpills()

static Instruction* insertSpills ( SpillInfo Spills,
coro::Shape Shape 
)
static

◆ isCoroutineStructureIntrinsic()

static bool isCoroutineStructureIntrinsic ( Instruction I)
static

Definition at line 673 of file CoroFrame.cpp.

References I.

Referenced by llvm::coro::buildCoroutineFrame().

◆ materializable()

static bool materializable ( Instruction V)
static

Definition at line 666 of file CoroFrame.cpp.

Referenced by llvm::coro::buildCoroutineFrame().

◆ moveSpillUsesAfterCoroBegin()

static void moveSpillUsesAfterCoroBegin ( Function F,
SpillInfo const Spills,
CoroBeginInst CoroBegin 
)
static

◆ rewriteMaterializableInstructions()

static void rewriteMaterializableInstructions ( IRBuilder<> &  IRB,
SpillInfo const Spills 
)
static

◆ rewritePHIs() [1/2]

static void rewritePHIs ( BasicBlock BB)
static

◆ rewritePHIs() [2/2]

static void rewritePHIs ( Function F)
static

◆ setUnwindEdgeTo()

static void setUnwindEdgeTo ( TerminatorInst TI,
BasicBlock Succ 
)
static

Definition at line 521 of file CoroFrame.cpp.

References llvm_unreachable.

Referenced by ehAwareSplitEdge().

◆ splitAround()

static void splitAround ( Instruction I,
const Twine Name 
)
static

◆ splitBeforeCatchSwitch()

static Instruction* splitBeforeCatchSwitch ( CatchSwitchInst CatchSwitch)
static

◆ splitBlockIfNotFirst()

static BasicBlock* splitBlockIfNotFirst ( Instruction I,
const Twine Name 
)
static

Definition at line 764 of file CoroFrame.cpp.

References llvm::Instruction::getParent(), I, and llvm::Value::setName().

Referenced by splitAround().

◆ updatePhiNodes()

static void updatePhiNodes ( BasicBlock DestBB,
BasicBlock OldPred,
BasicBlock NewPred,
PHINode LandingPadReplacement 
)
static