[llvm] [AMDGPU][CodeGen] Improve handling of memcpy for -Os/-Oz compilations (PR #87632)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 07:57:48 PDT 2024


================
@@ -59,6 +59,12 @@ unsigned AMDGPUTargetLowering::numBitsSigned(SDValue Op, SelectionDAG &DAG) {
 AMDGPUTargetLowering::AMDGPUTargetLowering(const TargetMachine &TM,
                                            const AMDGPUSubtarget &STI)
     : TargetLowering(TM), Subtarget(&STI) {
+  // Always lower memset, memcpy, and memmove intrinsics to load/store
+  // instructions, rather then generating calls to memset, mempcy or memmove.
+  MaxStoresPerMemset = MaxStoresPerMemsetOptSize = ~0U;
----------------
Pierre-vh wrote:

Can you document where the `~0U` comes from?
Is it a magic value recognized in this pass or somewhere else?

Could we eventually have a constant variable for that value so its source is clear?

https://github.com/llvm/llvm-project/pull/87632


More information about the llvm-commits mailing list