Displaying 5 results from an estimated 5 matches for "deletedeadblock".
2018 Jun 29
2
Cleaning up ‘br i1 false’ cases in CodeGenPrepare
...the same
> > in the final assembly code/executable.
> >
> > In CodeGenPrepare::runOnFunction, ConstantFoldTerminator (which
> > handles the br i1 false condition) is called only once and if after
> > the transformation of code by ConstantFoldTerminator() and
> > DeleteDeadBlock() we end up with code like "br i1 false", there is no
> > further opportunity to clean them up. So calling this code under
> > (!DisableBranchOpts) in a loop until no more transformations are made
> > fixes this issue. Is this reasonable ?
>
> I would expect the pr...
2018 Jun 29
2
Cleaning up ‘br i1 false’ cases in CodeGenPrepare
...onditions preserved and this propagates further and remains the same
in the final assembly code/executable.
In CodeGenPrepare::runOnFunction, ConstantFoldTerminator (which
handles the br i1 false condition) is called only once and if after
the transformation of code by ConstantFoldTerminator() and
DeleteDeadBlock() we end up with code like "br i1 false", there is no
further opportunity to clean them up. So calling this code under
(!DisableBranchOpts) in a loop until no more transformations are made
fixes this issue. Is this reasonable ?
My simple fix (without any indentation changes) is:
--- a/l...
2011 Oct 06
1
[LLVMdev] replacing a global variable by a constant
I would delete the Loop. I used the following code.
cout << "begin to delete loop" << endl;
for (Loop::block_iterator bi = L->block_begin(), bi2; bi !=
L->block_end(); bi = bi2) {
bi2 = bi;
bi2++;
BasicBlock * BB = *bi;
for (BasicBlock::iterator ii = BB->begin(), ii2; ii != BB->end();
ii= ii2) {
ii2 = ii;
2013 Sep 18
1
[LLVMdev] In llvm, how can I delete a whole branch elegantly?
Hi,
I am trying to prune some uninteresting llvm ir branches, corresponding
to the *if-else* condition in the source code. And here is the procedures:
1. Get the BasicBlock containing the BranchInst which has 2
successors(in order to keep consistent with the source code I am using the
llvm ir without any optimizations, so SelectInst/SwitchInst/PHINode is
absent), one of which should be
2011 Oct 06
0
[LLVMdev] MIPS 32bit code generation
...y still branch to it. Also, the
basic block itself may be used by blockaddress constants. Probably rather
than deleting the basic block it is easier to insert an unreachable instruction
in it and let the standard optimizers delete it.
> }
That said, the simplest thing to do is to use the DeleteDeadBlock routine. It
will take care of deleting the instructions in the basic block for you, and
will also delete the basic block itself. All you have to do is ensure that
the predecessors of the basic block go somewhere else first, which you would
have to arrange in any case.
Even easier is to simply ma...