[llvm-dev] Using TBAA type descriptor's name as hints for optimizations

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 30 21:07:29 PDT 2021


On Apr 28, 2021, at 9:11 AM, David Chisnall via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> Hi,
> 
> I think it's clear that using TBAA or anything else for *hinting* optimisation is fine.  The discussion in the review was rooted in two problems:
> 
> - In some cases the transform is not valid.  `memcpy` must be a type-oblivious copy.  On some platforms (e.g. CHERI, including Arm's Morello, and with some language VMs), turning these into a typed load-store is not valid.  We lose tracking of pointers in these environments.  It is *always* valid to delete metadata and an optimisation may not become unsound if metadata is elided.

Random comment, but sometimes clang or other frontends will *generate* a memcpy due to source language semantics (e.g. copying a large struct), not just as a result of a user writing a call to memcpy in C.  It seems useful to attach type metadata to these at least.

-Chris


More information about the llvm-dev mailing list