The X86FixupSeparateStack pass traverses the graph of basic blocks for
a function and tracks which physical registers derive from the stack
register (to point at stack data) at each instruction. It also
modifies each instruction that uses one of those registers as the base
register in a memory operand, unless the register is ESP or EBP. This
is to direct those memory accesses to the stack segment. It also
modifies each instruction that uses EBP as the base register in a
memory operand if EBP does not derive from the stack register at that
instruction. This is to direct those memory accesses to the data
segment.
This pass is enabled with the +separate-stack-seg option.
Can this be done with a command line switch in X86TargetMachine.cpp like VZeroUpper? I don't see that this needs to be a feature bit.