Displaying 3 results from an estimated 3 matches for "deletedeadcod".
Did you mean:
deletedeadcode
2018 May 24
0
LLVM Pass To Remove Dead Code In A Basic Block
> On 25 May 2018, at 01:46, Aaron via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Hi all,
>
> LLVM optimization pass gives an error "Terminator found in the middle of a basic block!" since basic block IR may have multiple "ret" instructions. It seems LLVM does not accept multiple return in a basic block by default.
>
Yes, if you’re inserting
2018 May 24
2
LLVM Pass To Remove Dead Code In A Basic Block
Hi all,
LLVM optimization pass gives an error "Terminator found in the middle of a
basic block!" since basic block IR may have multiple "ret" instructions. It
seems LLVM does not accept multiple return in a basic block by default.
Is there a specific optimization or pass that I can enable to remove
unreachable codes in basic blocks?
Best,
Aaron
-------------- next part
2018 May 24
2
LLVM Pass To Remove Dead Code In A Basic Block
...n creation lines.
>> Just curious, how are you getting return instructions in the middle of a
basic block?
My code generation pass allows multiple return instruction generation since
that simplifies front-end significantly.
Here is the code if anyone would like to use it:
void CodeGenPass::DeleteDeadCode(llvm::BasicBlock * basicBlock)
{
for (auto it = basicBlock->begin(); it != basicBlock->end(); ++it)
{
// Split after first return instruction.
if (it->getOpcode() == llvm::Instruction::Ret)
{
++it;
// Split only if there is a followi...