diff options
| author | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-03 09:36:32 +0000 |
|---|---|---|
| committer | Eugene Leviant <eleviant@accesssoftek.com> | 2019-07-03 09:36:32 +0000 |
| commit | ac407a7b4a9b0aca70a62cce52e43ad3c5a2686b (patch) | |
| tree | 9e1519583f2eec1b0ed0929fead97ef37ae28013 /llvm/lib/Analysis | |
| parent | f82672873a283c108c23d9b777badd41b3dfa272 (diff) | |
| download | bcm5719-llvm-ac407a7b4a9b0aca70a62cce52e43ad3c5a2686b.tar.gz bcm5719-llvm-ac407a7b4a9b0aca70a62cce52e43ad3c5a2686b.zip | |
[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
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index cd323fcb897..16d0bd64bf0 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -60,12 +60,10 @@ Value *SCEVExpander::ReuseOrCreateCast(Value *V, Type *Ty, // instructions that might be inserted before BIP. if (BasicBlock::iterator(CI) != IP || BIP == IP) { // Create a new cast, and leave the old cast in place in case - // it is being used as an insert point. Clear its operand - // so that it doesn't hold anything live. + // it is being used as an insert point. Ret = CastInst::Create(Op, V, Ty, "", &*IP); Ret->takeName(CI); CI->replaceAllUsesWith(Ret); - CI->setOperand(0, UndefValue::get(V->getType())); break; } Ret = CI; |

