#include "AMDGPU.h"
#include "AMDGPUTargetMachine.h"
#include "GCNSubtarget.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/UniformityAnalysis.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicsAMDGPU.h"
#include "llvm/InitializePasses.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
StackEntry;
StackVector;
class SIAnnotateControlFlow { … };
}
void SIAnnotateControlFlow::initialize(Module &M, const GCNSubtarget &ST) { … }
bool SIAnnotateControlFlow::isUniform(BranchInst *T) { … }
bool SIAnnotateControlFlow::isTopOfStack(BasicBlock *BB) { … }
Value *SIAnnotateControlFlow::popSaved() { … }
void SIAnnotateControlFlow::push(BasicBlock *BB, Value *Saved) { … }
bool SIAnnotateControlFlow::isElse(PHINode *Phi) { … }
bool SIAnnotateControlFlow::hasKill(const BasicBlock *BB) { … }
bool SIAnnotateControlFlow::eraseIfUnused(PHINode *Phi) { … }
bool SIAnnotateControlFlow::openIf(BranchInst *Term) { … }
bool SIAnnotateControlFlow::insertElse(BranchInst *Term) { … }
Value *SIAnnotateControlFlow::handleLoopCondition(
Value *Cond, PHINode *Broken, llvm::Loop *L, BranchInst *Term) { … }
bool SIAnnotateControlFlow::handleLoop(BranchInst *Term) { … }
bool SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) { … }
bool SIAnnotateControlFlow::run(Function &F) { … }
PreservedAnalyses SIAnnotateControlFlowPass::run(Function &F,
FunctionAnalysisManager &FAM) { … }
class SIAnnotateControlFlowLegacy : public FunctionPass { … };
INITIALIZE_PASS_BEGIN(SIAnnotateControlFlowLegacy, DEBUG_TYPE,
"Annotate SI Control Flow", false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(UniformityInfoWrapperPass)
INITIALIZE_PASS_DEPENDENCY(TargetPassConfig)
INITIALIZE_PASS_END(SIAnnotateControlFlowLegacy, DEBUG_TYPE,
"Annotate SI Control Flow", false, false)
char SIAnnotateControlFlowLegacy::ID = …;
FunctionPass *llvm::createSIAnnotateControlFlowLegacyPass() { … }