[PATCH] D48599: SCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction
Evgeny Stupachenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 26 10:48:05 PDT 2018
evstupac added inline comments.
================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:1172-1175
+ Value *IncomingValue = PN.getIncomingValueForBlock(LatchBlock);
+ if (!isa<Instruction>(IncomingValue))
+ continue;
+ Instruction *TempIncV = cast<Instruction>(IncomingValue);
----------------
It looks very similar to dyn_cast:
```
Instruction *TempIncV =
dyn_cast<Instruction>(PN.getIncomingValueForBlock(LatchBlock));
if (!TempIncV)
continue;
```
Repository:
rL LLVM
https://reviews.llvm.org/D48599
More information about the llvm-commits
mailing list