Teach GatherAllAliases to reason about inline assembly nodes and
associated glued CopyToReg/CopyFromReg nodes.
This fixes PR9517.
"If this had a glued output, return C"?
I don't follow why it matters if the output is glued, given there isn't a glue input. If I'm understanding correctly, if the copy isn't glued, in it doesn't modify memory. If the copy is glued, the only way to reach this case should be through a recursive call of ImproveChain. Or are you just trying to be conservative here?
In terms of the actual checks here, is this sufficient to catch any inline asm that accesses memory? Do you need to check for Extra_HasSideEffects? Do you need to check for "indirect" operands separately? (I think it's possible to write an indirect register operand in IR, although I'm not sure clang ever generates them...)
SelectionDAGBuilder updates the inlineasm's ExtraInfo based on the asm parameter constraints so checking extra info should be should be sufficient.
Also, a check for HasExtraSideEffects is probably needed. I've updated the patch as such.