[PATCH] D147020: [AA] Add a tbaa-fence intrinsic.

David Goldblatt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 10:32:48 PDT 2023


davidtgoldblatt created this revision.
Herald added subscribers: jeroen.dobbelaere, kosarev, hiraditya.
Herald added a project: All.
davidtgoldblatt updated this revision to Diff 509068.
davidtgoldblatt edited the summary of this revision.
davidtgoldblatt added a comment.
davidtgoldblatt edited the summary of this revision.
davidtgoldblatt added a reviewer: rsmith.
davidtgoldblatt added a reviewer: nikic.
Herald added a subscriber: StephenFan.
davidtgoldblatt published this revision for review.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

Reword.


This can be used to opt out of TBAA for particular pointers without
breaking out the big hammer of `asm volatile("" : : "r"(ptr) : "memory")`.
The underlying motivation is to allow the implementation of C++23's
start_lifetime_as.

We name this a TBAA-fence instead of something more generic to make it
clear that other alias analyses are allowed to see through the fence.
Additionally, the intrinsic returns a "safe-to-use" pointer rather than
a semantic guarantee of being a completely opaque ArgMemOnly intrinsic.
This enables some optimization opportunities: it lets us track uses more
precisely, so we could (e.g.) strip TBAA metadata from associated loads
and stores to enable store-to-load forwarding where beneficial. More
immediately, we don't need the stronger guarantees for
start_lifetime_as, so there's no reason to provide it out of the gate.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147020

Files:
  llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
  llvm/include/llvm/IR/Intrinsics.td
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/CodeGen/IntrinsicLowering.cpp
  llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/test/Analysis/TypeBasedAliasAnalysis/tbaa-fence.ll
  llvm/test/CodeGen/Generic/tbaa-fence.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147020.509068.patch
Type: text/x-patch
Size: 4778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230328/f8be44d2/attachment.bin>


More information about the llvm-commits mailing list