[PATCH] D153093: [MBP] Enable duplicating return block to remove jump to return

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 18:34:58 PDT 2023


Carrot created this revision.
Carrot added a reviewer: davidxl.
Herald added subscribers: dmgreen, hiraditya.
Herald added a project: All.
Carrot requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Sometimes LLVM generates branch to return instruction, like PR63227.

It is because in function MachineBlockPlacement::canTailDuplicateUnplacedPreds we avoid duplicating a BB into another already placed BB to prevent destroying computed layout. But if the successor BB is a return block, duplicating it will only reduce taken branches without hurt to any other branches.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153093

Files:
  llvm/lib/CodeGen/MachineBlockPlacement.cpp
  llvm/test/CodeGen/AArch64/aarch64-matrix-umull-smull.ll
  llvm/test/CodeGen/Thumb/branch-to-return.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/mve-float-loops.ll
  llvm/test/CodeGen/Thumb2/mve-vecreduce-loops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153093.531962.patch
Type: text/x-patch
Size: 11513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230616/8b39ae84/attachment.bin>


More information about the llvm-commits mailing list