[PATCH] D66079: [SimplifyLibCalls] Add dereferenceable bytes from known callsites [WIP]

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 12 13:43:15 PDT 2019


xbolva00 marked an inline comment as done.
xbolva00 added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:983
+  if (isIntrinsic)
+    return nullptr;
+
----------------
xbolva00 wrote:
> jdoerfert wrote:
> > xbolva00 wrote:
> > > jdoerfert wrote:
> > > > What does the return value here mean? I'm also confused by the `Op0` which was there already.
> > > > 
> > > nullptr means that nothing was simplified.
> > > 
> > > below, for memcpy, we can just turn memcpy libcall to memcpy intrinsic.
> > but why is the pointer operand returned?
> llvm memcpy intrinsic "returns" void so in order to fix return value, we return dst pointer.
> 
> return memcpy(dst, ...)
> 
> to
> 
> llvm.memcpy(dst, ....)
> return dst;
> 
> I dont know why this was designed this way :)
https://llvm.org/docs/LangRef.html#llvm-memcpy-intrinsic


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

https://reviews.llvm.org/D66079





More information about the llvm-commits mailing list