Rangeanalysis: Reshuffle perf fix. This should result in the same join-order, but with less materialisation.

This commit is contained in:
Anders Schack-Mulligen
2023-11-01 15:33:28 +01:00
parent bb2bbd2d4d
commit ac115e0a6f

View File

@@ -17,14 +17,10 @@ module ModulusAnalysis<
LocationSig Location, Semantic Sem, DeltaSig D, BoundSig<Location, Sem, D> Bounds,
UtilSig<Sem, D> U>
{
pragma[nomagic]
private predicate valueFlowStepSsaEqFlowCond(
Sem::SsaReadPosition pos, Sem::SsaVariable v, Sem::Expr e, int delta
) {
exists(Sem::Guard guard, boolean testIsTrue |
guard = U::semEqFlowCond(v, e, D::fromInt(delta), true, testIsTrue) and
Sem::guardDirectlyControlsSsaRead(guard, pos, testIsTrue)
)
bindingset[pos, v]
pragma[inline_late]
private predicate hasReadOfVarInlineLate(Sem::SsaReadPosition pos, Sem::SsaVariable v) {
pos.hasReadOfVar(v)
}
/**
@@ -36,8 +32,11 @@ module ModulusAnalysis<
) {
U::semSsaUpdateStep(v, e, D::fromInt(delta)) and pos.hasReadOfVar(v)
or
pos.hasReadOfVar(v) and
valueFlowStepSsaEqFlowCond(pos, v, e, delta)
exists(Sem::Guard guard, boolean testIsTrue |
hasReadOfVarInlineLate(pos, v) and
guard = U::semEqFlowCond(v, e, D::fromInt(delta), true, testIsTrue) and
Sem::guardDirectlyControlsSsaRead(guard, pos, testIsTrue)
)
}
/**