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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 28 02:59:07 PDT 2018


lebedev.ri added inline comments.


================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:1172
 
       Instruction *TempIncV =
+          dyn_cast<Instruction>(PN.getIncomingValueForBlock(LatchBlock));
----------------
mkazantsev wrote:
> 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.
I'm afraid i have no knowledge of this code to do anything like that.
So the crash can either stay, or this band-aid can land, and a bug
about possibility to rework this code to work with `Value` be filled.


Repository:
  rL LLVM

https://reviews.llvm.org/D48599





More information about the llvm-commits mailing list