Skip to content
Snippets Groups Projects
Commit a7eb78b4 authored by Hiroshi Inoue's avatar Hiroshi Inoue
Browse files

[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
parent bfc90615
No related branches found
No related tags found
No related merge requests found
...@@ -2256,6 +2256,8 @@ PPCInstrInfo::isSignOrZeroExtended(const MachineInstr &MI, bool SignExt, ...@@ -2256,6 +2256,8 @@ PPCInstrInfo::isSignOrZeroExtended(const MachineInstr &MI, bool SignExt,
if (CallMI.isCall() && CallMI.getOperand(0).isGlobal()) { if (CallMI.isCall() && CallMI.getOperand(0).isGlobal()) {
const Function *CalleeFn = const Function *CalleeFn =
dyn_cast<Function>(CallMI.getOperand(0).getGlobal()); dyn_cast<Function>(CallMI.getOperand(0).getGlobal());
if (!CalleeFn)
return false;
const IntegerType *IntTy = const IntegerType *IntTy =
dyn_cast<IntegerType>(CalleeFn->getReturnType()); dyn_cast<IntegerType>(CalleeFn->getReturnType());
const AttributeSet &Attrs = const AttributeSet &Attrs =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment