Reapply: IR: add optional type to 'byval' function parameters
authorTim Northover <tnorthover@apple.com>
Thu, 30 May 2019 18:48:23 +0000 (18:48 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 30 May 2019 18:48:23 +0000 (18:48 +0000)
commitb7141207a483d39b99c2b4da4eb3bb591eca9e1a
tree17be3c9e9f0ba7f9493e2279d5df0e029533d910
parent7fecdf36cc5b41dc5ad85d58c6e3b97b4fce6d00
Reapply: IR: add optional type to 'byval' function parameters

When we switch to opaque pointer types we will need some way to describe
how many bytes a 'byval' parameter should occupy on the stack. This adds
a (for now) optional extra type parameter.

If present, the type must match the pointee type of the argument.

The original commit did not remap byval types when linking modules, which broke
LTO. This version fixes that.

Note to front-end maintainers: if this causes test failures, it's probably
because the "byval" attribute is printed after attributes without any parameter
after this change.

llvm-svn: 362128
45 files changed:
llvm/docs/LangRef.rst
llvm/docs/ReleaseNotes.rst
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/include/llvm/IR/Argument.h
llvm/include/llvm/IR/Attributes.h
llvm/include/llvm/IR/CallSite.h
llvm/include/llvm/IR/Function.h
llvm/include/llvm/IR/InstrTypes.h
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/AsmParser/LLParser.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/IR/AttributeImpl.h
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/Function.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Linker/IRMover.cpp
llvm/lib/Transforms/Utils/ValueMapper.cpp
llvm/test/Assembler/byval-type-attr.ll [new file with mode: 0644]
llvm/test/Assembler/invalid-byval-type1.ll [new file with mode: 0644]
llvm/test/Assembler/invalid-byval-type2.ll [new file with mode: 0644]
llvm/test/Assembler/invalid-byval-type3.ll [new file with mode: 0644]
llvm/test/Bitcode/Inputs/byval-upgrade.bc [new file with mode: 0644]
llvm/test/Bitcode/attributes-3.3.ll
llvm/test/Bitcode/attributes.ll
llvm/test/Bitcode/byval-upgrade.test [new file with mode: 0644]
llvm/test/Bitcode/compatibility-3.6.ll
llvm/test/Bitcode/compatibility-3.7.ll
llvm/test/Bitcode/compatibility-3.8.ll
llvm/test/Bitcode/compatibility-3.9.ll
llvm/test/Bitcode/compatibility-4.0.ll
llvm/test/Bitcode/compatibility-5.0.ll
llvm/test/Bitcode/compatibility-6.0.ll
llvm/test/Bitcode/compatibility.ll
llvm/test/Bitcode/highLevelStructure.3.2.ll
llvm/test/CodeGen/AArch64/byval-type.ll [new file with mode: 0644]
llvm/test/Linker/Inputs/byval-types-1.ll [new file with mode: 0644]
llvm/test/Linker/byval-types.ll [new file with mode: 0644]
llvm/test/Transforms/Inline/byval-tail-call.ll
llvm/unittests/IR/AttributesTest.cpp