fix: extract more Nats in extractClosed (#8535)

This PR extracts more Nats (and their downstream users) in extractClosed
by fixing a silly oversight in the logic.
This commit is contained in:
Cameron Zwarich 2025-05-29 14:11:21 -07:00 committed by GitHub
parent 1879a2bafc
commit e30303e33c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,7 +63,7 @@ partial def shouldExtractLetValue (isRoot : Bool) (v : LetValue) : M Bool := do
| .lit (.nat v) =>
-- The old compiler's implementation used the runtime's `is_scalar` function, which
-- introduces a dependency on the architecture used by the compiler.
return v >= Nat.pow 2 63
return !isRoot || v >= Nat.pow 2 63
| .lit _ | .erased => return !isRoot
| .const name _ args =>
if (← read).sccDecls.any (·.name == name) then