Eliminate redundant primitives.