[all-commits] [llvm/llvm-project] 188a7d: Add alloca size threshold for StackTagging initial...
Evgenii Stepanov via All-commits
all-commits at lists.llvm.org
Mon Oct 19 13:44:39 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 188a7d671019247932b7242c7794960ca1986b5a
https://github.com/llvm/llvm-project/commit/188a7d671019247932b7242c7794960ca1986b5a
Author: Evgenii Stepanov <eugenis at google.com>
Date: 2020-10-19 (Mon, 19 Oct 2020)
Changed paths:
M llvm/lib/Target/AArch64/AArch64StackTagging.cpp
M llvm/test/CodeGen/AArch64/stack-tagging-initializer-merge.ll
Log Message:
-----------
Add alloca size threshold for StackTagging initializer merging.
Summary:
Initializer merging generates pretty inefficient code for large allocas
that also happens to trigger an exponential algorithm somewhere in
Machine Instruction Scheduler. See https://bugs.llvm.org/show_bug.cgi?id=47867.
This change adds an upper limit for the alloca size. The default limit
is selected such that worst case size of memtag-generated code is
similar to non-memtag (but because of the ISA quirks, this case is
realized at the different value of alloca size, ex. memset inlining
triggers at sizes below 512, but stack tagging instructions are 2x
shorter, so limit is approx. 256).
We could try harder to emit more compact code with initializer merging,
but that would only affect large, sparsely initialized allocas, and
those are doing fine already.
Reviewers: vitalybuka, pcc
Subscribers: llvm-commits
More information about the All-commits
mailing list