Skip to content

Commit

Permalink
[OMPIRBuilder] Remove unused functions (NFC) (#156)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
skatrak committed Sep 10, 2024
1 parent 72c3078 commit fdfa0a1
Showing 1 changed file with 0 additions and 32 deletions.
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

0 comments on commit fdfa0a1

Please sign in to comment.