[PATCH] D52345: [PowerPC] optimize conditional branch on CRSET/CRUNSET
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 26 02:36:20 PDT 2018
nemanjai accepted this revision.
nemanjai added a comment.
LGTM.
================
Comment at: lib/Target/PowerPC/PPCPreEmitPeephole.cpp:109
+ auto RemoveMBB = [](MachineBasicBlock *MBB) {
+ for (auto Succ: MBB->successors())
+ MBB->removeSuccessor(Succ);
----------------
inouehrs wrote:
> inouehrs wrote:
> > nemanjai wrote:
> > > Any one of these successors now might have become unreachable, right? Should this just be a static recursive function?
> > > Seems that it would be nice if we could just run a pass that eliminates unreachable blocks after this pass.
> > As long as I tested, I have never seen an unreachable block caused by this optimization. So I feel it is not warth paying too much cost for this.
> > How about commiting this patch without unreachable block elimination and investigate last unreachable block elimination opportunity (not limited to those caused by this optimization) as a separate patch?
> @nemanjai What do you think on this approach?
I think this is valuable information - in practice, this doesn't cause unreachable blocks very often (if ever). Let's leave it as is then, I am in favour of your approach.
https://reviews.llvm.org/D52345
More information about the llvm-commits
mailing list