summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2016-05-28 01:40:14 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2016-05-28 01:40:14 +0000
commitd69cd1e0867fa4b8ad1ff5545f70022d34a1c5f5 (patch)
tree989fae8a4958b3203b95cc2a0ab467aafbc324ef /llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
parente31e7781609c4eeef0cf85286facd6dc1d028976 (diff)
downloadbcm5719-llvm-d69cd1e0867fa4b8ad1ff5545f70022d34a1c5f5.tar.gz
bcm5719-llvm-d69cd1e0867fa4b8ad1ff5545f70022d34a1c5f5.zip
[LoopUnrollAnalyzer] Add a comment to visitCastInst.
llvm-svn: 271086
Diffstat (limited to 'llvm/lib/Analysis/LoopUnrollAnalyzer.cpp')
-rw-r--r--llvm/lib/Analysis/LoopUnrollAnalyzer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
index 8a97a9f9522..f9e02078501 100644
--- a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
+++ b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
@@ -141,6 +141,12 @@ bool UnrolledInstAnalyzer::visitCastInst(CastInst &I) {
Constant *COp = dyn_cast<Constant>(I.getOperand(0));
if (!COp)
COp = SimplifiedValues.lookup(I.getOperand(0));
+
+ // If we know a simplified value for this operand and cast is valid, save the
+ // result to SimplifiedValues.
+ // The cast can be invalid, because SimplifiedValues contains results of SCEV
+ // analysis, which operates on integers (and, e.g., might convert i8* null to
+ // i32 0).
if (COp && CastInst::castIsValid(I.getOpcode(), COp, I.getType())) {
if (Constant *C =
ConstantExpr::getCast(I.getOpcode(), COp, I.getType())) {
OpenPOWER on IntegriCloud