X86RetpolineThunks had been implemented as a MachineFunctionPass. Its behavior is to examine each function in a module, and determine whether that function requires the X86 retpoline feature. If so, retpoline thunk(s) are inserted into the module, if they have not been inserted already. This behavior seems to make more sense as a ModulePass.
In this patch, runOnModule() iterates through all of the functions in the module. As soon as a function requiring retpolines is encountered, the retpoline thunk is inserted and populated. This is probably more efficient than the prior implementation, and it also does not require the pass to carry around any internal state.
One consequence of making this a ModulePass is that it seems to affect the ordering of suffix generation for temporary symbols. Therefore some regression tests needed to be lightly edited.