[PATCH] PR 16899: Update iterator when SLP vectorizer changes the instructions in the basic block

Yi Jiang yjiang at apple.com
Mon Aug 19 16:53:05 PDT 2013


Hi, 

Please help to review the patch for PR16899. The reason of crash is that the instructions in the BB could be erased in the loop body and the iterator value is invalid. Thank Joerg for submitting a workaround on this in r188605. While  basically in this patch we would like to update iterator "it" and "e" and start over going though the basic block every time we find that the BB changed, in this case we may find more potential opportunities without invalidate the iterators. To avoid redundant check, We also create a SmallSet to record the instructions we have visited and make sure we do not check them twice.  Also the test case is included. Please see the patch for details and any comments are appreciated. Thank you. 

Files:
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/X86/pr16899.ll

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130819/e18e46f1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr16899.patch
Type: application/octet-stream
Size: 4411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130819/e18e46f1/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130819/e18e46f1/attachment-0001.html>


More information about the llvm-commits mailing list