[PATCH] D126903: [clang] Add support for __builtin_memset_inline

Clement Courbet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 10 05:34:02 PDT 2022


courbet added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h:79
   /// SDValue if the target declines to use custom code and a different
   /// lowering strategy should be used.
   virtual SDValue EmitTargetCodeForMemset(SelectionDAG &DAG, const SDLoc &dl,
----------------
Add comment about honoring `AlwaysInline` ?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:6990
 /// \param isVol True if destination is volatile.
+/// \param AlwaysInline Makes sure a chain of stores is generated.
 /// \param DstPtrInfo IR information on the memory pointer.
----------------
"Makes sure no function call is generated", because technically the code can generate an accelerator call (e.g. `rep stos`)


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7352
+    assert(ConstantSize && "AlwaysInline requires a constant size!");
+    return getMemsetStores(*this, dl, Chain, Dst, Src,
+                           ConstantSize->getZExtValue(), Alignment, isVol, true,
----------------
Let's assert that the returned value is non-default before returning.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126903



More information about the cfe-commits mailing list