https://bugs.llvm.org/show_bug.cgi?id=37927
Bug ID: 37927
Summary: [GlobalMerge] GlobalMerge pass hurts the performance
when merging global arrays
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Common Code Generator Code
Assignee: unassignedb...@nondot.org
Reporter: haich...@codeaurora.org
CC: llvm-bugs@lists.llvm.org
Disabling GlobalMerge pass can improve 2/3 of spec20xx benchmarks and only 2
benchmarks have large regression. I looked into it and I believe the cause is
merging global arrays with other globals.
The motivation examples of this pass is merging global arrays using the same
index like below:
static int foo[N], bar[N], baz[N];
for (i = 0; i < N; ++i)
foo[i] = bar[i] * baz[i];
The same base registers can be reused among three memory accesses. However, if
the array accesses use different indices like this:
foo[i] = bar[j] * baz[k];
We need to use reg+reg+imm to access which cannot be folded into the addressing
mode of AArch64 or ARM.
I did a simple experiment by skipping all global arrays during the global
collecting phase and 3/4 benchmarks of spec20xx got improved and the
regressions are all noise.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs