[SCEV][LSR] Prevent using undefined value in binops
authorEugene Leviant <eleviant@accesssoftek.com>
Wed, 3 Jul 2019 09:36:32 +0000 (09:36 +0000)
committerEugene Leviant <eleviant@accesssoftek.com>
Wed, 3 Jul 2019 09:36:32 +0000 (09:36 +0000)
commitac407a7b4a9b0aca70a62cce52e43ad3c5a2686b
tree9e1519583f2eec1b0ed0929fead97ef37ae28013
parentf82672873a283c108c23d9b777badd41b3dfa272
[SCEV][LSR] Prevent using undefined value in binops

On some occasions ReuseOrCreateCast may convert previously
expanded value to undefined. That value may be passed by
SCEVExpander as an argument to InsertBinop making IV chain
undefined.

Differential revision: https://reviews.llvm.org/D63928

llvm-svn: 365009
llvm/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/test/CodeGen/ARM/lsr-undef-in-binop.ll [new file with mode: 0644]
llvm/test/Transforms/LoopDistribute/bounds-expansion-bug.ll