is an out-of-tree LLVM pass that collapses instances of pointer-integer round-trips into a single GEP (get element pointer) instruction.
Warning
This optimization cannot always be done. Certain strict semantics such as pointer provenance make this kind of thing illegal. However, we can get this translation to verify with physical pointers.
To build the pass:
export $LLVM_DIR=<path/to/llvm/19>
cmake .
makeTo run:
$LLVM_DIR/bin/opt -load-pass-plugin libPtrIntRoundTripRemover.so --passes="ptr-int-round-trip-remover" -disable-output inputs/simple.ll