OSDN Git Service

[SCEVExpander] Fix a failed cast<> assertion
authorSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 11 May 2016 17:41:41 +0000 (17:41 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Wed, 11 May 2016 17:41:41 +0000 (17:41 +0000)
commit2731c7a952d680f9171caf3217b0f43fe96ccfaa
treebf3e9da769e8b2b3b85a59acbd6c22ccac586ac2
parent5bbe5abe5e6c609347c23969274b9710c3c896bf
[SCEVExpander] Fix a failed cast<> assertion

SCEVExpander::replaceCongruentIVs assumes the backedge value of an
SCEV-analysable PHI to always be an instruction, when this is not
necessarily true.  For now address this by bailing out of the
optimization if the backedge value of the PHI is a non-Instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269213 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolutionExpander.cpp
test/Analysis/ScalarEvolution/expander-replace-congruent-ivs.ll