summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorLawrence Hu <lawrence@codeaurora.org>2016-02-19 02:17:07 +0000
committerLawrence Hu <lawrence@codeaurora.org>2016-02-19 02:17:07 +0000
commit84e6f1dd704a15eeb6d4ca189af60d7b28c3f994 (patch)
tree007cb4d5c666e933a86b39054b227eadcc3bb29d /llvm/lib/Transforms
parent9a5d3645b4922d65735ef1520df22b6b301666fd (diff)
downloadbcm5719-llvm-84e6f1dd704a15eeb6d4ca189af60d7b28c3f994.tar.gz
bcm5719-llvm-84e6f1dd704a15eeb6d4ca189af60d7b28c3f994.zip
Bug fix: use dyn_cast_or_null instead of dyn_cast
Differential Revision: http://reviews.llvm.org/D17154 llvm-svn: 261299
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp4
1 files changed, 2 insertions, 2 deletions
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<GetElementPtrInst>(FirstResult);
- GetElementPtrInst *SecondGEP = dyn_cast<GetElementPtrInst>(ResultPtr);
+ GetElementPtrInst *FirstGEP = dyn_cast_or_null<GetElementPtrInst>(FirstResult);
+ GetElementPtrInst *SecondGEP = dyn_cast_or_null<GetElementPtrInst>(ResultPtr);
if (isSwapCandidate && isLegalToSwapOperand(FirstGEP, SecondGEP, L))
swapGEPOperand(FirstGEP, SecondGEP);
OpenPOWER on IntegriCloud