[PATCH] D155790: PreISelIntrinsicLowering: don't expand memcpys in minsize functions, even with no-builtins.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 04:23:05 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp:201
+    // so just avoid expanding here if the caller is a minsize function.
+    bool IsMinSize = Inst->getFunction()->hasMinSize();
 
----------------
Lowering the intrinsic when the libcall isn't available is mandatory, you can't simply skip it.

For minsize, you could adjust the default size threshold. Also, we could inject into the module an implementation you expand into, so the expansion happens fewer times


================
Comment at: llvm/test/CodeGen/ARM/no-expand-memcpy-minsize-no-builtins.ll:10
+; Check we don't expand memcpy to a loop when the caller is a minsize function,
+; even if we have no-builtins attached.
+define arm_aapcs_vfpcc void @test(ptr %p1, ptr %p2) #1 {
----------------
I don't understand this, minsize can't override an explicit don't-do-this


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155790



More information about the llvm-commits mailing list