[PATCH] D86724: [BuildLibCalls] Add argmemonly to more lib calls.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 10:38:42 PDT 2020


jdoerfert added a comment.

FWIW, I have a non-clean patch for this too that has some more things we could add: https://github.com/jdoerfert/llvm-project/commit/c405073b6f353b3bccb10f222185763c4c7e3457 
I would recommend we sort the order in each case, arguments first, in order of their number, than return than function, or something similar. that makes it easier to compare and read IMHO.
We should maybe wait for D85932 <https://reviews.llvm.org/D85932> and start using the script for this file, it can handle what we need it too nicely (I think/hope).

I'm fine with doing them in multiple steps, especially D85932 <https://reviews.llvm.org/D85932> should make this even simpler.



================
Comment at: llvm/lib/Transforms/Utils/BuildLibCalls.cpp:322
     Changed |= setDoesNotThrow(F);
+    Changed |= setDoesNotFreeMemory(F);
     Changed |= setDoesNotCapture(F, 0);
----------------
xbolva00 wrote:
> xbolva00 wrote:
> > Should be nofree opt out rather than opt in? 
> > 
> > @jeoerfert
> Ok, we have there:
> 
> if(!isLibFreeFunction(&F, TheLibFunc) && !isReallocLikeFn(&F,  &TLI))
>     Changed |= setDoesNotFreeMemory(F);
> 
> 
> So why we need to set nofree for memcmp?
I think it was set before already. So no need to add it here if that was the case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86724



More information about the llvm-commits mailing list