[PATCH] D119975: Revert "[PassManager] Run additional LICM before LoopRotate"

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 16 13:34:38 PST 2022


lebedev.ri created this revision.
lebedev.ri added reviewers: wsmoses, nikic, thopre, fhahn, asbirlea.
lebedev.ri added a project: LLVM.
Herald added subscribers: ormris, jeroen.dobbelaere, wenlei, kerbowa, steven_wu, zzheng, kosarev, hiraditya, jvesely.
lebedev.ri requested review of this revision.

A year ago, in D99249 <https://reviews.llvm.org/D99249>, an additional LICM run before LoopRotate was added.
Back then it was necessary to avoid some unfortunate PHI nodes.

As https://github.com/llvm/llvm-project/issues/53794 rightfully points out,
when hoisting, we must drop certain metadata that we can not
prove to be correct after hoisting, including TBAA.
That may negatively affect further optimizations.

It is unclear whether or not the original problem was mitigated
in the clang via finally annotating `this` pointer with `deref`/`align`
(D99790 <https://reviews.llvm.org/D99790>, 16d03818412415c56efcd482d18c0cbdf712524c <https://reviews.llvm.org/rG16d03818412415c56efcd482d18c0cbdf712524c>), but even if it was,
clang still does not annotate plain pointers with `align`.

But, apparently, some other improvements to other optimizations passes
have also solved the problem, because, as the diff shows, reverting D99249 <https://reviews.llvm.org/D99249>
does not resurface the original problem, since, clearly, the check lines
for the new-pm and `-O2`/`-O3` are not affected.

Thus, we can conclude that D99249 <https://reviews.llvm.org/D99249> is no longer needed.

This reverts commit a26f1bf67ec70f72e64101cf483b26466928fc38 <https://reviews.llvm.org/rGa26f1bf67ec70f72e64101cf483b26466928fc38>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119975

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp
  llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
  llvm/test/CodeGen/AMDGPU/opt-pipeline.ll
  llvm/test/Other/new-pm-defaults.ll
  llvm/test/Other/new-pm-thinlto-defaults.ll
  llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
  llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
  llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
  llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
  llvm/test/Transforms/IndVarSimplify/X86/pr45360.ll
  llvm/test/Transforms/LoopUnroll/AArch64/runtime-unroll-generic.ll
  llvm/test/Transforms/PhaseOrdering/X86/speculation-vs-tbaa.ll
  llvm/test/Transforms/PhaseOrdering/X86/spurious-peeling.ll
  llvm/test/Transforms/PhaseOrdering/loop-rotation-vs-common-code-hoisting.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119975.409384.patch
Type: text/x-patch
Size: 45877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220216/640aee60/attachment-0001.bin>


More information about the llvm-commits mailing list