| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/language/cps.scm ($switch): New term.
* doc/ref/compiler.texi (CPS in Guile): Add documentation.
* module/language/cps.scm (build-term, parse-cps, unparse-cps)
* module/language/cps/closure-conversion.scm (compute-non-operator-uses)
(compute-singly-referenced-labels, rewrite-shared-closure-calls)
(compute-free-vars, convert-one)
* module/language/cps/compile-bytecode.scm (compile-function)
* module/language/cps/contification.scm (compute-singly-referenced-labels)
(compute-contification-candidates, apply-contification)
* module/language/cps/cse.scm (compute-truthy-expressions)
(forward-cont, term-successors, eliminate-common-subexpressions-in-fun)
* module/language/cps/dce.scm (compute-known-allocations)
(compute-live-code, process-eliminations)
* module/language/cps/devirtualize-integers.scm (compute-use-counts)
(peel-trace)
* module/language/cps/effects-analysis.scm (compute-effects)
* module/language/cps/licm.scm (hoist-one, hoist-in-loop)
* module/language/cps/loop-instrumentation.scm (compute-loop-headers)
* module/language/cps/peel-loops.scm (rename-cont)
* module/language/cps/renumber.scm (sort-labels-locally, renumber)
* module/language/cps/rotate-loops.scm (rotate-loop)
(rotate-loops-in-function)
* module/language/cps/self-references.scm (resolve-self-references)
* module/language/cps/simplify.scm (compute-singly-referenced-vars)
(eta-reduce, compute-singly-referenced-labels, beta-reduce)
* module/language/cps/slot-allocation.scm (compute-defs-and-uses)
(add-prompt-control-flow-edges, compute-var-representations)
* module/language/cps/specialize-numbers.scm (compute-significant-bits)
* module/language/cps/split-rec.scm (compute-free-vars)
* module/language/cps/type-fold.scm (local-type-fold)
* module/language/cps/types.scm (successor-count, infer-types)
* module/language/cps/utils.scm (compute-function-body)
(compute-successors, compute-predecessors)
* module/language/cps/verify.scm (compute-available-definitions)
(check-valid-var-uses, check-arities): Add support for new term.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/ref/vm.texi (Instruction Set): Document new v32-x8-l24 instruction
kind.
(Branch Instructions): Document jtable.
* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add
V32_X8_L24.
* libguile/jit.c (compile_jtable, compile_jtable_slow):
(COMPILE_X8_S24__V32_X8_L24, analyze): Add stub JIT compiler
implementation.
* libguile/vm-engine.c (jtable): New instruction.
* module/language/bytecode.scm (instruction-arity): Deprecate.
* module/system/vm/assembler.scm (encoder, assembler): Add V32_X8_L24
case.
* module/system/vm/disassembler.scm (u32-ref, s32-ref): Move definitions
to expansion-time only.
(define-op-handlers): New definition, replacing visit-opcodes.
(disassemblers, jump-parsers, stack-effect-parsers, clobber-parsers):
Rework in terms of define-op-handlers. Default case becomes #f, and
add support for jtable.
(disassemble-one, instruction-relative-jump-targets)
(instruction-stack-size-after, instruction-slot-clobbers): Inline
default case in the lookup procedure, not copied in the handler
vector.
(compute-labels): Add jtable case.
(instruction-lengths-vector, instruction-length): Rework to allow
variable-length instructions, and mark jtable as being
variable-length.
(instruction-has-fallthrough?): Add jtable to the no-fallthrough
set.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes a bug whereby, for example, "guild compile --target=i686-linux-gnu"
running on x86_64 would generate invalid code for 'bytevector-u32-native-set!'
because 'target-most-positive-fixnum' was called from the top-level
when (language tree-il compile-cps) was loaded.
Consequently, the .go files under prebuilt/ would be invalid, leading to
build failures on 32-bit platforms.
This issue became apparent with cb8cabe85f535542ac4fcb165d89722500e42653.
* module/language/tree-il/compile-cps.scm (bytevector-ref-converter)[tag]:
Turn into a lambda so that 'target-most-positive-fixnum' is called in
the right context.
(bytevector-set-converter)[integer-unboxer]: Likewise.
|
|
|
|
| |
* .dir-locals.el: Add rule.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/language/tree-il.scm (with-lexicals): New public helper.
* .dir-locals.el (with-lexicals): Add indentation rule.
* module/language/tree-il/compile-bytecode.scm (canonicalize): Use
with-lexicals.
* module/language/tree-il/compile-cps.scm (canonicalize): Use
with-lexicals from tree-il.
* module/language/tree-il/primitives.scm (chained-comparison-expander):
Remove duplicate expander definitions for <, <=, and so on.
* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): Avoid
inadvertent code duplication by using with-lexicals.
(expand-chained-comparisons): Likewise.
(call-with-prompt): Simplify to use with-lexicals.
|
|
|
|
| |
* .dir-locals.el (c-mode): Fix parens. Doh!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/system/base/compile.scm (compute-analyzer): Compute analyzer to
run on expressions before the compiler runs.
(add-default-optimizations): Flesh out; still a stub.a
(read-and-compile, compile, compile-and-load, compile-file): Default
warning and optimization levels.
(default-warning-level): New parameter, defaulting to 1.
(default-optimization-level): New parameter, defaulting to 2.
Currently unused.
* module/system/base/language.scm (<language>): Add
optimizations-for-level and analyzer fields.
* module/language/tree-il/compile-bytecode.scm (compile-bytecode):
* module/language/tree-il/compile-cps.scm (optimize-tree-il): No need to
run warnings passes here; compilers infrastructure will run them.
* module/language/tree-il/spec.scm (tree-il): Define make-analyzer as
analyzer.
* module/language/tree-il/analyze.scm (make-analyzer): New exported
procedure.
(%warning-passes): New private variable.
* .dir-locals.el: Add with-test-prefix/c&e indent mode.
* test-suite/tests/cross-compilation.test:
* test-suite/tests/optargs.test:
* test-suite/tests/tree-il.test: Adjust to disable default warnings.
|
|
|
|
| |
* .dir-locals.el (c-mode): Set 'indent-tabs-mode' to nil in C.
|
|
|
|
|
|
| |
* module/language/cps.scm ($prompt): Rework to be its own term kind.
Now $continue always continues to a single continuation. Adapt
callers.
|
|
|
|
|
|
|
| |
* module/language/cps.scm ($branch): Refactor to be its own CPS term
type, not relying on $continue to specify a continuation (which before
was only for the false case) or a source location. Update allllllll
callers.
|
|
|
|
|
|
|
|
| |
* module/language/cps2/with-cps.scm: New file.
* module/language/tree-il/compile-cps2.scm: Use (language cps2 with-cps).
* module/Makefile.am: Add language/cps2/with-cps.scm.
* .dir-locals.el: Add indentation rules for with-cps.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tentative plan is to replace CPS with CPS2, and to rename CPS2 to
CPS. We will add a pass to compile tree-il to CPS2, then work from
the top down to replace the CPS compiler passes.
* module/language/cps2.scm:
* module/language/cps2/compile-cps.scm:
* module/language/cps2/renumber.scm:
* module/language/cps2/utils.scm: New files.
* module/Makefile.am: Add new files to build.
|
|
|
|
| |
* .dir-locals.el: Add syntax-parameterize indentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/constructors.scm:
* module/language/cps/contification.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/prune-bailouts.scm:
* module/language/cps/prune-top-level-scopes.scm:
* module/language/cps/renumber.scm:
* module/language/cps/self-references.scm:
* module/language/cps/simplify.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/tree-il/compile-cps.scm: Adapt to produce and consume
raw $kfun $cont instances.
* .dir-locals.el: Update $letrec indentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/language/cps.scm ($kfun): Rename from $kentry.
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/constructors.scm:
* module/language/cps/contification.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/dfg.scm:
* module/language/cps/effects-analysis.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/prune-bailouts.scm:
* module/language/cps/prune-top-level-scopes.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/renumber.scm:
* module/language/cps/self-references.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Adapt users.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/language/cps.scm ($kentry, $fun): Attach "src" and "meta" on
the $kentry, not the $fun. This prepares us for $callk to $kentry
continuations that have no corresponding $fun.
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-bytecode.scm:
* module/language/cps/constructors.scm:
* module/language/cps/contification.scm:
* module/language/cps/cse.scm:
* module/language/cps/dce.scm:
* module/language/cps/dfg.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/prune-bailouts.scm:
* module/language/cps/prune-top-level-scopes.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/renumber.scm:
* module/language/cps/self-references.scm:
* module/language/cps/simplify.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/specialize-primcalls.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Adapt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/language/cps/dfg.scm (with-fresh-name-state-from-dfg): New
helper.
($dfg, compute-dfg): Store max-var and max-label in the dfg.
* module/language/cps.scm (with-fresh-name-state): Don't raise an error
on recursive invocation; that was mostly useful when finding a bug.
* module/language/cps/arities.scm (fix-arities):
* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
Use the new helper.
* .dir-locals.el: Update.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* .dir-locals.el: Add with-fresh-name-state.
* module/language/cps.scm (fresh-label, fresh-var): Signal an error if
the counters are not initialized.
(with-fresh-name-state): New macro.
(make-cont-folder): New macro, generates an n-ary folder.
(compute-max-label-and-var): New function, uses make-cont-folder.
(fold-conts): Use make-cont-folder.
(let-gensyms): Remove.
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/constructors.scm:
* module/language/cps/dce.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/specialize-primcalls.scm: Use let-fresh instead of
let-gensyms, and wrap in a with-fresh-name-state as needed.
* module/language/tree-il/compile-cps.scm: Remove hack to avoid
importing let-gensyms from (language tree-il).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/language/cps.scm (label-counter, var-counter): New parameters,
for producing fresh label and var names.
(fresh-label, fresh-var): New procedures.
(let-fresh): New macro, will replace let-gensyms.
(build-cps-term): Use let-fresh.
* module/language/tree-il/compile-cps.scm: Use let-fresh to generate
fresh names.
* module/system/vm/assembler.scm (make-meta, begin-kw-arity): Allow
exact integers as labels.
(link-debug): Explicitly mark low-pc as being an "addr" value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* module/language/cps.scm ($continue, $cont): Put source information on
the $continue, not on the $cont. Otherwise it is difficult for CPS
conversion to preserve source information.
($fun): Add a src member to $fun. Otherwise we might miss the source
info for the start of the function.
* .dir-locals.el:
* module/language/cps/arities.scm:
* module/language/cps/closure-conversion.scm:
* module/language/cps/compile-rtl.scm:
* module/language/cps/constructors.scm:
* module/language/cps/contification.scm:
* module/language/cps/dfg.scm:
* module/language/cps/elide-values.scm:
* module/language/cps/reify-primitives.scm:
* module/language/cps/slot-allocation.scm:
* module/language/cps/verify.scm:
* module/language/tree-il/compile-cps.scm: Update the whole CPS world
for this change.
|
|
|
|
|
|
|
|
| |
* module/Makefile.am:
* module/language/cps.scm:
* module/language/cps/verify.scm: Add CPS language.
* .dir-locals.el: Add indentation rules for some CPS forms.
|
| |
|
|
|
|
| |
* .dir-locals.el: Add more `scheme-indent-function' rules.
|
|
|
|
|
| |
* test-suite/test-suite/lib.scm (pass-if-equal): New macro.
(run-test): Upon `fail', pass ARGS to REPORT.
|
|
|
|
| |
* .dir-locals.el: Fill-columns back down to 72.
|
|
|
|
|
|
|
| |
* doc/ref/posix.texi (Network Databases): Remove tabs from `getaddrinfo'
example.
* .dir-locals.el: Set `indent-tabs-mode' to `t' for `texinfo-mode'.
|
|
|