diff options
author | Amara Emerson <amara@apple.com> | 2021-09-07 23:51:48 -0700 |
---|---|---|
committer | Amara Emerson <amara@apple.com> | 2021-09-08 17:06:33 -0700 |
commit | eae44c8a863b49d6419ccfceb4f38803d2d9c30c (patch) | |
tree | bc64b67769f88173b359fe837e8e856b1d50213d /llvm/unittests/ADT/APIntTest.cpp | |
parent | e741fabc222f226d34d806056b804244b012853b (diff) | |
download | llvm-eae44c8a863b49d6419ccfceb4f38803d2d9c30c.zip llvm-eae44c8a863b49d6419ccfceb4f38803d2d9c30c.tar.gz llvm-eae44c8a863b49d6419ccfceb4f38803d2d9c30c.tar.bz2 |
[GlobalISel] Implement merging of stores of truncates.
This is a port of a combine which matches a pattern where a wide type scalar
value is stored by several narrow stores. It folds it into a single store or
a BSWAP and a store if the targets supports it.
Assuming little endian target:
i8 *p = ...
i32 val = ...
p[0] = (val >> 0) & 0xFF;
p[1] = (val >> 8) & 0xFF;
p[2] = (val >> 16) & 0xFF;
p[3] = (val >> 24) & 0xFF;
=>
*((i32)p) = val;
On CTMark AArch64 -Os this results in a good amount of savings:
Program before after diff
SPASS 412792 412788 -0.0%
kc 432528 432512 -0.0%
lencod 430112 430096 -0.0%
consumer-typeset 419156 419128 -0.0%
bullet 475840 475752 -0.0%
tramp3d-v4 367760 367628 -0.0%
clamscan 383388 383204 -0.0%
pairlocalalign 249764 249476 -0.1%
7zip-benchmark 570100 568860 -0.2%
sqlite3 287628 286920 -0.2%
Geomean difference -0.1%
Differential Revision: https://reviews.llvm.org/D109419
Diffstat (limited to 'llvm/unittests/ADT/APIntTest.cpp')
0 files changed, 0 insertions, 0 deletions