[PATCH] D48599: SCEVExpander::expandAddRecExprLiterally(): check before casting as Instruction

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 02:52:55 PDT 2018


mkazantsev added inline comments.


================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:1172
 
       Instruction *TempIncV =
+          dyn_cast<Instruction>(PN.getIncomingValueForBlock(LatchBlock));
----------------
Naming here is also confusing. `V` assumes that it should be a value. If there is no strong reason to keep it an instruction, I'd suggest reworking this code to deal with values.


Repository:
  rL LLVM

https://reviews.llvm.org/D48599





More information about the llvm-commits mailing list