summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
diff options
context:
space:
mode:
authorAmara Emerson <aemerson@apple.com>2019-08-05 20:02:52 +0000
committerAmara Emerson <aemerson@apple.com>2019-08-05 20:02:52 +0000
commit85e5e28ab4c826593610e25aac7197a35da8244c (patch)
treecc4baa8bdb74698ed790b524f840aa99c5652df0 /llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
parent6e33c647f3077d91079bf4c33d03acda47a55a1c (diff)
downloadbcm5719-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/CodeGen/GlobalISel/CombinerHelper.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
index 373d52fd1d4..91498133faf 100644
--- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
@@ -861,7 +861,7 @@ bool CombinerHelper::optimizeMemmove(MachineInstr &MI, Register Dst,
return true;
}
-bool CombinerHelper::tryCombineMemCpyFamily(MachineInstr &MI) {
+bool CombinerHelper::tryCombineMemCpyFamily(MachineInstr &MI, unsigned MaxLen) {
// This combine is fairly complex so it's not written with a separate
// matcher function.
assert(MI.getOpcode() == TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS);
@@ -900,6 +900,9 @@ bool CombinerHelper::tryCombineMemCpyFamily(MachineInstr &MI) {
return true;
}
+ if (MaxLen && KnownLen > MaxLen)
+ return false;
+
if (ID == Intrinsic::memcpy)
return optimizeMemcpy(MI, Dst, Src, KnownLen, DstAlign, SrcAlign, IsVolatile);
if (ID == Intrinsic::memmove)
OpenPOWER on IntegriCloud