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

Squint -- a peephole optimizer for amacc #87

Closed
wants to merge 32 commits into from
Closed

Commits on Jan 31, 2022

  1. Squint -- a peephole optimizer for amacc

    This pull request is a starting point for discussion on how to integrate
    Squint most effectively with amacc.  It may best be done with separate
    repos that are tied through modules, but I don't know.
    
    I added a -p option to amacc.c that must currently be used with the
    amacc -o option to produce an ELF file that can be optimized with
    scripts/peep.  In order for peep to work, a version of squint must
    be compiled, e.g. gcc -o squint squint.c .
    
    Example:
    
    % gcc -o amacc-gcc amacc.c -ldl
    % ./amacc-gcc -p -o amacc amacc.c
    % scripts/disasm amacc > amacc.s
    % gcc -o squint squint.c
    % scripts/peep amacc
    executable file amacc was optimized.
    % scripts/disasm amacc > amacc.s.opt
    % sdiff -W -d -w 180 amacc.s amacc.s.opt
    
    I have more advanced versions of this that has even beat gcc -O1 for fib.c
    and possibly other things, but I suspect you will not like my coding style,
    so we will have to discuss.
    HPCguy authored and HPCguy committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    0daa102 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2022

  1. Add register allocation for frame variables

    Add sieve.c to benchmark peephole optimization
    Try to clean up some spacing issues
    
    The peephole optimization is 150 lines, but results
    in code slightly faster than gcc -O0.  By adding
    just a few hundred more lines to the peephole
    optimizer, performance can be.  The current
    code strikes a balance between being small,
    educational, and performant.
    HPCguy authored and HPCguy committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    54a2c6d View commit details
    Browse the repository at this point in the history
  2. Simplify peephole frame variable to register transformation

    I traced back a problem to a use-def analysis across a basic block boundary.
    This is not a problem in my private version of Squint which is more complete.
    I "dubded down" the algorithm, so it is no longer faster than gcc -O0, but
    on the other hand, it is not much slower considering how much dumber the
    algorithm is.
    HPCguy authored and HPCguy committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    1ed26e0 View commit details
    Browse the repository at this point in the history
  3. Add High Level document for Squint peephole optimizer.

    Also, so a little more syntax cleanup of squint.c
    HPCguy authored and HPCguy committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    da9fcd4 View commit details
    Browse the repository at this point in the history
  4. Update Squint.md

    HPCguy committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e51fd5c View commit details
    Browse the repository at this point in the history
  5. Update Squint.md

    HPCguy committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    5200479 View commit details
    Browse the repository at this point in the history
  6. Update Squint.md

    HPCguy committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    071a779 View commit details
    Browse the repository at this point in the history
  7. Update Squint.md

    HPCguy committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    cabe649 View commit details
    Browse the repository at this point in the history
  8. Update Squint.md

    HPCguy committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    30d6de1 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2022

  1. Attempt to create test harness for squint optimization

    I'll be honest.  I am flying blind here.  My environment does not
    support any of the features required for the AMaCC test environemtn.
    I just took a wild guess at what was needed, and will likely have
    trouble correcting any errors in what I've done.
    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    966334a View commit details
    Browse the repository at this point in the history
  2. Fix tab expansion in Makefile

    My editor automatically expands tabs to spaces.  WHoops!
    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    489a232 View commit details
    Browse the repository at this point in the history
  3. Add a missing dependency

    Again, just duessing since I can't run any of the test scripts, not even make.
    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    71839b4 View commit details
    Browse the repository at this point in the history
  4. Make a change to try and force a build

    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    7cdbece View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    15fde22 View commit details
    Browse the repository at this point in the history
  6. Merge branch 'squint0' of https://github.com/HPCguy/amacc into squint0

    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    cd443df View commit details
    Browse the repository at this point in the history
  7. Suppress compiler warning

    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    5886dea View commit details
    Browse the repository at this point in the history
  8. aFix Makefile typo and change PD/P0 to PHD/PHR0

    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    df3acee View commit details
    Browse the repository at this point in the history
  9. Try to fix Makefile again without being able to run Makefile locally

    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    90a1682 View commit details
    Browse the repository at this point in the history
  10. Use make -d option to try and remotely debug the make problem

    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    d298f9b View commit details
    Browse the repository at this point in the history
  11. Use make --debug=j to try and get insight into remote make command

    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    3fc43e7 View commit details
    Browse the repository at this point in the history
  12. Restore makefile to default

    HPCguy authored and HPCguy committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    5d3d65d View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2022

  1. Add -p to amacc compile

    HPCguy authored and HPCguy committed Feb 4, 2022
    Configuration menu
    Copy the full SHA
    7e9f5d6 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2022

  1. Try new Makefile created by jserv

    Also, fix a use-def overstep dealing with AMaCC comparison construct.
    HPCguy authored and HPCguy committed Feb 5, 2022
    Configuration menu
    Copy the full SHA
    b1e6349 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2022

  1. Apply clang-format to sieve.c

    HPCguy authored and HPCguy committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    93782cf View commit details
    Browse the repository at this point in the history
  2. Update Squint.md

    HPCguy committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    962534c View commit details
    Browse the repository at this point in the history
  3. Update Squint.md

    HPCguy committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    0c5252b View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2022

  1. Merge branch 'master' into squint0

    HPCguy authored and HPCguy committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    283243c View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2022

  1. Address reviewer issues for Suint.c pull request.

    There is a lot here to keep track of.  It would be nice
    to address any further issues in a subsequent pull request.
    A very small Squint follow-up pull requests is planned to
    improve/finalize squint testing and to add an option to
    configure squint as a shared library in addition to current
    standalone mode.
    HPCguy authored and HPCguy committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    4108d18 View commit details
    Browse the repository at this point in the history
  2. Fix overlooked change needed as a part of fixing reviewer comments.

    HPCguy authored and HPCguy committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    7cdac4b View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2022

  1. Fix issues found by reviewer.

    HPCguy authored and HPCguy committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    d347e5f View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2022

  1. Address reviewer comments.

    HPCguy authored and HPCguy committed Feb 26, 2022
    Configuration menu
    Copy the full SHA
    566d71f View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2022

  1. Move function call check for enhanced safety.

    HPCguy authored and HPCguy committed Mar 8, 2022
    Configuration menu
    Copy the full SHA
    fb40810 View commit details
    Browse the repository at this point in the history