Skip to content

Commit 5f0b817

Browse files
committed
Remove unintended code for WSLoop
1 parent 604456e commit 5f0b817

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4063,24 +4063,10 @@ getKmpcForStaticLoopForType(Type *Ty, OpenMPIRBuilder *OMPBuilder,
40634063
static void createTargetLoopWorkshareCall(
40644064
OpenMPIRBuilder *OMPBuilder, WorksharingLoopType LoopType,
40654065
BasicBlock *InsertBlock, Value *Ident, Value *LoopBodyArg,
4066-
Type *ParallelTaskPtr, Value *TripCountOrig, Function &LoopBodyFn) {
4066+
Type *ParallelTaskPtr, Value *TripCount, Function &LoopBodyFn) {
4067+
Type *TripCountTy = TripCount->getType();
40674068
Module &M = OMPBuilder->M;
40684069
IRBuilder<> &Builder = OMPBuilder->Builder;
4069-
Value *TripCount = TripCountOrig;
4070-
// FIXME(JAN): The trip count is 1 larger than it should be for GPU, this may
4071-
// not be the right way to fix it, but this works for now.
4072-
if (OMPBuilder->Config.isGPU()) {
4073-
if (LoopType != WorksharingLoopType::DistributeStaticLoop)
4074-
Builder.restoreIP({InsertBlock, std::prev(InsertBlock->end())});
4075-
LLVMContext &Ctx = M.getContext();
4076-
Type *IVTy = TripCountOrig->getType();
4077-
Type *InternalIVTy = IVTy->getIntegerBitWidth() <= 32
4078-
? Type::getInt32Ty(Ctx)
4079-
: Type::getInt64Ty(Ctx);
4080-
Constant *One = ConstantInt::get(InternalIVTy, 1);
4081-
TripCount = Builder.CreateSub(TripCountOrig, One, "modified_trip_count");
4082-
}
4083-
Type *TripCountTy = TripCount->getType();
40844070
FunctionCallee RTLFn =
40854071
getKmpcForStaticLoopForType(TripCountTy, OMPBuilder, LoopType);
40864072
SmallVector<Value *, 8> RealArgs;

0 commit comments

Comments
 (0)