HomePhabricator

Fix missing memcpy, memmove and memset tail calls

Authored by sanwou01 on Oct 31 2019, 7:55 AM.

Description

Fix missing memcpy, memmove and memset tail calls

Summary:
If a wrapper around one of the mem* stdlib functions bitcasts the returned
pointer value before returning it (e.g. to a wchar_t*), LLVM does not emit a
tail call.

Add a check for this scenario so that we emit a tail call.

Reviewers: wmi, mkuper, ramred01, dmgreen

Reviewed By: wmi, dmgreen

Subscribers: hiraditya, sanwou01, javed.absar, lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59078

Details

Committed
sanwou01Oct 31 2019, 9:13 AM
Reviewer
wmi
Differential Revision
D59078: Fix missing memcpy, memmove and memset tail calls
Parents
rG27cb352fd276: [llvm-objcopy] --add-symbol: address post-commit reviews of D69093
Branches
Unknown
Tags
Unknown