CuPBoP/compilation/KernelTranslation/include/x86/tool.h

34 lines
1.5 KiB
C
Raw Normal View History

#ifndef __NVVM2x86_TOOL__
#define __NVVM2x86_TOOL__
2022-06-18 10:20:13 +08:00
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
llvm::Module *LoadModuleFromFilr(char *file_name);
void DumpModule(llvm::Module *M, char *file_name);
bool isKernelFunction(llvm::Module *M, llvm::Function *F);
void replace_block(llvm::Function *F, llvm::BasicBlock *before,
llvm::BasicBlock *after);
llvm::CallInst *CreateInterWarpBarrier(llvm::Instruction *InsertBefore);
llvm::CallInst *CreateIntraWarpBarrier(llvm::Instruction *InsertBefore);
void VerifyModule(llvm::Module *);
void phi2alloc(llvm::Module *M);
void remove_cuda_built_in(llvm::Module *M);
2022-05-04 20:59:38 +08:00
void replace_built_in_function(llvm::Module *M);
void replace_asm_call(llvm::Module *M);
bool find_block_barrier_in_region(llvm::BasicBlock *start,
llvm::BasicBlock *end);
bool find_barrier_in_region(llvm::BasicBlock *start, llvm::BasicBlock *end);
bool has_warp_barrier(llvm::BasicBlock *B);
bool has_barrier(llvm::BasicBlock *B);
bool has_block_barrier(llvm::BasicBlock *B);
bool has_barrier(llvm::Function *F);
2022-05-04 20:59:38 +08:00
void replace_dynamic_shared_memory(llvm::Module *M);
2022-06-18 10:20:13 +08:00
llvm::LoadInst *createLoad(llvm::IRBuilder<> &B, llvm::Value *addr,
bool isVolatile = false);
llvm::Value *createInBoundsGEP(llvm::IRBuilder<> &B, llvm::Value *ptr,
llvm::ArrayRef<llvm::Value *> idxlist);
llvm::Value *createGEP(llvm::IRBuilder<> &B, llvm::Value *ptr,
llvm::ArrayRef<llvm::Value *> idxlist);
#endif