[PATCH] D135261: [SimplifyLibCalls] Remove invalid code comment in optimizeStringLength. NFC

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 11:01:02 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0db4b1d1a873: [SimplifyLibCalls] Adjust code comment in optimizeStringLength. NFC (authored by bjope).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135261/new/

https://reviews.llvm.org/D135261

Files:
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp


Index: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
===================================================================
--- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -927,9 +927,9 @@
   // strlen(s + x) to strlen(s) - x, when x is known to be in the range
   // [0, strlen(s)] or the string has a single null terminator '\0' at the end.
   // We only try to simplify strlen when the pointer s points to an array
-  // of i8. Otherwise, we would need to scale the offset x before doing the
-  // subtraction. This will make the optimization more complex, and it's not
-  // very useful because calling strlen for a pointer of other types is
+  // of CharSize elements. Otherwise, we would need to scale the offset x before
+  // doing the subtraction. This will make the optimization more complex, and
+  // it's not very useful because calling strlen for a pointer of other types is
   // very uncommon.
   if (GEPOperator *GEP = dyn_cast<GEPOperator>(Src)) {
     // TODO: Handle subobjects.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135261.465788.patch
Type: text/x-patch
Size: 1054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221006/70215b5e/attachment.bin>


More information about the llvm-commits mailing list