[PATCH] D29153: [BranchFolding] Tail common all identical unreachable blocks

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 09:55:17 PST 2017

rengolin added inline comments.

Comment at: lib/CodeGen/BranchFolding.cpp:521
+static bool blockEndsInUnreachable(const MachineBasicBlock *MBB) {
+  return MBB->succ_empty() && !MBB->isReturnBlock();
iteratee wrote:
> rnk wrote:
> > iteratee wrote:
> > > Unforturnately there are platforms where this isn't sufficient. I believe ARM is one of them.
> > For all the ARM examples I constructed, isReturnBlock appeared to be accurate.
> OK, I have data.
> isReturnBlock is currently insufficient for Thumb (That's why I thought ARM), Hexagon, Mips and XCore.
> Arguably, this should go in anyway and those platforms should be fixed.
> Funnily enough, this could cause switching away from Thumb to reduce code size.
Can you be more specific for "insufficient"?

What's the risk/cost? If they're too big, than "fixing it later" might not be a good idea.

Also, who's fixing it?


More information about the llvm-commits mailing list