summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-07-20 21:43:20 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-07-20 21:43:20 +0000
commitacf005676ebd747b762089ecfe5f9bd7f3a0bbd9 (patch)
treed602b611089ced22f203c3b67b46b2485734b935 /llvm/lib/Transforms
parent5ae765e68cf9b9e24fc1410c6c17daa54aaa029b (diff)
downloadbcm5719-llvm-acf005676ebd747b762089ecfe5f9bd7f3a0bbd9.tar.gz
bcm5719-llvm-acf005676ebd747b762089ecfe5f9bd7f3a0bbd9.zip
Change the cap on the amount of padding for each vtable to 32-byte (previously it was 128-byte)
We tested different cap values with a recent commit of Chromium. Our results show that the 32-byte cap yields the smallest binary and all the caps yield similar performance. Based on the results, we propose to change the cap value to 32-byte. Patch by Zhaomo Yang! Differential Revision: https://reviews.llvm.org/D49405 llvm-svn: 337622
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/LowerTypeTests.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
index 367b6282e24..4f757188470 100644
--- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -771,10 +771,12 @@ void LowerTypeTestsModule::buildBitSetsFromGlobalVariables(
// Compute the amount of padding required.
uint64_t Padding = NextPowerOf2(InitSize - 1) - InitSize;
- // Cap at 128 was found experimentally to have a good data/instruction
- // overhead tradeoff.
- if (Padding > 128)
- Padding = alignTo(InitSize, 128) - InitSize;
+ // Experiments of different caps with Chromium on both x64 and ARM64
+ // have shown that the 32-byte cap generates the smallest binary on
+ // both platforms while different caps yield similar performance.
+ // (see https://lists.llvm.org/pipermail/llvm-dev/2018-July/124694.html)
+ if (Padding > 32)
+ Padding = alignTo(InitSize, 32) - InitSize;
GlobalInits.push_back(
ConstantAggregateZero::get(ArrayType::get(Int8Ty, Padding)));
OpenPOWER on IntegriCloud