From 84e6f1dd704a15eeb6d4ca189af60d7b28c3f994 Mon Sep 17 00:00:00 2001 From: Lawrence Hu Date: Fri, 19 Feb 2016 02:17:07 +0000 Subject: Bug fix: use dyn_cast_or_null instead of dyn_cast Differential Revision: http://reviews.llvm.org/D17154 llvm-svn: 261299 --- llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp index bf32e103e89..f94aa9e3e7f 100644 --- a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp +++ b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp @@ -824,8 +824,8 @@ void SeparateConstOffsetFromGEP::lowerToSingleIndexGEPs( // If we created a GEP with constant index, and the base is loop invariant, // then we swap the first one with it, so LICM can move constant GEP out // later. - GetElementPtrInst *FirstGEP = dyn_cast(FirstResult); - GetElementPtrInst *SecondGEP = dyn_cast(ResultPtr); + GetElementPtrInst *FirstGEP = dyn_cast_or_null(FirstResult); + GetElementPtrInst *SecondGEP = dyn_cast_or_null(ResultPtr); if (isSwapCandidate && isLegalToSwapOperand(FirstGEP, SecondGEP, L)) swapGEPOperand(FirstGEP, SecondGEP); -- cgit v1.2.3