Homework 10
- Due Dec 8, 2016 by 1:50pm
- Points 12
- Submitting a website url
Implement an optimization that turns a call to an x.with.overflow intrinsic into a regular add/subtract/multiply by proving that the operation cannot overflow. Start out by forking the LLVM github repo:
https://github.com/llvm-mirror/llvm Links to an external site.
Then make a branch and implement your code in the branch. Hand in a link to your branch. Your branch must add a test case to the LLVM test suite showing that the check gets eliminated. Your optimization must be sound: it must never eliminate an overflow check that could overflow. LLVM without your changes must not be capable of eliminating the overflow check. You may use any dataflow analysis you like (known bits, lazy value info, etc.) or you may implement a pattern-based optimization in the instruction combiner. Your hacked LLVM must pass all of the tests in a "make check" including the new test(s) that you write. You do not need to demonstrate the capability of eliminating an overflow check in a real program.