diff options
author | Amara Emerson <aemerson@apple.com> | 2019-08-05 20:02:52 +0000 |
---|---|---|
committer | Amara Emerson <aemerson@apple.com> | 2019-08-05 20:02:52 +0000 |
commit | 85e5e28ab4c826593610e25aac7197a35da8244c (patch) | |
tree | cc4baa8bdb74698ed790b524f840aa99c5652df0 /llvm/lib/Target/AArch64 | |
parent | 6e33c647f3077d91079bf4c33d03acda47a55a1c (diff) | |
download | bcm5719-llvm-85e5e28ab4c826593610e25aac7197a35da8244c.tar.gz bcm5719-llvm-85e5e28ab4c826593610e25aac7197a35da8244c.zip |
[AArch64][GlobalISel] Inline tiny memcpy et al at -O0.
FastISel already does this since the initial arm64 port was upstreamed, so
it seems there are no issues with doing this at -O0 for very small memcpys.
Gives a 0.2% geomean code size improvement on CTMark.
Differential Revision: https://reviews.llvm.org/D65758
llvm-svn: 367919
Diffstat (limited to 'llvm/lib/Target/AArch64')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp b/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp index 5ec209ada17..835fcf09f0a 100644 --- a/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp +++ b/llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp @@ -56,9 +56,12 @@ bool AArch64PreLegalizerCombinerInfo::combine(GISelChangeObserver &Observer, case Intrinsic::memcpy: case Intrinsic::memmove: case Intrinsic::memset: { + // If we're at -O0 set a maxlen of 32 to inline, otherwise let the other + // heuristics decide. + unsigned MaxLen = EnableOpt ? 0 : 32; // Try to inline memcpy type calls if optimizations are enabled. - return (EnableOpt && !EnableOptSize) ? Helper.tryCombineMemCpyFamily(MI) - : false; + return (!EnableOptSize) ? Helper.tryCombineMemCpyFamily(MI, MaxLen) + : false; } default: break; |