search for: vectortype

Displaying 20 results from an estimated 121 matches for "vectortype".

2020 May 22
3
[RFC] Refactor class hierarchy of VectorType in the IR
John, For the last several months, those of us working on the scalable vectors feature have been examining the codebase, identifying places where llvm::VectorType is used incorrectly, and fixing them. The fact is that there are many places where VectorType is correctly taken to be the generic “any vector” type. getNumElements may be being called, but it’s being called in accordance with the previously documented semantics. There are many places where it isn’...
2020 Apr 22
2
[Update][RFC] Refactor class hierarchy of VectorType in the IR
Hi, I just wanted to give an update on the progress of this work. This morning I merged a patch to add the new vector types. I have added a FixedVectorType, as proposed below. I also added a ScalableVectorType. I found during my work that it is useful to be able to query isa<ScalableVectorType>(Ty). Additionally, I was concerned that it would become commonplace to take (isa<VectorType>(Ty) && !isa<FixedVectorType>(Ty)) to mea...
2020 May 21
3
[RFC] Refactor class hierarchy of VectorType in the IR
...pace of development. The C++ API is explicitly unstable. I maintain a downstream fork of LLVM myself, so I know the pain that this is causing because I get to fix all the issues in my internal codebase. However, the fix for downstream codebases is very simple: Just find all the places where it says VectorType, and change it to say FixedVectorType. > … by having the VectorType type semantically repurposed out from under them. The documented semantics of VectorType prior to my RFC were that it is a generalization of all vector types. The VectorType contains an ElementCount, which is a pair of (bool,...
2020 May 05
2
[Update][RFC] Refactor class hierarchy of VectorType in the IR
...er if getNumElements didn't just suddenly go away. I think the -Werror build bots would prevent most people from re-introducing it, we would just have to be very vigilant to ensure that nobody un-deprecates it. Since most usages of getNumElements() are either easy to fix (by casting to FixedVectorType), or likely are causing miscompilation, I would prefer to keep the amount of time it remains as short as possible. What do you think would be a reasonable period of time for it to be deprecated? 2 weeks? I would also like to add that assuming you have integrated https://reviews.llvm.org/rG2dea3...
2020 Mar 09
8
[RFC] Refactor class hierarchy of VectorType in the IR
...ment scalable vectors in the codebase in order to add support for generating SVE code in the Arm backend. I would like to propose a refactor of the Type class hierarchy in order to eliminate issues related to the misuse of SequentialType::getNumElements(). I would like to introduce a new class FixedVectorType that inherits from SequentialType and VectorType. VectorType would no longer inherit from SequentialType, instead directly inheriting from Type. After this change, it will be statically impossible to accidentally call SequentialType::getNumElements() via a VectorType pointer. Background:...
2020 May 21
5
[RFC] Refactor class hierarchy of VectorType in the IR
...from a scalable vector and 3) It forces everybody to fix their broken code. If we provided stability guarantees to downstream and out-of-tree codebases, then I might not agree that 3 is a benefit, but my understanding is that we do not provide this guarantee. > … Probably 99% of the code using VectorType semantically requires it to be a fixed-width vector. This code is all broken already. I don’t think supporting common misuse of APIs in a codebase that does not provide stability guarantees is something we should be doing. > The generalization of VectorType to scalable vector types was a repre...
2017 Apr 08
2
How to insert vector type input parameter for function in C/C++ API?
Thank you so much Craig! I tried it. But still complaining. Here is the error message during compilation. HowToUseJIT_SIMD_FuncProto.cpp:94:55: error: expected unqualified-id VectorType::(Type::getInt32Ty(Context),4), THIS IS MY CODE: LLVMContext Context; std::unique_ptr<Module> Owner = make_unique<Module>("test", Context); Module *M = Owner.get(); Function *Add1F = cast<Function>(M->getOrInsertFunction("add1", VectorType:...
2013 Aug 06
1
[LLVMdev] How to set value for a vectortype?
I want to set value for a vectortype. It is a global variable, it contains several basic type, like float. If can set value element by element, it is better. -- Shining(史宁) Changchun, Jilin, China -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/...
2020 May 13
4
[llvm-commits@lists.llvm.org: Re: [llvm] 2dea3f1 - [SVE] Add new VectorType subclasses]
...10 May 2020 02:34:12 +0200 From: Joerg Sonnenberger via llvm-commits <llvm-commits at lists.llvm.org> To: Christopher Tetreault <ctetreau at quicinc.com>, Christopher Tetreault <llvmlistbot at llvm.org> Cc: llvm-commits at lists.llvm.org Subject: Re: [llvm] 2dea3f1 - [SVE] Add new VectorType subclasses Reply-To: Joerg Sonnenberger <joerg at bec.de> On Wed, Apr 22, 2020 at 08:59:20AM -0700, Christopher Tetreault via llvm-commits wrote: > > Author: Christopher Tetreault > Date: 2020-04-22T08:59:01-07:00 > New Revision: 2dea3f129878e929e5d1f00b91a622eb1ec8be4e > &g...
2017 Apr 08
3
How to insert vector type input parameter for function in C/C++ API?
Fantastic! It's working! Thank you so much Craig!!! On Fri, Apr 7, 2017 at 6:05 PM, Craig Topper <craig.topper at gmail.com> wrote: > It should be VectorType::get(Type::getInt32Ty(Context),4). You need the > word "get" after VectorType:: > > ~Craig > > On Fri, Apr 7, 2017 at 6:01 PM, Michael Choi <choimichael103 at gmail.com> > wrote: > >> Thank you so much Craig! >> >> I tried it. But still compla...
2020 May 13
3
[llvm-commits@lists.llvm.org: Re: [llvm] 2dea3f1 - [SVE] Add new VectorType subclasses]
...-bounces at lists.llvm.org> On Behalf Of James Y Knight via llvm-dev Sent: Wednesday, May 13, 2020 7:33 AM To: Joerg Sonnenberger <joerg at bec.de>; llvm-dev <llvm-dev at lists.llvm.org> Subject: [EXT] Re: [llvm-dev] [llvm-commits at lists.llvm.org: Re: [llvm] 2dea3f1 - [SVE] Add new VectorType subclasses] Agreed. Those llvm-c changes are wrong, and compatibility needs to be maintained for the numeric values at minimum. Probably also would be a good idea to make LLVMVectorTypeKind a deprecated alias for LLVMFixedVectorTypeKind. On Wed, May 13, 2020 at 9:11 AM Joerg Sonnenberger via llvm...
2020 Jul 16
2
BitcodeReader.cpp bug under LTO
...placeholder type of "cond" if it cannot find "cond" in ValueList, as the code follows: Type *SelectorTy = Type::getInt1Ty(Context); // The selector might be an i1 or an <n x i1> // Get the type from the ValueList before getting a forward ref. if (VectorType *VTy = dyn_cast<VectorType>(CurTy)) if (Value *V = ValueList[Record[0]]) if (SelectorTy != V->getType()) SelectorTy = VectorType::get(SelectorTy, VTy->getNumElements()); However, the program aborts in RAUW() if we find "selty" is a vector type l...
2018 Jul 20
2
LLVM FunctionType cannot be returned as VectorType?
...using LLVM C++ API to generate some code. In particular, I am dealing with AVX2 SIMD API which uses __m256i. My function input types a set of vectors and return type is also a vector. /////////////////////////////////////////////////////////////////////////////////////////// arguments.push_back(VectorType::get(IntegerType::getIntNTy(TheContext, 64), 4));//int64*4 = __m256i FunctionType * proto = FunctionType::get(VectorType::get(IntegerType::getIntNTy(TheContext, 64), 4),//int64*4 = __m256i arguments, false); //////////////////...
2012 Jun 03
1
[LLVMdev] Constant::getAllOnesValue(): expected behaviour or bug?
...::getAllOnesValue() method and found that it doesn't handlesPointerTypes correctly. When receiving a "i32*" argument, it was returning with some big integer vector, such as <12113216 x i32>. When you call this method passing a PointerType, the following code is executed: 00152 VectorType *VTy = cast<VectorType>(Ty);00153 return ConstantVector::getSplat(VTy->getNumElements(),00154 getAllOnesValue(VTy->getElementType() When VTy->getNumElements() is called, it returns the value of the instance variable NumElementspresent in VectorType...
2018 Jul 23
2
LLVM FunctionType cannot be returned as VectorType?
...s but the correct answer is supposed to be all 0. Can you please help me figure out what's going on here? Any help will be greatly appreciated. /////////////////////////////////////////////////////////////////////////////////////////// My function prototype definition: auto vectorDataType = VectorType::get(IntegerType::getIntNTy(TheContext, 64), 4); std::vector<Type *> vecArguments; for (Uint64 nodeId = startOfLeaves; nodeId < numNodes; ++nodeId) { vecArguments.push_back(vectorDataType); }...
2015 Apr 16
3
[LLVMdev] double* to <2 x double>*
...bounds [100 x double]* @main.B, i32 0, i32 %i.021 %1 = bitcast double* %arrayidx1 to <2 x double>* %2 = load <2 x double>* %1, align 4 what I right now doing is: *Assume pInst is *%1 = load double* %arrayidx1, align 4, !tbaa !0 Value *loadValue = pInst->getOperand(0); Type *vecTy = VectorType::get(Type::getDoublePtrTy(currF->getContext()), 2); Value *emptyVec = UndefValue::get(vecTy); Type* u32Ty = Type::getInt32Ty(currF->getContext()); Value *index0 = ConstantInt::get(u32Ty, 0); Value *index1 = ConstantInt::get(u32Ty, 1); Instruction *InsertVal = InsertElementInst::Create(empt...
2018 Jul 23
2
LLVM FunctionType cannot be returned as VectorType?
...> *From:* llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] *On Behalf Of *Jia > Yu via llvm-dev > *Sent:* Monday, July 23, 2018 6:02 > *To:* stefan.graenitz at gmail.com > *Cc:* llvm-dev at lists.llvm.org > *Subject:* Re: [llvm-dev] LLVM FunctionType cannot be returned as > VectorType? > > > > Hi Stefan, > > > > Thank you very much for answering my question! > > > > I followed your suggestion but the function still cannot return the > correct result. I also set target-feature attributes for my function. I am > using LLVM 6.0. > > &...
2008 Jan 04
7
[LLVMdev] Calling functions across modules. And those pesky vectors!
...ctor types were fairly well, but I can't seem to get a simple function which takes in and returns vectors to work properly. And I don't understand the error. I made a simple function which was just supposed to multiply two 3 component float vectors and return the result: //Snip on: VectorType *vType = VectorType::get(Type::FloatTy, 3); std::vector<const Type*> Vectors(2, vType); FunctionType *mul_type = FunctionType::get(vType, Vectors, false); Function* mul = new Function(mul_type, Function::ExternalLinkage, "mul", mod); mul->set...
2017 Jul 06
2
[RFC][SVE] Supporting Scalable Vector Architectures in LLVM IR (take 2)
...ch is basically reasonable. The primary problem that this will introduce is: > > 1) Almost anything touching (e.g. transforming) vector operations will have to be aware of this concept. Given a first class implementation of SVE, I don’t see how that’s avoidable though, and your extension of VectorType is sensible. Yes, however we have found that the vast majority of vector transforms don't need any modification to deal with scalable types. There are obviously exceptions, things like analysing shuffle vector masks for specific patterns etc. > > 2) This means that VectorType is sometim...
2020 Jul 20
2
BitcodeReader.cpp bug under LTO
...placeholder type of "cond" if it cannot find "cond" in ValueList, as the code follows: Type *SelectorTy = Type::getInt1Ty(Context); // The selector might be an i1 or an <n x i1> // Get the type from the ValueList before getting a forward ref. if (VectorType *VTy = dyn_cast<VectorType>(CurTy)) if (Value *V = ValueList[Record[0]]) if (SelectorTy != V->getType()) SelectorTy = VectorType::get(SelectorTy, VTy->getNumElements()); However, the program aborts in RAUW() if we find "selty" is a vector type l...