summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2019-07-08 17:47:43 +0000
committerYonghong Song <yhs@fb.com>2019-07-08 17:47:43 +0000
commit0d566dbbae14fb0c94251f979c2eb67e94e8be7d (patch)
tree4db2289c290fd5003938ceeb283d2839d381c240 /llvm
parenta9d5c186e2240f04eb5199ef32e26c767de8cc3f (diff)
downloadbcm5719-llvm-0d566dbbae14fb0c94251f979c2eb67e94e8be7d.tar.gz
bcm5719-llvm-0d566dbbae14fb0c94251f979c2eb67e94e8be7d.zip
Revert "[BPF] add new intrinsics preserve_{array,union,struct}_access_index"
This reverts commit r365352. Test ThinLTO/X86/lazyload_metadata.ll failed. Revert the commit and at the same time to fix the issue. llvm-svn: 365360
Diffstat (limited to 'llvm')
-rw-r--r--llvm/docs/LangRef.rst103
-rw-r--r--llvm/include/llvm/IR/IRBuilder.h68
-rw-r--r--llvm/include/llvm/IR/Intrinsics.td17
-rw-r--r--llvm/include/llvm/IR/LLVMContext.h1
-rw-r--r--llvm/lib/IR/LLVMContext.cpp1
5 files changed, 1 insertions, 189 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index e15c0a3acb0..ae266629a64 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -17304,106 +17304,3 @@ Lowering:
"""""""""
Lowers to a call to `objc_storeWeak <https://clang.llvm.org/docs/AutomaticReferenceCounting.html#arc-runtime-objc-storeweak>`_.
-
-Preserving Debug Information Intrinsics
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-These intrinsics are used to carry certain debuginfo together with
-IR-level operations. For example, it may be desirable to
-know the structure/union name and the original user-level field
-indices. Such information got lost in IR GetElementPtr instruction
-since the IR types are different from debugInfo types and unions
-are converted to structs in IR.
-
-'``llvm.preserve.array.access.index``' Intrinsic
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Syntax:
-"""""""
-::
-
- declare <type2>
- @llvm.preserve.array.access.index.p0s_union.anons.p0a10s_union.anons(<type> base,
- i32 dim,
- i32 index)
-
-Overview:
-"""""""""
-
-The '``llvm.preserve.array.access.index``' intrinsic returns the getelementptr address
-based on array base ``base``, array dimension ``dim`` and the last access index ``index``
-into the array.
-
-Arguments:
-""""""""""
-
-The ``base`` is the array base address. The ``dim`` is the array dimension.
-The ``base`` is a pointer if ``dim`` equals 0.
-The ``index`` is the last access index into the array or pointer.
-
-Semantics:
-""""""""""
-
-The '``llvm.preserve.array.access.index``' intrinsic produces the same result
-as a getelementptr with base ``base`` and access operands ``{dim's 0's, index}``.
-
-'``llvm.preserve.union.access.index``' Intrinsic
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Syntax:
-"""""""
-::
-
- declare <type>
- @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(<type> base,
- i32 di_index)
-
-Overview:
-"""""""""
-
-The '``llvm.preserve.union.access.index``' intrinsic carries the debuginfo field index
-``di_index`` and returns the ``base`` address.
-The ``llvm.preserve.access.index`` type of metadata is attached to this call instruction
-to provide union debuginfo type.
-
-Arguments:
-""""""""""
-
-The ``base`` is the union base address. The ``di_index`` is the field index in debuginfo.
-
-Semantics:
-""""""""""
-
-The '``llvm.preserve.union.access.index``' intrinsic returns the ``base`` address.
-
-'``llvm.preserve.struct.access.index``' Intrinsic
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Syntax:
-"""""""
-::
-
- declare <type2>
- @llvm.preserve.struct.access.index.p0i8.p0s_struct.anon.0s(<type> base,
- i32 gep_index,
- i32 di_index)
-
-Overview:
-"""""""""
-
-The '``llvm.preserve.struct.access.index``' intrinsic returns the getelementptr address
-based on struct base ``base`` and IR struct member index ``gep_index``.
-The ``llvm.preserve.access.index`` type of metadata is attached to this call instruction
-to provide struct debuginfo type.
-
-Arguments:
-""""""""""
-
-The ``base`` is the structure base address. The ``gep_index`` is the struct member index
-based on IR structures. The ``di_index`` is the struct member index based on debuginfo.
-
-Semantics:
-""""""""""
-
-The '``llvm.preserve.struct.access.index``' intrinsic produces the same result
-as a getelementptr with base ``base`` and access operands ``{0, gep_index}``.
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index a74364dffb2..552ea3ef7a1 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -2453,74 +2453,6 @@ public:
return V;
}
- Value *CreatePreserveArrayAccessIndex(Value *Base, unsigned Dimension,
- unsigned LastIndex) {
- assert(isa<PointerType>(Base->getType()) &&
- "Invalid Base ptr type for preserve.array.access.index.");
- auto *BaseType = Base->getType();
-
- Value *LastIndexV = getInt32(LastIndex);
- Constant *Zero = ConstantInt::get(Type::getInt32Ty(Context), 0);
- SmallVector<Value *, 4> IdxList;
- for (unsigned I = 0; I < Dimension; ++I)
- IdxList.push_back(Zero);
- IdxList.push_back(LastIndexV);
-
- Type *ResultType =
- GetElementPtrInst::getGEPReturnType(Base, IdxList);
-
- Module *M = BB->getParent()->getParent();
- Function *FnPreserveArrayAccessIndex = Intrinsic::getDeclaration(
- M, Intrinsic::preserve_array_access_index, {ResultType, BaseType});
-
- Value *DimV = getInt32(Dimension);
- CallInst *Fn =
- CreateCall(FnPreserveArrayAccessIndex, {Base, DimV, LastIndexV});
-
- return Fn;
- }
-
- Value *CreatePreserveUnionAccessIndex(Value *Base, unsigned FieldIndex,
- MDNode *DbgInfo) {
- assert(isa<PointerType>(Base->getType()) &&
- "Invalid Base ptr type for preserve.union.access.index.");
- auto *BaseType = Base->getType();
-
- Module *M = BB->getParent()->getParent();
- Function *FnPreserveUnionAccessIndex = Intrinsic::getDeclaration(
- M, Intrinsic::preserve_union_access_index, {BaseType, BaseType});
-
- Value *DIIndex = getInt32(FieldIndex);
- CallInst *Fn =
- CreateCall(FnPreserveUnionAccessIndex, {Base, DIIndex});
- Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
-
- return Fn;
- }
-
- Value *CreatePreserveStructAccessIndex(Value *Base, unsigned Index,
- unsigned FieldIndex, MDNode *DbgInfo) {
- assert(isa<PointerType>(Base->getType()) &&
- "Invalid Base ptr type for preserve.struct.access.index.");
- auto *BaseType = Base->getType();
-
- Value *GEPIndex = getInt32(Index);
- Constant *Zero = ConstantInt::get(Type::getInt32Ty(Context), 0);
- Type *ResultType =
- GetElementPtrInst::getGEPReturnType(Base, {Zero, GEPIndex});
-
- Module *M = BB->getParent()->getParent();
- Function *FnPreserveStructAccessIndex = Intrinsic::getDeclaration(
- M, Intrinsic::preserve_struct_access_index, {ResultType, BaseType});
-
- Value *DIIndex = getInt32(FieldIndex);
- CallInst *Fn = CreateCall(FnPreserveStructAccessIndex,
- {Base, GEPIndex, DIIndex});
- Fn->setMetadata(LLVMContext::MD_preserve_access_index, DbgInfo);
-
- return Fn;
- }
-
private:
/// Helper function that creates an assume intrinsic call that
/// represents an alignment assumption on the provided Ptr, Mask, Type
diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index 62e94108a73..ecc99eca172 100644
--- a/llvm/include/llvm/IR/Intrinsics.td
+++ b/llvm/include/llvm/IR/Intrinsics.td
@@ -1040,6 +1040,7 @@ def int_clear_cache : Intrinsic<[], [llvm_ptr_ty, llvm_ptr_ty],
// Intrinsic to detect whether its argument is a constant.
def int_is_constant : Intrinsic<[llvm_i1_ty], [llvm_any_ty], [IntrNoMem], "llvm.is.constant">;
+
//===-------------------------- Masked Intrinsics -------------------------===//
//
def int_masked_store : Intrinsic<[], [llvm_anyvector_ty,
@@ -1213,22 +1214,6 @@ def int_loop_decrement_reg :
def int_ssa_copy : Intrinsic<[llvm_any_ty], [LLVMMatchType<0>],
[IntrNoMem, Returned<0>]>;
-
-//===------- Intrinsics that are used to preserve debug information -------===//
-
-def int_preserve_array_access_index : Intrinsic<[llvm_anyptr_ty],
- [llvm_anyptr_ty, llvm_i32_ty,
- llvm_i32_ty],
- [IntrNoMem, ImmArg<1>, ImmArg<2>]>;
-def int_preserve_union_access_index : Intrinsic<[llvm_anyptr_ty],
- [llvm_anyptr_ty, llvm_i32_ty],
- [IntrNoMem, ImmArg<1>]>;
-def int_preserve_struct_access_index : Intrinsic<[llvm_anyptr_ty],
- [llvm_anyptr_ty, llvm_i32_ty,
- llvm_i32_ty],
- [IntrNoMem, ImmArg<1>,
- ImmArg<2>]>;
-
//===----------------------------------------------------------------------===//
// Target-specific intrinsics
//===----------------------------------------------------------------------===//
diff --git a/llvm/include/llvm/IR/LLVMContext.h b/llvm/include/llvm/IR/LLVMContext.h
index c8050450041..f737801fffb 100644
--- a/llvm/include/llvm/IR/LLVMContext.h
+++ b/llvm/include/llvm/IR/LLVMContext.h
@@ -99,7 +99,6 @@ public:
MD_irr_loop = 24, // "irr_loop"
MD_access_group = 25, // "llvm.access.group"
MD_callback = 26, // "callback"
- MD_preserve_access_index = 27, // "llvm.preserve.*.access.index"
};
/// Known operand bundle tag IDs, which always have the same value. All
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index e1cdf6b539d..0fff76c7c9a 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -63,7 +63,6 @@ LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
{MD_irr_loop, "irr_loop"},
{MD_access_group, "llvm.access.group"},
{MD_callback, "callback"},
- {MD_preserve_access_index, "llvm.preserve.access.index"},
};
for (auto &MDKind : MDKinds) {
OpenPOWER on IntegriCloud