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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 09:08:16 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;
----------------
arsenm wrote:

If you wanted to be fancy you could use `std::numeric_limits<typeof(MaxStoresPerMemset)>::max()`

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


More information about the llvm-commits mailing list