[llvm] r271086 - [LoopUnrollAnalyzer] Add a comment to visitCastInst.

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 18:40:18 PDT 2016


Author: mzolotukhin
Date: Fri May 27 20:40:14 2016
New Revision: 271086

URL: http://llvm.org/viewvc/llvm-project?rev=271086&view=rev
Log:
[LoopUnrollAnalyzer] Add a comment to visitCastInst.

Modified:
    llvm/trunk/lib/Analysis/LoopUnrollAnalyzer.cpp

Modified: llvm/trunk/lib/Analysis/LoopUnrollAnalyzer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopUnrollAnalyzer.cpp?rev=271086&r1=271085&r2=271086&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopUnrollAnalyzer.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopUnrollAnalyzer.cpp Fri May 27 20:40:14 2016
@@ -141,6 +141,12 @@ bool UnrolledInstAnalyzer::visitCastInst
   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())) {




More information about the llvm-commits mailing list