@geastack/compiler 1.0.62 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ir/dense-loops.js
CHANGED
|
@@ -375,6 +375,13 @@ export const denseLoopsOf = (body, hoists = loopInvariantHoistsOf(body), plainFi
|
|
|
375
375
|
const fold = folds.get(index);
|
|
376
376
|
const host = fold === undefined ? undefined : found[fold.host];
|
|
377
377
|
for (const [at, candidate] of loop.candidates.entries()) {
|
|
378
|
+
// A checked window pays a compare per access, so it must not take an
|
|
379
|
+
// access a nested loop already bounds with its own counter: loops are
|
|
380
|
+
// decided innermost-first, and `a[i * n + k]` in a `k` loop inside a
|
|
381
|
+
// `j` loop is unbounded for `j` but a plain window for `k`.
|
|
382
|
+
const operations = candidate.checked ? candidate.operations.filter((operation) => !accesses.has(operation)) : candidate.operations;
|
|
383
|
+
if (operations.length === 0)
|
|
384
|
+
continue;
|
|
378
385
|
const ordinal = arrays.length;
|
|
379
386
|
const blocks = loops[index]?.blocks;
|
|
380
387
|
if (blocks)
|
|
@@ -405,7 +412,7 @@ export const denseLoopsOf = (body, hoists = loopInvariantHoistsOf(body), plainFi
|
|
|
405
412
|
...(rows ? { rows } : {}),
|
|
406
413
|
...(candidate.checked ? { checked: true } : {})
|
|
407
414
|
});
|
|
408
|
-
for (const operation of
|
|
415
|
+
for (const operation of operations) {
|
|
409
416
|
const flag = flagAt(blockOfOperation.get(operation) ?? loop.preheader);
|
|
410
417
|
if (flag === null)
|
|
411
418
|
continue;
|
|
@@ -643,7 +643,7 @@ const emitUnionMethodCall = (ctx, lines, operation) => {
|
|
|
643
643
|
const shadowCall = `gea_shadow_callable.callWithReceiver(${['gea::NativeCallReceiver::object(' + self + ')', ...padded.slice(1)].join(', ')})`;
|
|
644
644
|
const invocation = !shadowed
|
|
645
645
|
? direct
|
|
646
|
-
: `[&](const auto& ${self})
|
|
646
|
+
: `[&](const auto& ${self}) { using gea_shadow_result = std::remove_cvref_t<decltype(${direct})>; ` +
|
|
647
647
|
`if (gea::detail::nativeExpandoPresent(${self})) [[unlikely]] { if (const auto gea_shadow = gea::detail::nativeExpandoOwnValue(${self}, ${cppStringLiteral(memberKey)})) { ` +
|
|
648
648
|
`auto gea_shadow_callable = gea::detail::DynamicCarrier<${cppTypeOf({ kind: 'function-value-dispatch', abi: { ...abi, receiver: null } })}>::in(*gea_shadow, 0); ` +
|
|
649
649
|
`if constexpr (std::is_void_v<gea_shadow_result>) { ${shadowCall}; return; } else return static_cast<gea_shadow_result>(${shadowCall}); } } ` +
|
|
@@ -1612,9 +1612,9 @@ export const emitCall = (ctx, lines, operation) => {
|
|
|
1612
1612
|
const forwarded = names.map((name) => `std::forward<decltype(${name})>(${name})`);
|
|
1613
1613
|
const shadow = cppTypeOf({ kind: 'function-value-dispatch', abi: { ...held, receiver: null } });
|
|
1614
1614
|
const shadowCall = `gea_shadow_callable.callWithReceiver(${['gea::NativeCallReceiver::object(' + self + ')', ...forwarded].join(', ')})`;
|
|
1615
|
-
return (`[&](const auto& ${self}${names.map((name) => `, auto&& ${name}`).join('')})
|
|
1615
|
+
return (`[&](const auto& ${self}${names.map((name) => `, auto&& ${name}`).join('')}) { ` +
|
|
1616
1616
|
`auto gea_shadow_normal = [&]() -> decltype(auto) { return ${normal(self, forwarded)}; }; ` +
|
|
1617
|
-
'using gea_shadow_result = decltype(gea_shadow_normal())
|
|
1617
|
+
'using gea_shadow_result = std::remove_cvref_t<decltype(gea_shadow_normal())>; ' +
|
|
1618
1618
|
`if (gea::detail::nativeExpandoPresent(${self})) [[unlikely]] { ` +
|
|
1619
1619
|
`if (const auto gea_shadow = gea::detail::nativeExpandoOwnValue(${self}, ${cppStringLiteral(shadowGuard.key)})) { ` +
|
|
1620
1620
|
`auto gea_shadow_callable = gea::detail::DynamicCarrier<${shadow}>::in(*gea_shadow, 0); ` +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geastack/compiler",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63",
|
|
4
4
|
"description": "The geastack TypeScript-to-C++ compiler: one semantic spine, no source-shaped authority, no boxing of statically typed values.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|