Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OMPIRBuilder] NFC: Remove unused functions #156

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,6 @@ static bool isValidWorkshareLoopScheduleType(OMPScheduleType SchedType) {
}
#endif

Function *GLOBAL_ReductionFunc = nullptr;

static uint64_t getTypeSizeInBytes(Module &M, Type *Type) {
return divideCeil(M.getDataLayout().getTypeSizeInBits(Type), 8);
}

static Value *getTypeSizeInBytesValue(IRBuilder<> &Builder, Module &M,
Type *Type) {
return Builder.getInt64(getTypeSizeInBytes(M, Type));
}

static const omp::GV &getGridValue(const Triple &T, Function *Kernel) {
if (T.isAMDGPU()) {
StringRef Features =
Expand Down Expand Up @@ -6692,27 +6681,6 @@ emitExecutionMode(OpenMPIRBuilder &OMPBuilder, IRBuilderBase &Builder,
LLVMCompilerUsed.emplace_back(GVMode);
}

static void replaceConstatExprUsesInFuncWithInstr(ConstantExpr *ConstExpr,
Function *Func) {
for (User *User : make_early_inc_range(ConstExpr->users())) {
if (auto *Instr = dyn_cast<Instruction>(User)) {
if (Instr->getFunction() == Func) {
Instruction *ConstInst = ConstExpr->getAsInstruction();
ConstInst->insertBefore(*Instr->getParent(), Instr->getIterator());
Instr->replaceUsesOfWith(ConstExpr, ConstInst);
}
}
}
}

static void replaceConstantValueUsesInFuncWithInstr(llvm::Value *Input,
Function *Func) {
for (User *User : make_early_inc_range(Input->users()))
if (auto *Const = dyn_cast<Constant>(User))
if (auto *ConstExpr = dyn_cast<ConstantExpr>(Const))
replaceConstatExprUsesInFuncWithInstr(ConstExpr, Func);
}

static Function *createOutlinedFunction(
OpenMPIRBuilder &OMPBuilder, IRBuilderBase &Builder, bool IsSPMD,
const OpenMPIRBuilder::TargetKernelDefaultBounds &DefaultBounds,
Expand Down