summaryrefslogtreecommitdiff
path: root/compiler/optimizing/liveness_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2025-02-21 09:15:31 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2025-02-22 05:04:46 -0800
commit5fea48559820d31e5f40c94d4964dc4b952a19eb (patch)
tree895775335a8d92af5e97a5ab5211d9a88a60b2c5 /compiler/optimizing/liveness_test.cc
parent6da94fc2315bf2d64af3c327c037918bbb660d64 (diff)
Optimizing: Speed up SSA Liveness Analysis.
Add some functions from `BitVector` to `BitVectorView<>` and use this to speed up the `SsaLivenessAnalysis` pass. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 331194861 Change-Id: I5bca36da7b4d53a3d5e60f45530168cf20290120
Diffstat (limited to 'compiler/optimizing/liveness_test.cc')
-rw-r--r--compiler/optimizing/liveness_test.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/optimizing/liveness_test.cc b/compiler/optimizing/liveness_test.cc
index 0b421cf9e6..1e4ef8f867 100644
--- a/compiler/optimizing/liveness_test.cc
+++ b/compiler/optimizing/liveness_test.cc
@@ -33,14 +33,14 @@ class LivenessTest : public CommonCompilerTest, public OptimizingUnitTestHelper
void TestCode(const std::vector<uint16_t>& data, const char* expected);
};
-static void DumpBitVector(BitVector* vector,
+static void DumpBitVector(BitVectorView<size_t> vector,
std::ostream& buffer,
size_t count,
const char* prefix) {
buffer << prefix;
buffer << '(';
for (size_t i = 0; i < count; ++i) {
- buffer << vector->IsBitSet(i);
+ buffer << vector.IsBitSet(i);
}
buffer << ")\n";
}
@@ -59,11 +59,11 @@ void LivenessTest::TestCode(const std::vector<uint16_t>& data, const char* expec
for (HBasicBlock* block : graph->GetBlocks()) {
buffer << "Block " << block->GetBlockId() << std::endl;
size_t ssa_values = liveness.GetNumberOfSsaValues();
- BitVector* live_in = liveness.GetLiveInSet(*block);
+ BitVectorView<size_t> live_in = liveness.GetLiveInSet(*block);
DumpBitVector(live_in, buffer, ssa_values, " live in: ");
- BitVector* live_out = liveness.GetLiveOutSet(*block);
+ BitVectorView<size_t> live_out = liveness.GetLiveOutSet(*block);
DumpBitVector(live_out, buffer, ssa_values, " live out: ");
- BitVector* kill = liveness.GetKillSet(*block);
+ BitVectorView<size_t> kill = liveness.GetKillSet(*block);
DumpBitVector(kill, buffer, ssa_values, " kill: ");
}
ASSERT_STREQ(expected, buffer.str().c_str());