[PATCH] D95142: [SLC] Simplify strcpy and friends with non-zero address spaces

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 08:09:30 PST 2021


arichardson created this revision.
arichardson added reviewers: efriedma, xbolva00, ab, arsenm.
Herald added subscribers: hiraditya, tpr.
arichardson requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

The current logic in TargetLibraryInfoImpl::getLibFunc() was only treating
strcpy, etc. in address space zero as a valid library function. However,
in the CHERI and Morello targets we expect all libc functions to use
address space 200 arguments.
This commit updates isValidProtoForLibFunc() to check for i8* in the
default globals address space.

TODO: I'm not sure if this is too restrictive for AMDGPU? If so I can also
allow i8* in any address space.

Depends on D95138 <https://reviews.llvm.org/D95138>
Depends on D95137 <https://reviews.llvm.org/D95137>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95142

Files:
  llvm/lib/Analysis/TargetLibraryInfo.cpp
  llvm/test/Transforms/InstCombine/strcpy-nonzero-as.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95142.318216.patch
Type: text/x-patch
Size: 5804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210121/8e57f743/attachment.bin>


More information about the llvm-commits mailing list