aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorBjörn Pettersson <bjorn.a.pettersson@ericsson.com>2023-11-23 18:10:40 +0100
committerGitHub <noreply@github.com>2023-11-23 18:10:40 +0100
commit3114bd32e758b0f25cfa3dee5fa520e45f8fe491 (patch)
treeb06a2f567f8aaef7e8e6c1c2489091ce3f4ecbf4 /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parente09758224b65bfa30f1d9e5082f03abeeb610964 (diff)
downloadllvm-3114bd32e758b0f25cfa3dee5fa520e45f8fe491.zip
llvm-3114bd32e758b0f25cfa3dee5fa520e45f8fe491.tar.gz
llvm-3114bd32e758b0f25cfa3dee5fa520e45f8fe491.tar.bz2
[StackColoring] Do not drop AA metadata when not doing remappings (#71958)
In the StackColoring pass we first scan for possible stack slot merges. A SlotRemap map is setup with the remappings that should be performed. Then the main work is done by calling remapInstructions and providing that map. Most of the work in remapInstructions would just be a waste of time in situations when the SlotRemap map is empty, but it turns out that the part that adjusts Alias Analysis information could end up dropping AA metadata even when there are no stack slot merges being done. This happens since all instruction's machine memory operands are considered, and if we can't determine the underlying object that is accessed (using getUnderlyingObjectsForCodeGen) then we conservatively drop AA metadata. This patch simply avoids calling remapInstructions if we don't intend to do any remappings (i.e. if SlotRemap is empty). That avoids touching AA metadata when all we do is to remove lifetime markers. That seems like a safe thing to do, as it is the same thing as happens when we bail out early due to other reasons (e.g. when only having one lifetime marker). For targets that do not care about Alias Analysis information after the StackColoring pass this shouldn't have any impact, except that it might improve compile time slightly as we now skip spending time in remapInstructions when not doing any stack merges.
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
0 files changed, 0 insertions, 0 deletions