[PATCH] D141487: [LoopUnroll] Directly update DT instead of DTU.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 05:44:09 PST 2023


fhahn created this revision.
fhahn added reviewers: nikic, reames, mkazantsev, asbirlea.
Herald added subscribers: StephenFan, zzheng, hiraditya.
Herald added a project: All.
fhahn requested review of this revision.
Herald added a project: LLVM.

The scope of DT updates are very limited when unrolling loops: the DT
should only need updating for

- new blocks added
- exiting blocks we simplified branches

This can be done manually without too much extra work.
MergeBlockIntoPredecessor and changeToUnreachable also need to be
updated to support direct DT updates.

This fixes excessive time spent in DTU for same cases. In an internal
example, time spent in LoopUnroll with this patch goes from ~200s to 2s.

It also is slightly positive for CTMark:

- NewPM-O3: -0.13%
- NewPM-ReleaseThinLTO: -0.11%
- NewPM-ReleaseLTO-g: -0.13%

Notable improvements are mafft (~ -0.50%) and lencod (~ -0.30%), with no
workload regressed.

https://llvm-compile-time-tracker.com/compare.php?from=78a9ee7834331fb4360457cc565fa36f5452f7e0&to=687e08d011b0dc6d3edd223612761e44225c7537&stat=instructions:u


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141487

Files:
  llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/lib/Transforms/Utils/LoopUnroll.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141487.488178.patch
Type: text/x-patch
Size: 7804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230111/c8b381d5/attachment.bin>


More information about the llvm-commits mailing list