[llvm] r232895 - ValueTracking: Forward getConstantStringInfo's TrimAtNul param into recursive invocation

Benjamin Kramer benny.kra at googlemail.com
Sat Mar 21 08:36:07 PDT 2015


Author: d0k
Date: Sat Mar 21 10:36:06 2015
New Revision: 232895

URL: http://llvm.org/viewvc/llvm-project?rev=232895&view=rev
Log:
ValueTracking: Forward getConstantStringInfo's TrimAtNul param into recursive invocation

Currently this is only used to tweak the backend's memcpy inlining
heuristics, testing that isn't very helpful. A real test case will
follow in the next commit, where this behavior would cause a real
miscompilation.

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

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=232895&r1=232894&r2=232895&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Sat Mar 21 10:36:06 2015
@@ -2592,7 +2592,7 @@ bool llvm::getConstantStringInfo(const V
   // Look through bitcast instructions and geps.
   V = V->stripPointerCasts();
 
-  // If the value is a GEP instructionor  constant expression, treat it as an
+  // If the value is a GEP instruction or constant expression, treat it as an
   // offset.
   if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
     // Make sure the GEP has exactly three arguments.
@@ -2619,7 +2619,8 @@ bool llvm::getConstantStringInfo(const V
       StartIdx = CI->getZExtValue();
     else
       return false;
-    return getConstantStringInfo(GEP->getOperand(0), Str, StartIdx+Offset);
+    return getConstantStringInfo(GEP->getOperand(0), Str, StartIdx + Offset,
+                                 TrimAtNul);
   }
 
   // The GEP instruction, constant or instruction, must reference a global





More information about the llvm-commits mailing list