[PATCH] D127884: [Draft][LangRef] Document `elementtype` attribute requirement on atomic memory intrinsics.

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 08:16:57 PDT 2023


anna commandeered this revision.
anna added a reviewer: dantrushin.
anna added a comment.

Thanks @dantrushin for the patch. We have now had nasty miscompiles in practice (lowering memory intrinsics to regular loops and miss adding barriers for GC) and would like to make progress with this patch.

As a first step, we plan to document in the LangRef that functions having `GCStrategy` specified needs to have `elementtype` attribute set for the src and dest arguments for the atomic intrinsics. Also, introducing the API to record the elementtype (https://reviews.llvm.org/D125690). 
The next step would be to have the verification rule for this and to teach passes/utilities about this: LoopIdiomRecognize and LowerMemIntrinsics.cpp (utility API for atomic mem intrinsics).

Once both of these have baked in, we can then remove the `elementsize` argument altogether from the atomic mem intrinsics since they can be inferred from the `elementtype` and remove the `GCStrategy` requirement as well. This also allows non-GC users of atomic memory intrinsics enough time to react to the change.

This perhaps deserves an RFC on the mailing list.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127884/new/

https://reviews.llvm.org/D127884



More information about the llvm-commits mailing list