Remove some branches for Node3 in checkMaxBetweenExclusive
All checks were successful
Tests / Clang total: 1337, passed: 1337
Clang |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / SIMD fallback total: 1337, passed: 1337
Tests / 32-bit versions total: 1337, passed: 1337
Tests / Release [gcc] total: 1337, passed: 1337
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 997, passed: 997
Tests / Coverage total: 1004, passed: 1004
Code Coverage #### Project Overview No changes detected, that affect the code coverage. * Line Coverage: 98.76% (1599/1619) * Branch Coverage: 65.86% (1466/2226) * Complexity Density: 0.00 * Lines of Code: 1619 #### Quality Gates Summary Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good

This commit is contained in:
2024-07-07 20:45:20 -07:00
parent 9046dc5a8f
commit c9d0d72684

View File

@@ -2007,23 +2007,7 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
case Type_Node3: {
auto *self = static_cast<Node3 *>(n);
{
int c = begin == 255 ? -1 : getChildGeqSimd(self, begin + 1);
if (c >= 0 && c < end) {
auto *child = self->children[getNodeIndex(self, c)];
if (child->entryPresent) {
if (!(child->entry.rangeVersion <= readVersion)) {
return false;
};
}
begin = c;
} else {
return true;
}
// [begin, end) is now the half-open interval of children we're interested
// in.
assert(begin < end);
}
++begin;
const unsigned shiftUpperBound = end - begin;
const unsigned shiftAmount = begin;
@@ -2031,15 +2015,23 @@ bool checkMaxBetweenExclusive(Node *n, int begin, int end,
return c - shiftAmount < shiftUpperBound;
};
uint32_t compared = 0;
for (int i = 0; i < Node3::kMaxNodes; ++i) {
compared |= (self->childMaxVersion[i] > readVersion) << i;
}
uint32_t mask = 0;
for (int i = 0; i < Node3::kMaxNodes; ++i) {
mask |= inBounds(self->index[i]) << i;
}
return !(compared & mask);
mask &= (1 << self->numChildren) - 1;
if (!mask) {
return true;
}
auto *child = self->children[__builtin_ctz(mask)];
const bool firstRangeOk =
!child->entryPresent || child->entry.rangeVersion <= readVersion;
uint32_t compared = 0;
for (int i = 0; i < Node3::kMaxNodes; ++i) {
compared |= (self->childMaxVersion[i] > readVersion) << i;
}
return !(compared & mask) && firstRangeOk;
}
case Type_Node16: {
auto *self = static_cast<Node16 *>(n);