diff options
author | Hiroshi Inoue <inouehrs@jp.ibm.com> | 2017-10-16 12:11:15 +0000 |
---|---|---|
committer | Hiroshi Inoue <inouehrs@jp.ibm.com> | 2017-10-16 12:11:15 +0000 |
commit | a7eb78b47f4583ab0699827e7eb1d589892b5d30 (patch) | |
tree | c2769490767729a0ee755f6815d25b27515154c4 /llvm/lib | |
parent | bfc9061593307bf6b09106216445eacb1c5215d1 (diff) | |
download | bcm5719-llvm-a7eb78b47f4583ab0699827e7eb1d589892b5d30.tar.gz bcm5719-llvm-a7eb78b47f4583ab0699827e7eb1d589892b5d30.zip |
[PowerPC] fix up in sign-/zero-extension elimination
This patch fixes a potential problem in my previous commit (https://reviews.llvm.org/rL315888) by adding a null check.
llvm-svn: 315900
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp index 9da20d9bc6f..b4da2d65596 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -2256,6 +2256,8 @@ PPCInstrInfo::isSignOrZeroExtended(const MachineInstr &MI, bool SignExt, if (CallMI.isCall() && CallMI.getOperand(0).isGlobal()) { const Function *CalleeFn = dyn_cast<Function>(CallMI.getOperand(0).getGlobal()); + if (!CalleeFn) + return false; const IntegerType *IntTy = dyn_cast<IntegerType>(CalleeFn->getReturnType()); const AttributeSet &Attrs = |