From 8705ed9c4a2d97720ec53bfc09f1feb7b31b08a3 Mon Sep 17 00:00:00 2001 From: Sergio Afonso Date: Fri, 6 Sep 2024 14:45:17 +0100 Subject: [PATCH] [OMPIRBuilder] Remove unused functions This patch removes some internal functions from the OMPIRBuilder that are not used and do not exist upstream. They seem to have been left behind after some merge or improvements to reductions support made them redundant. --- llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 32 ----------------------- 1 file changed, 32 deletions(-) diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp index 3652ef8ab947e3..bdb0326435d569 100644 --- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp +++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp @@ -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 = @@ -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(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(User)) - if (auto *ConstExpr = dyn_cast(Const)) - replaceConstatExprUsesInFuncWithInstr(ConstExpr, Func); -} - static Function *createOutlinedFunction( OpenMPIRBuilder &OMPBuilder, IRBuilderBase &Builder, bool IsSPMD, const OpenMPIRBuilder::TargetKernelDefaultBounds &DefaultBounds,