From e65b219edbf5d18ed235dc8a5919580f71d2327b Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Wed, 17 Jul 2013 19:52:25 +0000 Subject: [PATCH] Add a micro optimization to catch cases where the PtrA equals PtrB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186531 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 8a1c5b7bca9..78f7783328d 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -980,7 +980,7 @@ bool BoUpSLP::isConsecutiveAccess(Value *A, Value *B) { return false; // Check that A and B are of the same type. - if (PtrA->getType() != PtrB->getType()) + if (PtrA == PtrB || PtrA->getType() != PtrB->getType()) return false; // Calculate a constant offset from the base pointer without using SCEV