[PATCH] D136164: [MemorySSA] Use BatchAA for clobber walker

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 06:07:20 PDT 2022


nikic created this revision.
nikic added reviewers: asbirlea, fhahn.
Herald added subscribers: kosarev, foad, kerbowa, george.burgess.iv, hiraditya, jvesely, arsenm.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

While MemorySSA use optimization was already using BatchAA, the publicly exposed MSSA walkers were using plain AAResults. This is not great, because it is expected that clobber walking will make repeated AA queries.

This patch makes the clobber API accept a BatchAAResults instance. To make this patch "obviously correct" I have adjusted most callers to create the BatchAAResults instance close to the clobber call, to avoid questions around invalidation. In some of these cases, it should be safe to push BatchAA further up the call chain -- e.g. for NewGVN I think we should be able to use a single BatchAA instance for all queries.

This patch is not strictly NFC, e.g. the BatchAA used by DSE supports more powerful analysis than plain AA (thanks to EarliestEscapeInfo).

Compile-time results: http://llvm-compile-time-tracker.com/compare.php?from=e162a73e41402feab4b3870cc7074f053099da64&to=51ddd63a9136d4cf161d91c8e38364ccded5fc05&stat=instructions Impact is minor on average, but with some large outliers (e.g. -2.5% on trump3d-v4 ThinLTO).


https://reviews.llvm.org/D136164

Files:
  llvm/include/llvm/Analysis/MemorySSA.h
  llvm/lib/Analysis/MemorySSA.cpp
  llvm/lib/Target/AMDGPU/Utils/AMDGPUMemoryUtils.cpp
  llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
  llvm/lib/Transforms/Scalar/EarlyCSE.cpp
  llvm/lib/Transforms/Scalar/LICM.cpp
  llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
  llvm/lib/Transforms/Scalar/NewGVN.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136164.468506.patch
Type: text/x-patch
Size: 36936 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221018/07397329/attachment.bin>


More information about the llvm-commits mailing list