Skip to content

Commit

Permalink
resolve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jul 23, 2018
1 parent a1d105c commit 733f428
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
8 changes: 3 additions & 5 deletions lib/Transforms/Tapir/LoopSpawning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1428,13 +1428,11 @@ bool LoopSpawningImpl::processLoop(Loop *L) {
DEBUG(dbgs() << "LS: Hints dictate sequential spawning.\n");
break;
case LoopSpawningHints::ST_GPU:
DEBUG(dbgs() << "LS: Hints dictate DAC spawning.\n");
DEBUG(dbgs() << "LS: Hints dictate GPU spawning.\n");
{
DebugLoc DLoc = L->getStartLoc();
BasicBlock *Header = L->getHeader();
PTXABILoopSpawning DLS(L, SE, &LI, &DT, &AC, ORE);
// CilkABILoopSpawning DLS(L, SE, &LI, &DT, &AC, ORE);
// DACLoopSpawning DLS(L, SE, LI, DT, TLI, TTI, ORE);
if (DLS.processLoop()) {
DEBUG({
if (verifyFunction(*L->getHeader()->getParent())) {
Expand All @@ -1444,13 +1442,13 @@ bool LoopSpawningImpl::processLoop(Loop *L) {
});
// Report success.
ORE.emit(OptimizationRemark(LS_NAME, "DACSpawning", DLoc, Header)
<< "spawning iterations using divide-and-conquer");
<< "spawning iterations using direct gpu mapping");
return true;
} else {
// Report failure.
ORE.emit(OptimizationRemarkMissed(LS_NAME, "NoDACSpawning", DLoc,
Header)
<< "cannot spawn iterations using divide-and-conquer");
<< "cannot spawn iterations using direct gpu mapping");
emitMissedWarning(F, L, Hints, &ORE);
return false;
}
Expand Down
10 changes: 2 additions & 8 deletions lib/Transforms/Tapir/OpenMPABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,19 +488,15 @@ Function* formatFunctionToTask(Function* extracted, CallInst* cal) {
IRBuilder<> CallerIRBuilder(cal);
auto *SharedsTySize =
CallerIRBuilder.getInt64(DL.getTypeAllocSize(SharedsTy));
//unused -- auto *KmpTaskTTy = createKmpTaskTTy(C);
auto *KmpTaskTWithPrivatesTy = createKmpTaskTWithPrivatesTy(SharedsTy);//KmpTaskTTy);
auto *KmpTaskTWithPrivatesTy = createKmpTaskTWithPrivatesTy(SharedsTy);
auto *KmpTaskTWithPrivatesPtrTy =
PointerType::getUnqual(KmpTaskTWithPrivatesTy);
auto *KmpTaskTWithPrivatesTySize =
CallerIRBuilder.getInt64(DL.getTypeAllocSize(KmpTaskTWithPrivatesTy));

auto *VoidTy = Type::getVoidTy(C);
// unused -- auto *Int8PtrTy = Type::getInt8PtrTy(C);
auto *Int32Ty = Type::getInt32Ty(C);

// unused -- auto *CopyFnTy = FunctionType::get(VoidTy, {Int8PtrTy}, true);
// unused -- auto *CopyFnPtrTy = PointerType::getUnqual(CopyFnTy);

auto *OutlinedFnTy = FunctionType::get(
VoidTy,
Expand Down Expand Up @@ -593,12 +589,10 @@ Function *llvm::OpenMPABI::createDetach(DetachInst &detach,
ValueToValueMapTy &DetachCtxToStackFrame,
DominatorTree &DT, AssumptionCache &AC) {
BasicBlock *detB = detach.getParent();
// unused -- Function &F = *(detB->getParent());

BasicBlock *Spawned = detach.getDetached();
BasicBlock *Continue = detach.getContinue();

// unused -- Module *M = F.getParent();

CallInst *cal = nullptr;
Function *extracted = extractDetachBodyToFunction(detach, DT, AC, &cal);
Expand Down Expand Up @@ -803,7 +797,7 @@ void llvm::OpenMPABI::postProcessFunction(Function &F) {
OpenMPRuntimeFunction::OMPRTL__kmpc_fork_call, F.getParent());
// Replace the old call with __kmpc_fork_call
auto *ForkCall = emitRuntimeCall(ForkRTFn, OMPRegionFnArgs, "", b);
assert(ForkCall != 0); // play it safe -- something better to do here?
assert(ForkCall != 0 && "Failed to emit omp runtime call");

ExtractedFnCI->eraseFromParent();
RegionFn->eraseFromParent();
Expand Down

0 comments on commit 733f428

Please sign in to comment.