Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shibatch/xpass
A collection of experimental optimizing passes for LLVM
https://github.com/shibatch/xpass
clang compiler llvm llvm-ir llvm-pass optimization sleef
Last synced: about 1 month ago
JSON representation
A collection of experimental optimizing passes for LLVM
- Host: GitHub
- URL: https://github.com/shibatch/xpass
- Owner: shibatch
- License: mit
- Created: 2020-07-06T05:21:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-19T08:45:49.000Z (almost 2 years ago)
- Last Synced: 2023-10-20T04:30:45.016Z (about 1 year ago)
- Topics: clang, compiler, llvm, llvm-ir, llvm-pass, optimization, sleef
- Language: C++
- Homepage:
- Size: 104 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/shibatch/xpass.svg?branch=master)](https://travis-ci.org/shibatch/xpass)
# XPASS - An experimental LLVM pass
This is an experimental optimizing pass for LLVM, named
MathPeephole. This pass performs the following transforms.* a/b + c/d -> (ad + bc) / (bd)
* x/y + z > a/b + c -> (xb - ay) / (yb) + z > c
* a/b + c > d -> b < 0 ? (a - b * (d - c) < 0) : (-(a - b * (d - c)) < 0)
* w sqrt(x) + y > z -> w >= 0 ? ((z < y) | (wwx > (z-y)(z-y))) : ((z <= y) & (wwx < (z-y)(z-y)))This project is based on the llvm-tutor package developed by Andrzej
Warzyński.## Running the passes
```
clang-14 -S -emit-llvm -O1 -ffast-math example.c -o example.ll
opt -load-pass-plugin=libMathPeephole.so -passes=math-peephole example.ll -S -o example.opt.ll
clang-14 -O1 -ffast-math example.opt.ll -o example
```Please see [wiki](https://github.com/shibatch/xpass/wiki) for examples of the transforms.