BBVectorize: Fix an invalid reference bug
authorHal Finkel <hfinkel@anl.gov>
Sun, 17 Feb 2013 15:59:26 +0000 (15:59 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 17 Feb 2013 15:59:26 +0000 (15:59 +0000)
commitf79f136cc64b0625b77c7b9008ed8c5b848b6b17
treee1a2f9b55c4b4cd0c5f1766e0044090a4e0eab8f
parenta79cbb12324db93236e06cc820f0e36ea1f7e4c4
BBVectorize: Fix an invalid reference bug

This fixes PR15289. This bug was introduced (recently) in r175215; collecting
all std::vector references for candidate pairs to delete at once is invalid
because subsequent lookups in the owning DenseMap could invalidate the
references.

bugpoint was able to reduce a useful test case. Unfortunately, because whether
or not this asserts depends on memory layout, this test case will sometimes
appear to produce valid output. Nevertheless, running under valgrind will
reveal the error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175397 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/BBVectorize.cpp
test/Transforms/BBVectorize/X86/pr15289.ll [new file with mode: 0644]