[X86][CodeGen] Do not add `offset` for memory reference using symbol
In the past, D71436 added writing the `offset` operator for some legitimate cases. However, for memory references in Intel syntax, the `offset` operator (`[offset sym]`) appears to be superfluous at best, possibly wrong and contradictory at worst. This patch bypasses writing the `offset` operator in `X86AsmPrinter::PrintIntelMemReference` which affects exactly this case. A similar code flow exists in `X86IntelInstPrinter.cpp` - `X86IntelInstPrinter::printMemReference`. The motivation for fixing this output is to allow us to reject the confusing `call [offset fn_ref]` syntax in MC, as discussed in D149579. Depends on D149579 Differential Revision: https://reviews.llvm.org/D150047
Loading
Please sign in to comment