[X86][AsmParser] re-introduce 'offset' operator
authorEric Astor <epastor@google.com>
Mon, 30 Dec 2019 19:33:56 +0000 (14:33 -0500)
committerEric Astor <epastor@google.com>
Mon, 30 Dec 2019 19:35:26 +0000 (14:35 -0500)
commit4a7aa252a32a94b1bb61b3dc7f027b4a27ae334f
tree3f0579bbc96ff818ae4bc5de945b687f72d2f586
parent7fa0bfe7d580e2b96b8d7f5bd0470287857e84cc
[X86][AsmParser] re-introduce 'offset' operator

Summary:
Amend MS offset operator implementation, to more closely fit with its MS counterpart:

    1. InlineAsm: evaluate non-local source entities to their (address) location
    2. Provide a mean with which one may acquire the address of an assembly label via MS syntax, rather than yielding a memory reference (i.e. "offset asm_label" and "$asm_label" should be synonymous
    3. address PR32530

Based on http://llvm.org/D37461

Fix broken test where the break appears unrelated.

- Set up appropriate memory-input rewrites for variable references.

- Intel-dialect assembly printing now correctly handles addresses by adding "offset".

- Pass offsets as immediate operands (using "r" constraint for offsets of locals).

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D71436
14 files changed:
clang/lib/Sema/SemaStmtAsm.cpp
clang/test/CodeGen/ms-inline-asm-64.c
clang/test/CodeGen/ms-inline-asm.c
clang/test/CodeGen/ms-inline-asm.cpp
clang/test/Parser/ms-inline-asm.c
llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h
llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/lib/Target/X86/AsmParser/X86Operand.h
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/X86/ms-inline-asm.ll
llvm/test/CodeGen/X86/offset-operator.ll [new file with mode: 0644]
llvm/test/MC/X86/pr32530.s [new file with mode: 0644]