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)
commit76e65e45425a63f8915a389a7a385cac3aae52bf
treec5f3b2c0458a9c1fa270b58f89d85b6b6188f660
parentdfe49e8c310b3c571ef80fe6f3399724a6ff5f24
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.

llvm-svn: 175397
llvm/lib/Transforms/Vectorize/BBVectorize.cpp
llvm/test/Transforms/BBVectorize/X86/pr15289.ll [new file with mode: 0644]