Skip to content

Commit

Permalink
Revert "[AMDGPU] Split entry basic block after alloca instructions."
Browse files Browse the repository at this point in the history
This reverts commit 98f4713.

Without any (theoretical/practical) guarantee that all the allocas within
*entry* basic block are clustered together at the beginning of the block,
this patch is doomed to fail. Hence reverting it.
  • Loading branch information
hs-mahesha committed Sep 10, 2021
1 parent 09d0fa3 commit 0c28814
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 74 deletions.
17 changes: 4 additions & 13 deletions llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp
Expand Up @@ -191,19 +191,10 @@ class ReplaceLDSUseImpl {
if (!BasicBlockEntry.second)
return BasicBlockEntry.first->second;

// Split entry basic block of kernel K just after alloca.
//
// Find the split point just after alloca.
auto &EBB = K->getEntryBlock();
auto *EI = &(*(EBB.getFirstInsertionPt()));
BasicBlock::reverse_iterator RIT(EBB.getTerminator());
while (!isa<AllocaInst>(*RIT) && (&*RIT != EI))
++RIT;
if (isa<AllocaInst>(*RIT))
--RIT;

// Split entry basic block.
IRBuilder<> Builder(&*RIT);
// Split entry basic block of kernel K.
auto *EI = &(*(K->getEntryBlock().getFirstInsertionPt()));
IRBuilder<> Builder(EI);

Value *Mbcnt =
Builder.CreateIntrinsic(Intrinsic::amdgcn_mbcnt_lo, {},
{Builder.getInt32(-1), Builder.getInt32(0)});
Expand Down

This file was deleted.

0 comments on commit 0c28814

Please sign in to comment.