more fixes

This commit is contained in:
water111
2026-04-13 17:20:08 -04:00
parent 3cfa4e3745
commit 5670fce5bd
3 changed files with 44 additions and 8 deletions
+17 -8
View File
@@ -45,6 +45,7 @@ If the previous let variables appear in the definition of new one, make the let
namespace {
FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool, LetRewriteStats& stats);
FormElement* rewrite_multi_let_as_vector_dot(LetElement* in, const Env& env, FormPool& pool);
bool let_uses_stack_slot_access(const LetElement* in);
std::vector<Form*> path_up_tree(Form* in, const Env&) {
@@ -2410,6 +2411,14 @@ FormElement* rewrite_set_font_single(LetElement* in,
FormElement* rewrite_let(LetElement* in, const Env& env, FormPool& pool, LetRewriteStats& stats) {
// ordered based on frequency. for best performance, you check the most likely rewrites first!
if (in->entries().size() >= 6) {
auto as_vector_dot = rewrite_multi_let_as_vector_dot(in, env, pool);
if (as_vector_dot) {
stats.vector_dot++;
return as_vector_dot;
}
}
if (let_uses_stack_slot_access(in)) {
return nullptr;
}
@@ -3078,6 +3087,14 @@ FormElement* rewrite_multi_let(LetElement* in,
const Env& env,
FormPool& pool,
LetRewriteStats& stats) {
if (in->entries().size() >= 6) {
auto as_vector_dot = rewrite_multi_let_as_vector_dot(in, env, pool);
if (as_vector_dot) {
stats.vector_dot++;
return as_vector_dot;
}
}
if (let_uses_stack_slot_access(in)) {
return in;
}
@@ -3110,14 +3127,6 @@ FormElement* rewrite_multi_let(LetElement* in,
}
}
if (in->entries().size() >= 6) {
auto as_vector_dot = rewrite_multi_let_as_vector_dot(in, env, pool);
if (as_vector_dot) {
stats.vector_dot++;
return as_vector_dot;
}
}
auto as_font_set_origin = rewrite_set_font_origin(in, env, pool);
if (as_font_set_origin) {
stats.font_method++;