projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LoopPass: Simplify the API for adding a new loop. NFC
[oota-llvm.git]
/
lib
/
Transforms
/
Utils
/
SimplifyIndVar.cpp
diff --git
a/lib/Transforms/Utils/SimplifyIndVar.cpp
b/lib/Transforms/Utils/SimplifyIndVar.cpp
index c7ec1bc263d3214a8bba457fcc381db37673a7a2..58715fa4bef1aafb4abdaafec8787b0e9be235a0 100644
(file)
--- a/
lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/
lib/Transforms/Utils/SimplifyIndVar.cpp
@@
-333,6
+333,9
@@
bool SimplifyIndvar::eliminateIdentitySCEV(Instruction *UseInst,
if (!DT || !DT->dominates(IVOperand, UseInst))
return false;
if (!DT || !DT->dominates(IVOperand, UseInst))
return false;
+ if (!LI->replacementPreservesLCSSAForm(UseInst, IVOperand))
+ return false;
+
DEBUG(dbgs() << "INDVARS: Eliminated identity: " << *UseInst << '\n');
UseInst->replaceAllUsesWith(IVOperand);
DEBUG(dbgs() << "INDVARS: Eliminated identity: " << *UseInst << '\n');
UseInst->replaceAllUsesWith(IVOperand);