aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/BinaryStreamReader.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-12-28 05:10:33 +0000
committerReid Kleckner <rnk@google.com>2017-12-28 05:10:33 +0000
commit6d31001cd638c7b72362388618369af576822691 (patch)
tree1f0d336c46b3e3a32b1a7c8dafc428c0427aad67 /llvm/lib/Support/BinaryStreamReader.cpp
parent4371e049d4b81177cf3ac0f62726a2d240f60a77 (diff)
downloadllvm-6d31001cd638c7b72362388618369af576822691.zip
llvm-6d31001cd638c7b72362388618369af576822691.tar.gz
llvm-6d31001cd638c7b72362388618369af576822691.tar.bz2
Revert "[memcpyopt] Teach memcpyopt to optimize across basic blocks"
This reverts r321138. It seems there are still underlying issues with memdep. PR35519 seems to still be present if debug info is enabled. We end up losing a memcpy. Somehow during store to memset merging, we insert the memset after the memcpy or fail to update the memdep analysis to account for the newly inserted memset of a pair. Reduced test case: #include <assert.h> #include <stdio.h> #include <string> #include <utility> #include <vector> void do_push_back( std::vector<std::pair<std::string, std::vector<std::string>>>* crls) { crls->push_back(std::make_pair(std::string(), std::vector<std::string>())); } int __attribute__((optnone)) main() { // Put some data in the vector and then remove it so we take the push_back // fast path. std::vector<std::pair<std::string, std::vector<std::string>>> crl_set; crl_set.push_back({"asdf", {}}); crl_set.pop_back(); printf("first word in vector storage: %p\n", *(void**)crl_set.data()); // Do the push_back which may fail to initialize the data. do_push_back(&crl_set); auto* first = &crl_set.back().first; printf("first word in vector storage (should be zero): %p\n", *(void**)crl_set.data()); assert(first->empty()); puts("ok"); } Compile with libc++, enable optimizations, and enable debug info: $ clang++ -stdlib=libc++ -g -O2 t.cpp -o t.exe -Wl,-rpath=llvm/build/lib This program will assert with this change. llvm-svn: 321510
Diffstat (limited to 'llvm/lib/Support/BinaryStreamReader.cpp')
0 files changed, 0 insertions, 0 deletions