[llvm] r315900 - [PowerPC] fix up in sign-/zero-extension elimination
Hiroshi Inoue via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 16 05:11:15 PDT 2017
Author: inouehrs
Date: Mon Oct 16 05:11:15 2017
New Revision: 315900
URL: http://llvm.org/viewvc/llvm-project?rev=315900&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp?rev=315900&r1=315899&r2=315900&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstrInfo.cpp Mon Oct 16 05:11:15 2017
@@ -2256,6 +2256,8 @@ PPCInstrInfo::isSignOrZeroExtended(const
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 =
More information about the llvm-commits
mailing list