[InlineAsm] Add support for address operands ("p").
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 22 Mar 2022 09:39:07 +0000 (10:39 +0100)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 13 Apr 2022 10:50:21 +0000 (12:50 +0200)
commit46f83caebc8f2329bcf16b3edf6785dff480c5e3
tree6fbcb28ad27d32c8a09c40dff751e2060896eedb
parent6d3224d93f010fdad74b3244620042629dc7eeec
[InlineAsm] Add support for address operands ("p").

This patch adds support for inline assembly address operands using the "p"
constraint on X86 and SystemZ.

This was in fact broken on X86 (see example at
https://reviews.llvm.org/D110267, Nov 23).

These operands should probably be treated the same as memory operands by
CodeGenPrepare, which have been commented with "TODO" there.

Review: Xiang Zhang and Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D122220
15 files changed:
clang/lib/Basic/Targets/SystemZ.h
clang/lib/Basic/Targets/X86.cpp
clang/test/CodeGen/SystemZ/systemz-inline-asm-03.c [new file with mode: 0644]
clang/test/CodeGen/asm.c
llvm/docs/LangRef.rst
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/include/llvm/IR/InlineAsm.h
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/SystemZ/inline-asm-addr.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/inline-asm-p-constraint.ll [new file with mode: 0644]