Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[StackColoring] Do not drop AA metadata when not doing remappings (#7…
…1958) 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.
- Loading branch information