[PATCH] D86025: [CodeGen] Respect libfunc availability when lowering intrinsic memcpy

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 15 14:36:58 PDT 2020


mstorsjo created this revision.
mstorsjo added reviewers: aemerson, efriedma, bogner.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: LLVM.
mstorsjo requested review of this revision.

If the memcpy libfunc is marked as not being available (e.g. via the -fno-builtin flag), we shouldn't lower intrinsic memcpy into an actual memcpy function call.

The same should probably be done for other intrinsics (that can be spontaneously generated by e.g. clang without the functions being explicitly mentioned) that can end up lowered into a function call, but this is the one I've run into in practice.

Adding a test for this that runs on AArch64, as the patch requires separate changes to all of SelectionDAG, FastISel and GlobalISel.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86025

Files:
  llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
  llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
  llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/test/CodeGen/AArch64/intrinsic-memcpy-nobuiltin.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86025.285861.patch
Type: text/x-patch
Size: 4848 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200815/fdb3decb/attachment.bin>


More information about the llvm-commits mailing list