Go to file
Ahmed Bougacha 1ac9356524 [SimplifyLibCalls] Don't confuse strcpy_chk for stpcpy_chk.
This was introduced in a faulty refactoring (r225640, mea culpa):
the tests weren't testing the return values, so, for both
__strcpy_chk and __stpcpy_chk, we would return the end of the
buffer (matching stpcpy) instead of the beginning (for strcpy).

The root cause was the prefix "__" being ignored when comparing,
which made us always pick LibFunc::stpcpy_chk.
Pass the LibFunc::Func directly to avoid this kind of error.
Also, make the testcases as explicit as possible to prevent this.

The now-useful testcases expose another, entangled, stpcpy problem,
with the further simplification.  This was introduced in a
refactoring (r225640) to match the original behavior.

However, this leads to problems when successive simplifications
generate several similar instructions, none of which are removed
by the custom replaceAllUsesWith.

For instance, InstCombine (the main user) doesn't erase the
instruction in its custom RAUW.  When trying to simplify say
__stpcpy_chk:
- first, an stpcpy is created (fortified simplifier),
- second, a memcpy is created (normal simplifier), but the
  stpcpy call isn't removed.
- third, InstCombine later revisits the instructions,
  and simplifies the first stpcpy to a memcpy.  We now have
  two memcpys.

llvm-svn: 227250
2015-01-27 21:52:16 +00:00
clang Implement the remaining portion of DR1467 from r227022. I may have overlooked a few things, but this implementation comes straight from the DR resolution itself. 2015-01-27 18:47:05 +00:00
clang-tools-extra [clang-tidy] Use shrink_to_fit instead of copy and swap trick 2015-01-23 15:10:37 +00:00
compiler-rt tsan: properly instrument unaligned accesses 2015-01-27 20:19:12 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Use amdgcn triple for SI+ GPUs 2015-01-06 20:42:12 +00:00
libcxx Fix linking pthread in tests on FreeBSD 2015-01-27 20:43:53 +00:00
libcxxabi Adopt CMake policy CMP0042. Set MACOSX_RPATH on by default. 2015-01-26 22:00:30 +00:00
lld [Mips] Remove unused function argument 2015-01-27 21:11:16 +00:00
lldb Fix copy paste error in file header. 2015-01-27 18:40:25 +00:00
llgo Introduce llgoi, a REPL for Go 2015-01-15 04:13:29 +00:00
llvm [SimplifyLibCalls] Don't confuse strcpy_chk for stpcpy_chk. 2015-01-27 21:52:16 +00:00
openmp Comments only: removing the Revision and Date svn variables from the top of all the source files. 2015-01-27 17:13:53 +00:00
polly [FIX] Debug build + instrinsic handling 2015-01-26 15:55:54 +00:00