[PATCH] D89645: [InferAttrs] Add nocapture/writeonly to string/mem libcalls

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 15 14:42:11 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/BuildLibCalls.cpp:233
     Changed |= setDoesNotCapture(F, 1);
+    Changed |= setOnlyWritesMemory(F, 0);
     Changed |= setOnlyReadsMemory(F, 1);
----------------
I believer this is causing the first argument of `str(n)cat` to be incorrectly marked as `write only`. `str(n)cat` appends at the end of the first string, but to do so it first needs to read the argument to find the end of the null-terminated string. I put up a fix D100601


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89645



More information about the llvm-commits mailing list