Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redebug #1583

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open

Redebug #1583

wants to merge 37 commits into from

Commits on May 16, 2024

  1. translate: rearrange

    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    4bb2e2d View commit details
    Browse the repository at this point in the history
  2. Destroy old compiler debug info mechanism

    I'm going to remake it entirely and this is a rare opportunity
    where I can start mostly from scratch without breaking
    everything. (tests now fail, so some things are still broken)
    
    Bytecode debug info is fine & will be fine since it's fine.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    35ef606 View commit details
    Browse the repository at this point in the history
  3. define lambda lists for DIBuilder extern defmethods

    to make it easier to use them
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    6fe8690 View commit details
    Browse the repository at this point in the history
  4. Start on new debug info system

    It works well enough to get function names and arguments into
    backtraces. Which is really pretty much everything since argument
    parsing is hard, so.
    
    It's probably busted w/r/t inlining.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    4b4df0a View commit details
    Browse the repository at this point in the history
  5. Disable inlining & enable new DWARF generation

    Inlining is where the DWARF generation gets complicated. I also
    want to pretty much completely overhaul how inlining works.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    ef36513 View commit details
    Browse the repository at this point in the history
  6. integrate arguments processing code into clasp-cleavir more

    the *argument-out* thing is a holdover from bclasp
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    eca6338 View commit details
    Browse the repository at this point in the history
  7. arguments processor can use LOOP now

    since it's only loaded very late after clasp-cleavir, unlike before
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    24d8feb View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6a4a437 View commit details
    Browse the repository at this point in the history
  9. Allow wrong-number-of-arguments to have just a function's name

    I want to use the argument processor for inline bodies, so there
    may not actually be a closure.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    3326d48 View commit details
    Browse the repository at this point in the history
  10. Move register-save-area handling into translate

    It's not really part of argument parsing, so it doesn't belong in
    the "calling convention" code at all.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    cb6ed18 View commit details
    Browse the repository at this point in the history
  11. Make the argument processor for-effect

    I don't think it has been able to return false for years, and I'm
    not sure why it ever would.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    4571a70 View commit details
    Browse the repository at this point in the history
  12. reorient optional argument processor to not compute nremaining

    I'm going to have all these return a list of arguments instead, so
    returning the number remaining is no good.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    1af73df View commit details
    Browse the repository at this point in the history
  13. Integrate argument processing into clasp-cleavir

    and remove the confusing calling-convention stuff. And unify the
    code so that the required-and-optionals case works efficiently
    without having its own code.
    
    Moving towards being able to process arguments in the middle of a
    function (for an inline call).
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    a365f50 View commit details
    Browse the repository at this point in the history
  14. have argument parser return arguments instead of side effecting

    should make it easier to use for local calls. bonus: no weird
    dependence on *datum-values* in xep layouter.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    d30902f View commit details
    Browse the repository at this point in the history
  15. Have argument processor handle casting

    This will be needed to use it for local calls.
    
    I skipped &key because I couldn't bear to make that code even
    crazier. Also, &rest arguments are always boxed, which we could
    maybe fix at some point.
    
    In the future we should probably force suppliedp parameters to be
    boolean rtype, cos what else would they even be.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    6fb6158 View commit details
    Browse the repository at this point in the history
  16. No more separate argument processing for local calls

    Unifying this makes translate much less messy with all that
    duplicate code, and makes it possible to local call anything,
    including functions with &rest and/or &key parameters. Also means
    we don't have to allocate a closure for local calls ever - that was
    super dumb and I'm disappointed in myself for ever thinking it was
    a good idea.
    
    Argument parsing for local calls is moved into the caller in all
    cases now. That may be a bit suboptimal for local functions that
    are called in more than one place, since the parsing code is
    duplicated. I really doubt that will be a big deal except _maybe_
    for functions with &key, since key parsing is actually a fair bit
    of code. But &key functions are already kind of doomed as far as
    optimization goes, and local functions that are called in multiple
    places are rare to begin with (only arising from flet/labels,
    versus the much more common type checkers and m-v-bind lambdas) so
    I'm not too worried. The Right Thing To Do long term is probably
    to do as karlosz suggested years ago and represent XEPs explicitly
    in the IR. A shorter term fix would be to create pseudo-XEPs for
    these functions - "pseudo" in that they would parse arbitrary
    arguments, but take the environment as individual arguments instead
    of as an allocated closure.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    6bc98e2 View commit details
    Browse the repository at this point in the history
  17. Add return-type to mangled wrapper names

    yitzchak authored and Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    013faca View commit details
    Browse the repository at this point in the history
  18. Use LLVM's poison instead of undef in most places

    poison seems to be the wave of the future (LLVM docs currently say
    to use it instead of undef whenever possible). It's
    "more undefined" than undef, so it might help LLVM passes do more
    optimization. Though I don't know how much it matters in practice.
    
    I left in a few undefs I didn't immediately understand the context
    of, but those can probably be poison too.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    41c8c91 View commit details
    Browse the repository at this point in the history
  19. Make backtraces a little better at optimized code

    When LLVM optimization is on, it will often inline functions, and
    in particular will inline core functions into their XEPs. The
    DWARF information will reflect this inlining, so the address range
    for a given return address may be of the inline function body
    rather than that of the actual entry point. And that would break
    backtraces.
    
    This fix ignores the address ranges of the return address, instead
    just checking the ranges of the object file's literal functions.
    That works, but ideally we would use the DWARF information to give
    us information about inlined functions. Also, with optimization on
    a few tests on backtraces fail, so that also needs fixing.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    2f9ed4f View commit details
    Browse the repository at this point in the history
  20. Delete unused code

    No idea what this is, but nothing actually uses it
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    d28a1e4 View commit details
    Browse the repository at this point in the history
  21. Move LLVM optimization outside of with-module macro

    Doing it in a macro is just kind of error prone. COMPILE was not
    doing optimization because the macro didn't have an optimizer
    listed. And what kind of non-LLVM optimizer function would we even
    use to optimize an LLVM module?
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    8ef8e97 View commit details
    Browse the repository at this point in the history
  22. Make arguments available in optimized function backtraces

    As long as the register save area is generated we should be able to
    get arguments.
    I honestly don't understand why the meat of this change - getting
    the function description from the closure - is necessary, since I
    would think the fd is available from the entry point. Whatever.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    f36d8b6 View commit details
    Browse the repository at this point in the history
  23. Actually use LLVM optimizations

    buildPerModuleDefaultPipeline does not operate by side effect.
    
    We should probably wrap all the optimization pipeline/passes stuff,
    or at least what we use, so as to experiment with what actually
    helps. Right now we just do -O3 depending on a dynamic variable,
    which isn't amazing.
    
    I also disabled the inline threshold change. I'm seeing plenty of
    inlining even with the default threshold.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    8f4d012 View commit details
    Browse the repository at this point in the history
  24. Delete inline AST re-sourcing code

    It's ugly and I have a better way. Hopefully. Not yet. This means
    that inline function source locations are in the wrong place.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    5fd7f04 View commit details
    Browse the repository at this point in the history
  25. new debuginfo: handle functions with different source files

    you know, for inlining. This fixes source info for inlined calls.
    (If LLVM is doing the inlining, anyway.)
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    97617d0 View commit details
    Browse the repository at this point in the history
  26. Make defaultEntryAddress/arityEntryAddress functions non virtual

    arityEntryAddress is something I added while debugging backtraces
    and I suppose we may as well keep it around.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    9d37198 View commit details
    Browse the repository at this point in the history
  27. Update Cleavir

    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    d3b1ff4 View commit details
    Browse the repository at this point in the history
  28. clasp-cleavir: allow non-object rtypes in come-from

    having them is probably inefficient but there's no reason we can't
    generate the appropriate code to box and unbox.
    
    The ANSI test MISC-105 was failing without this, because with
    later inlining an unwind actually remains an unwind. Something to
    look into before merge.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    2a081e7 View commit details
    Browse the repository at this point in the history
  29. Fix SPI lineno extraction

    Missed a value. Oops
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    64fa5e1 View commit details
    Browse the repository at this point in the history
  30. Handle logical pathnames in debug info at lower level

    rather than explicitly specifying :source or w/e
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    889f73b View commit details
    Browse the repository at this point in the history
  31. Use ensure-difile uniformly

    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    9a6247f View commit details
    Browse the repository at this point in the history
  32. Remove unused parameters

    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    119fe7e View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    6bce0d9 View commit details
    Browse the repository at this point in the history
  34. Output DWARF info for local variables

    Nothing seems to be showing up, though. Very weird.
    Bike committed May 16, 2024
    Configuration menu
    Copy the full SHA
    5b40490 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Configuration menu
    Copy the full SHA
    9d9e41e View commit details
    Browse the repository at this point in the history
  2. Define direct pathname reader for SPIs

    Saves a bunch of code to go through file scopes, which are arguably
    unnecessary anyway, and definitely an irrelevant implementation
    detail.
    Bike committed May 17, 2024
    Configuration menu
    Copy the full SHA
    ad39129 View commit details
    Browse the repository at this point in the history
  3. More source pos info cleanup

    Bike committed May 17, 2024
    Configuration menu
    Copy the full SHA
    abd44ac View commit details
    Browse the repository at this point in the history