diff options
author | Joshua Cranmer <joshua.cranmer@intel.com> | 2022-12-20 11:02:11 -0500 |
---|---|---|
committer | Joshua Cranmer <joshua.cranmer@intel.com> | 2022-12-20 11:02:11 -0500 |
commit | e6b02214c68df2c9f826e02310c9352ac652e456 (patch) | |
tree | 81280c3f2a940610cd7f2e55393ac618a56c4025 /llvm/lib/IR/DataLayout.cpp | |
parent | e43924a75145d2f9e722f74b673145c3e62bfd07 (diff) | |
download | llvm-e6b02214c68df2c9f826e02310c9352ac652e456.zip llvm-e6b02214c68df2c9f826e02310c9352ac652e456.tar.gz llvm-e6b02214c68df2c9f826e02310c9352ac652e456.tar.bz2 |
[IR] Add a target extension type to LLVM.
Target-extension types represent types that need to be preserved through
optimization, but otherwise are not introspectable by target-independent
optimizations. This patch doesn't add any uses of these types by an existing
backend, it only provides basic infrastructure such that these types would work
correctly.
Reviewed By: nikic, barannikov88
Differential Revision: https://reviews.llvm.org/D135202
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r-- | llvm/lib/IR/DataLayout.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index 4bd0887..fb331ee 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -816,6 +816,10 @@ Align DataLayout::getAlignment(Type *Ty, bool abi_or_pref) const { } case Type::X86_AMXTyID: return Align(64); + case Type::TargetExtTyID: { + Type *LayoutTy = cast<TargetExtType>(Ty)->getLayoutType(); + return getAlignment(LayoutTy, abi_or_pref); + } default: llvm_unreachable("Bad type for getAlignment!!!"); } |