[PATCH] D135202: [IR] Add an opaque type to LLVM.

Joshua Cranmer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 13:47:37 PDT 2022


jcranmer-intel updated this revision to Diff 473023.
jcranmer-intel added a comment.

Major update.

The big change is the great renaming from "opaque type" to "target extension
type". There's still a few places that haven't had there name updated yet. Fixes
to documentation are still needed as well.

In addition, this creates a notion of type properties that is used to fix some
of the issues mentioned above. There is a major unresolved question in this
update as to where the logic to get the type properties of a target extension
type should be located. I see 4 options:

1. Specified during type creation.
2. Attach to the module akin to existing identified struct type logic.
3. Attach to DataLayout via the datalayout string or something similar.
4. Lookup table built-in to LLVM.

[Note that the current implementation, a static function in Type.cpp, is not any
of these options, but it is most similar to option 4, although I would replace
that with something tablegen-driven most likely, like existing `Attributes.td`.]

These options are laid out from most to least flexible. While I'm not entirely
happy with how option 4 requires modification to LLVM to effectively add new
target extension types, it would make it about as difficult to add a new type as
it would be to add a new attribute, which seems appropriate.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135202/new/

https://reviews.llvm.org/D135202

Files:
  llvm/docs/BitCodeFormat.rst
  llvm/docs/LangRef.rst
  llvm/include/llvm-c/Core.h
  llvm/include/llvm-c/Types.h
  llvm/include/llvm/AsmParser/LLParser.h
  llvm/include/llvm/Bitcode/LLVMBitCodes.h
  llvm/include/llvm/IR/Constants.h
  llvm/include/llvm/IR/DataLayout.h
  llvm/include/llvm/IR/DerivedTypes.h
  llvm/include/llvm/IR/Type.h
  llvm/include/llvm/IR/Value.def
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/IR/AsmWriter.cpp
  llvm/lib/IR/Constants.cpp
  llvm/lib/IR/Core.cpp
  llvm/lib/IR/DataLayout.cpp
  llvm/lib/IR/Function.cpp
  llvm/lib/IR/LLVMContextImpl.cpp
  llvm/lib/IR/LLVMContextImpl.h
  llvm/lib/IR/Type.cpp
  llvm/lib/Transforms/Scalar/SROA.cpp
  llvm/lib/Transforms/Utils/VNCoercion.cpp
  llvm/test/Assembler/invalid-opaque-type-mixed.ll
  llvm/test/Assembler/target-type-mangled.ll
  llvm/test/Assembler/target-type-params.ll
  llvm/test/Assembler/target-types.ll
  llvm/test/Transforms/GVN/target-type.ll
  llvm/test/Transforms/SROA/sroa-target.ll
  llvm/tools/llvm-c-test/echo.cpp
  llvm/unittests/IR/TypesTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135202.473023.patch
Type: text/x-patch
Size: 38636 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221103/d49628eb/attachment.bin>


More information about the llvm-commits mailing list