Algorithms for Improving the Automatically Synthesized Instruction Set of an Extensible Processor (Full Report)