From 670df3d937a632dd4ddf3092d23789ba79c7efa8 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Wed, 2 Apr 2014 14:39:02 +0000 Subject: SLPVectorizer: compare entire intrinsic for SLP compatibility. Some Intrinsics are overloaded to the extent that return type equality (all that's been checked up to now) does not guarantee that the arguments are the same. In these cases SLP vectorizer should not recurse into the operands, which can be achieved by comparing them as "Function *" rather than simply the ID. llvm-svn: 205424 --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (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 f6b5b122742..ee322279df3 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -955,11 +955,11 @@ void BoUpSLP::buildTree_rec(ArrayRef VL, unsigned Depth) { return; } - Intrinsic::ID ID = II->getIntrinsicID(); + Function *Int = II->getCalledFunction(); for (unsigned i = 1, e = VL.size(); i != e; ++i) { IntrinsicInst *II2 = dyn_cast(VL[i]); - if (!II2 || II2->getIntrinsicID() != ID) { + if (!II2 || II2->getCalledFunction() != Int) { newTreeEntry(VL, false); DEBUG(dbgs() << "SLP: mismatched calls:" << *II << "!=" << *VL[i] << "\n"); -- cgit v1.2.3