From 7330e358f6b5c696fe58a63671e64dc81d92dee8 Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Mon, 2 Feb 2015 12:45:34 +0000 Subject: Fix: SLPVectorizer crashes with assertion when vectorizing a cmp instruction. The commit r225977 uncovered this bug. The problem was that the vectorizer tried to read the second operand of an already deleted instruction. The bug didn't show up before r225977 because the freed memory still contained a non-null pointer. With r225977 deletion of instructions is delayed and the read operand pointer is always null. llvm-svn: 227800 --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp') diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 08af1daf9bb..d1a843828c3 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -3943,6 +3943,7 @@ bool SLPVectorizer::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) { // and the iterator may become invalid value. it = BB->begin(); e = BB->end(); + break; } } } -- cgit v1.2.3