[Assignment Tracking][NFC] Use BitVectors as masks for SmallVectors
authorOCHyams <orlando.hyams@sony.com>
Tue, 21 Mar 2023 08:28:08 +0000 (08:28 +0000)
committerOCHyams <orlando.hyams@sony.com>
Tue, 21 Mar 2023 09:11:54 +0000 (09:11 +0000)
commitd5b2c8e56da07b362c88cf7d3254eabf79323858
treeab6a9be860e420f706fcf72905b6e9a8139e94f7
parentee928e322861085eaf7ea18120eca8a8a4c6201e
[Assignment Tracking][NFC] Use BitVectors as masks for SmallVectors

...rather than using DenseMaps to track per-variable information.

Rather than tracking 3 maps of {VariableID: SomeInfo} per block, use a
BitVector indexed by VariableID to mask 3 vectors of SomeInfo.

BlockInfos now need to be initialised with a call to init which sets the
BitVector width to the number of partially promoted variables in the function
and fills the vectors with Top values.

Prior to this patch, in joinBlockInfo, it was necessary to insert Top values
into the Join result for variables in A XOR B after joining the variables in A
AND B. Now, because the vectors are pre-filled with Top values we need only
join the variables A AND B and set the BitVector of tracked variables to A OR
B.

The patch achieves an average of 0.25% reduction in instructions retired and a
1.1% max-rss for the CTMark suite in LTO-O3-g builds.

Reviewed By: scott.linder

Differential Revision: https://reviews.llvm.org/D145558
llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp