Shift Left Right Fixes for Code Gen and Optimization