diff options
author | Matthias Braun <matze@braunis.de> | 2016-03-22 20:24:34 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-03-22 20:24:34 +0000 |
commit | 68bb2931ccec7d4934224e3ff019c462bfe27927 (patch) | |
tree | 866ab1be2bd9941124cd8bf29216ee88687152c9 /llvm/lib/IR/IRBuilder.cpp | |
parent | 0569b5bd6be0c166646692de30d197b00290415b (diff) | |
download | bcm5719-llvm-68bb2931ccec7d4934224e3ff019c462bfe27927.tar.gz bcm5719-llvm-68bb2931ccec7d4934224e3ff019c462bfe27927.zip |
Revert "Support arbitrary addrspace pointers in masked load/store intrinsics"
This commit broke LTO builds. Reverting it to unbreak the bots while the
issue is investigated. See also:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160321/341002.html
This reverts r263158
llvm-svn: 264088
Diffstat (limited to 'llvm/lib/IR/IRBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/IRBuilder.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp index 1bd509cb985..bc75de2693b 100644 --- a/llvm/lib/IR/IRBuilder.cpp +++ b/llvm/lib/IR/IRBuilder.cpp @@ -212,15 +212,13 @@ CallInst *IRBuilderBase::CreateAssumption(Value *Cond) { CallInst *IRBuilderBase::CreateMaskedLoad(Value *Ptr, unsigned Align, Value *Mask, Value *PassThru, const Twine &Name) { - PointerType *PtrTy = cast<PointerType>(Ptr->getType()); - Type *DataTy = PtrTy->getElementType(); + // DataTy is the overloaded type + Type *DataTy = cast<PointerType>(Ptr->getType())->getElementType(); assert(DataTy->isVectorTy() && "Ptr should point to a vector"); if (!PassThru) PassThru = UndefValue::get(DataTy); - Type *OverloadedTypes[] = { DataTy, PtrTy }; Value *Ops[] = { Ptr, getInt32(Align), Mask, PassThru}; - return CreateMaskedIntrinsic(Intrinsic::masked_load, Ops, - OverloadedTypes, Name); + return CreateMaskedIntrinsic(Intrinsic::masked_load, Ops, DataTy, Name); } /// \brief Create a call to a Masked Store intrinsic. @@ -231,22 +229,19 @@ CallInst *IRBuilderBase::CreateMaskedLoad(Value *Ptr, unsigned Align, /// be accessed in memory CallInst *IRBuilderBase::CreateMaskedStore(Value *Val, Value *Ptr, unsigned Align, Value *Mask) { - PointerType *PtrTy = cast<PointerType>(Ptr->getType()); - Type *DataTy = PtrTy->getElementType(); - assert(DataTy->isVectorTy() && "Ptr should point to a vector"); - Type *OverloadedTypes[] = { DataTy, PtrTy }; Value *Ops[] = { Val, Ptr, getInt32(Align), Mask }; - return CreateMaskedIntrinsic(Intrinsic::masked_store, Ops, OverloadedTypes); + // Type of the data to be stored - the only one overloaded type + return CreateMaskedIntrinsic(Intrinsic::masked_store, Ops, Val->getType()); } /// Create a call to a Masked intrinsic, with given intrinsic Id, -/// an array of operands - Ops, and an array of overloaded types - -/// OverloadedTypes. +/// an array of operands - Ops, and one overloaded type - DataTy CallInst *IRBuilderBase::CreateMaskedIntrinsic(Intrinsic::ID Id, ArrayRef<Value *> Ops, - ArrayRef<Type *> OverloadedTypes, + Type *DataTy, const Twine &Name) { Module *M = BB->getParent()->getParent(); + Type *OverloadedTypes[] = { DataTy }; Value *TheFn = Intrinsic::getDeclaration(M, Id, OverloadedTypes); return createCallHelper(TheFn, Ops, this, Name); } @@ -275,7 +270,7 @@ CallInst *IRBuilderBase::CreateMaskedGather(Value *Ptrs, unsigned Align, // We specify only one type when we create this intrinsic. Types of other // arguments are derived from this type. - return CreateMaskedIntrinsic(Intrinsic::masked_gather, Ops, { DataTy }, Name); + return CreateMaskedIntrinsic(Intrinsic::masked_gather, Ops, DataTy, Name); } /// \brief Create a call to a Masked Scatter intrinsic. @@ -305,7 +300,7 @@ CallInst *IRBuilderBase::CreateMaskedScatter(Value *Data, Value *Ptrs, // We specify only one type when we create this intrinsic. Types of other // arguments are derived from this type. - return CreateMaskedIntrinsic(Intrinsic::masked_scatter, Ops, { DataTy }); + return CreateMaskedIntrinsic(Intrinsic::masked_scatter, Ops, DataTy); } template <typename T0, typename T1, typename T2, typename T3> |