diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-04-21 21:28:33 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-04-21 21:28:33 +0000 |
commit | 9692e30e8b75816b3a966d991ea9eb1e9518292c (patch) | |
tree | d99b15f4b538448bf74df0a3e175df3499ac895c /lldb/scripts/Python | |
parent | 499bc5faa1426965520676413c6a5d8c0b37e886 (diff) | |
download | bcm5719-llvm-9692e30e8b75816b3a966d991ea9eb1e9518292c.tar.gz bcm5719-llvm-9692e30e8b75816b3a966d991ea9eb1e9518292c.zip |
[MemCpyOpt] Use the raw i8* dest when optimizing memset+memcpy.
MemIntrinsic::getDest() looks through pointer casts, and using it
directly when building the new GEP+memset results in stuff like:
%0 = getelementptr i64* %p, i32 16
%1 = bitcast i64* %0 to i8*
call ..memset(i8* %1, ...)
instead of the correct:
%0 = bitcast i64* %p to i8*
%1 = getelementptr i8* %0, i32 16
call ..memset(i8* %1, ...)
Instead, use getRawDest, which just gives you the i8* value.
While there, use the memcpy's dest, as it's live anyway.
In most cases, when the optimization triggers, the memset and memcpy
sizes are the same, so the built memset is 0-sized and eliminated.
The problem occurs when they're different.
Fixes a regression caused by r235232: PR23300.
llvm-svn: 235419
Diffstat (limited to 'lldb/scripts/Python')
0 files changed, 0 insertions, 0 deletions