https://github.com/xhacker/bitcast-legalization-pass
An LLVM pass for legalizing bitcast from illegal types
https://github.com/xhacker/bitcast-legalization-pass
Last synced: over 1 year ago
JSON representation
An LLVM pass for legalizing bitcast from illegal types
- Host: GitHub
- URL: https://github.com/xhacker/bitcast-legalization-pass
- Owner: xhacker
- Created: 2016-03-19T05:34:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-06T00:35:38.000Z (over 10 years ago)
- Last Synced: 2025-01-29T08:24:31.701Z (over 1 year ago)
- Language: LLVM
- Size: 12.7 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bitcast Legalization Pass
## Motivation
If LLVM IR code uses bitcasts from vectors with illegal element types, the resulting assembly or machine code generated by the backend could be incorrect. This pass implements a simple workaround to this problem. For more information, see [I2Result Demo](http://parabix.costar.sfu.ca/wiki/I2Result).
## Build and Run Using `cmake`, `make`, and `opt`
```sh
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make
cd ..
opt -S -load build/BitcastLegalization/libBitcastLegalization.so -bitcastlegalization < tests/i1.ll
```
## Build and Run Using Xcode and `opt`
```sh
mkdir xcode
cd xcode
cmake -G "Xcode" ..
# Open Xcode and build
cd ..
opt -S -load xcode/BitcastLegalization/Debug/libBitcastLegalization.so -bitcastlegalization < tests/i1.ll
```
## Run Tests
The following runs a test that shows that the pass avoids the problem mentioned in the page linked above.
```sh
cd tests
./run.sh pr2
```