{"id":13622199,"url":"https://github.com/google/souper","last_synced_at":"2025-05-15T04:06:07.092Z","repository":{"id":15719933,"uuid":"18458047","full_name":"google/souper","owner":"google","description":"A superoptimizer for LLVM IR","archived":false,"fork":false,"pushed_at":"2024-08-28T04:33:42.000Z","size":2383,"stargazers_count":2218,"open_issues_count":95,"forks_count":173,"subscribers_count":63,"default_branch":"main","last_synced_at":"2025-04-19T22:27:39.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-04-05T02:09:09.000Z","updated_at":"2025-04-18T12:26:25.000Z","dependencies_parsed_at":"2023-02-17T00:01:34.922Z","dependency_job_id":"e1940a69-2f20-42cd-b4f2-8894a765d0f2","html_url":"https://github.com/google/souper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fsouper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fsouper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fsouper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fsouper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/souper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:15.616Z","updated_at":"2025-05-15T04:06:02.081Z","avatar_url":"https://github.com/google.png","language":"C++","readme":"Souper is a superoptimizer for LLVM IR. It uses an SMT solver to help identify\nmissing peephole optimizations in LLVM's midend optimizers.\n\nThe architecture and concepts of Souper are described in [Souper: A synthesizing superoptimizer](https://arxiv.org/pdf/1711.04422.pdf).\n\n# Requirements\n\nSouper should work on any reasonably modern Linux or OS X machine.\n\nYou will need a reasonably modern compiler toolchain. LLVM has instructions\non how to get one for Linux:\nhttp://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain\n\nYou will also need CMake to build Souper and its dependencies, and the zstd\nlibrary from your package manager or from Homebrew.\n\n# Building Souper\n\n1. Download and build dependencies:\n```\n$ ./build_deps.sh $buildtype $extra_cmake_flags\n```\n   $buildtype is optional; it defaults to Release and may be set to any LLVM\n   build type.\n   $extra_cmake_flags is optional. It is passed to CMake.\n\n2. Run CMake from a build directory:\n```\n$ mkdir /path/to/souper-build\n$ cd /path/to/souper-build\n$ cmake -DCMAKE_BUILD_TYPE=$buildtype /path/to/souper\n```\n   Again, the build type is optional and defaults to Release. In any case it\n   must match the build type used when compiling the dependencies.\n\n3. Run 'make' from the build directory.\n\n4. Optionally run 'make check' to run Souper's test suite. To run the test suite\n   under Valgrind, run 'make check LIT_ARGS=\"-v --vg --vg-leak\"' instead. By\n   default the solver is also run under Valgrind. This can be disabled by\n   by adding --vg-arg=--trace-children-skip=/path/to/solver to LIT_ARGS.\n\nNote that GCC 4.8 and earlier have a bug in handling multiline string\nliterals. You should build Souper using GCC 4.9+ or Clang.\n\n# Using Souper\n\nAfter following the above instructions, you will have a Souper\nexecutable in /path/to/souper-build/souper and a Clang executable in\n/path/to/souper/third_party/llvm/$buildtype/bin/clang.  You can use the\nClang executable to create an LLVM bitcode file like this:\n```\n$ /path/to/clang -emit-llvm -c -o /path/to/file.bc /path/to/file.c\n```\n\nFor example:\n```\n$ /path/to/souper -z3-path=/usr/bin/z3 /path/to/file.bc\n```\n\nSouper will extract SMT queries from the bitcode file and pass them to\na solver. Unsatisfiable queries (which represent missed optimization\nopportunities) will cause Souper to print its internal representation\nof the optimizable expression along with the shorter expression that\nrefines the original one.\n\nAlternatively, you may immediately let Souper modify the bitcode and let\nit apply the missed optimization opportunities by using the Souper llvm opt\npass. When loaded the pass will automatically register itself to run after\nLLVM's regular peephole optimizations.\n\nFor example:\n```\n$ /path/to/clang -Xclang -load -Xclang /path/to/libsouperPass.so \\\n                 -mllvm -z3-path=/usr/bin/z3 /path/to/file.c\n```\n\nOr to run the pass on its own:\n```\n$ /path/to/opt -load /path/to/libsouperPass.so -souper \\\n               -z3-path=/usr/bin/z3 -o /path/to/file.opt.bc \\\n               /path/to/file.bc\n```\n\nOr use the drop-in compiler replacements sclang and sclang++:\n```\n$ /path/to/configure CC=/path/to/sclang CXX=/path/to/sclang++\n$ make\n```\n\nCompilation using Souper can be sped up by caching queries. By default, Souper\nuses a non-persistent RAM-based cache. The -souper-external-cache flag causes\nSouper to cache its queries in a Redis database. For this to work, Redis \u003e=\n1.2.0 must be installed on the machine where you are running Souper and a Redis\nserver must be listening on the default port (6379).\n\nsclang uses external caching by default since this often gives a substantial\nspeedup for large compilations. This behavior may be disabled by setting the\nSOUPER_NO_EXTERNAL_CACHE environment variable. Souper's Redis cache does not yet\nhave any support for versioning; you should stop Redis and delete its dump file\nany time Souper is upgraded.\n\n# Disclaimer\n\nPlease note that although some of the authors are employed by Google, this\nis not an official Google product.\n","funding_links":[],"categories":["C++","Other","Starchart"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fsouper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fsouper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fsouper/lists"}