search for: loopvectorizationcostmodel

Displaying 20 results from an estimated 27 matches for "loopvectorizationcostmodel".

2018 Jul 23
2
KNL Vectorization with larger vector width
Thank You. But I cannot find your mentioned function LoopVectorizationCostModel::computeFeasibleMaxVF(bool OptForSize, unsigned ConstTripCount). I am using LLVM 4. I have been trying to get the required code portion in LoopVectorize.cpp file. But I am unable to debug this. each time i debug it, it returns me vectorized IR in gdb. My goal is simple when i mention my target nam...
2016 Jun 02
4
[GSoC 2016] Parameters of a target architecture
Dear LLVM contributors, I work on the "Improvement of vectorization process in Polly". At the moment I'm trying to implement tiling, interchanging and unrolling of specific loops based on the following algorithm for the analytical modeling [1]. It requires information about the following parameters of a target architecture: 1. Size of double-precision floating-point number. 2.
2015 Jan 19
2
[LLVMdev] Vectorization Cost Models and Multi-Instruction Patterns?
...: Add a method, part of the vector API of TargetTransformInfo, for multi-instruction cost computation. It would take a scalar Instruction, and a reference to a set of Instruction. If it's able to match a min/max/saturate/.., it adds all the matched instructions to the set, so the caller (say LoopVectorizationCostModel) can ignore them. But: - this all seems icky: a very blunt hammer. - what, if anything, should we do about legality checks? The expanded IR equivalent of a saturate uses larger types than necessary, so this might prevent vectorization. In practice it doesn't, because only load/store/PHI ty...
2013 Jan 03
1
[LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
...vectorization on targets that don't implement the cost interface. If this > is a problem for you then I can do it soon. > > I guess I can just implement all the vectorTargetTransformInfo::get*OpCost functions since I will later need a cost model for mips-dsp anyway. Would the code in LoopVectorizationCostModel::expectedCost work correctly if those functions returned a large integer (max unsigned int)? I am concerned about overflow. > I am asking this because I would like to have loop vectorization disabled > for targets that don't support SIMD instructions (for example, standard > mips32)....
2018 Jan 05
2
RFC: [LV] any objections in moving isLegalMasked* check from Legal to CostModel? (Cleaning up LoopVectorizationLegality)
...would be a good member of LoopVectorizationAnalysisInfo. Eventually, I'd like to see these under Analysis subtree (instead of Transform), since they are indeed Analysis. As a first step of this LoopVectorizationLegality cleanup, I propose to move the following checks (and member functions) to LoopVectorizationCostModel. isLegalMaskedStore isLegalMaskedLoad isLegalMaskedScatter isLegalMaskedGather My assumption is that all SIMD architectures should support serialization of those operations at some cost (e.g., lowering in CG prepare) and thus failing to vectorize due to "false" return values of tho...
2018 Sep 25
2
Unsafe floating point operation (FDiv & FRem) in LoopVectorizer
...data type of A, B & C to the integer type then it generates the right code, where div is predicated based on the mask, and scalar div gets generated for each lane. This seems like a problem in predicate instruction detection part of LV, currently it considers only UDiv, SDiv, URem, SRem. bool LoopVectorizationCostModel::isScalarWithPredication(Instruction *I, unsigned VF) { if (!Legal->blockNeedsPredication(I->getParent())) return false; switch(I->getOpcode()) { default: break; case Instruction::UDiv: <- Floating point operations not considered i.e FDiv & FRem case Instruction::...
2013 Jan 09
2
[LLVMdev] ARM vectorizer cost model
Hi Nadav, I'm interested in knowing how you'll work up the ARM cost model and how easy it'd be to split the work. As far as I can see, LoopVectorizationCostModel is the class that does all the work, with assistance from the target transform info. Do you think that updating ARMTTI would be the best course of action now, and inspect the differences in the CostModel later? I also haven't seen anything related to context switches and pipeline decisions on...
2018 Jan 05
0
RFC: [LV] any objections in moving isLegalMasked* check from Legal to CostModel? (Cleaning up LoopVectorizationLegality)
...ber of LoopVectorizationAnalysisInfo. > Eventually, I'd like to see these under Analysis subtree (instead of Transform), since they are indeed Analysis. > > As a first step of this LoopVectorizationLegality cleanup, I propose to move the following checks > (and member functions) to LoopVectorizationCostModel. > isLegalMaskedStore > isLegalMaskedLoad > isLegalMaskedScatter > isLegalMaskedGather > My assumption is that all SIMD architectures should support serialization of those operations > at some cost (e.g., lowering in CG prepare) and thus failing to vectorize due to "fals...
2018 Jan 06
2
RFC: [LV] any objections in moving isLegalMasked* check from Legal to CostModel? (Cleaning up LoopVectorizationLegality)
...er of LoopVectorizationAnalysisInfo. > Eventually, I'd like to see these under Analysis subtree (instead of Transform), since they are indeed Analysis. > > As a first step of this LoopVectorizationLegality cleanup, I propose > to move the following checks (and member functions) to LoopVectorizationCostModel. > isLegalMaskedStore > isLegalMaskedLoad > isLegalMaskedScatter > isLegalMaskedGather > My assumption is that all SIMD architectures should support > serialization of those operations at some cost (e.g., lowering in CG > prepare) and thus failing to vectorize due to &qu...
2013 Feb 04
0
[LLVMdev] Vectorizer using Instruction, not opcodes
...tion: %lftr.wideiv = trunc i64 %indvars.iv.next to i32 LV: Found an estimated cost of 1 for VF 2 For instruction: %exitcond = icmp ne i32 %lftr.wideiv, 256 LV: Found an estimated cost of 0 for VF 2 For instruction: br i1 %exitcond, label %for.body, label %for.end The corresponding code is in LoopVectorizationCostModel::getInstructionCost(). Basically, it just takes the scalar instruction, its type, creates a vector type and asks: How much would an instruction of that vector type cost (Slight simplification). On Feb 4, 2013, at 1:38 PM, Renato Golin <renato.golin at linaro.org> wrote: > The example bel...
2018 Jul 23
2
KNL Vectorization with larger vector width
...rBitWidth(true) How to put my target machine info in TTI? Please help. On Mon, Jul 23, 2018 at 11:33 PM, Friedman, Eli <efriedma at codeaurora.org> wrote: > On 7/23/2018 10:49 AM, hameeza ahmed via llvm-dev wrote: > > Thank You. > > But I cannot find your mentioned function LoopVectorizationCostModel::computeFeasibleMaxVF(bool > OptForSize, unsigned ConstTripCount). I am using LLVM 4. > > > "git log -ScomputeFeasibleMaxVF" says this was refactored in > https://reviews.llvm.org/rL297737 . > > -Eli > > -- > Employee of Qualcomm Innovation Center, Inc. >...
2013 Jan 03
0
[LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
Hi Akira! > > Does the current loop vectorizer inquire about the SIMD capabilities of the target architecture when it decides whether it is profitable to vectorize a loop? Yes, it uses a cost model to determine the profitability of vectorization. At the moment only x86 provides the necessary hooks that are needed for calculating the costs. We may need to change the cost defaults to
2013 Jan 03
3
[LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
Nadav (or anyone who is familiar with the loop vectorizer), Does the current loop vectorizer inquire about the SIMD capabilities of the target architecture when it decides whether it is profitable to vectorize a loop? I am asking this because I would like to have loop vectorization disabled for targets that don't support SIMD instructions (for example, standard mips32). Loop vectorization
2018 Jan 07
0
RFC: [LV] any objections in moving isLegalMasked* check from Legal to CostModel? (Cleaning up LoopVectorizationLegality)
...orizationAnalysisInfo. >> Eventually, I'd like to see these under Analysis subtree (instead of Transform), since they are indeed Analysis. >> >> As a first step of this LoopVectorizationLegality cleanup, I propose >> to move the following checks (and member functions) to LoopVectorizationCostModel. >> isLegalMaskedStore >> isLegalMaskedLoad >> isLegalMaskedScatter >> isLegalMaskedGather >> My assumption is that all SIMD architectures should support >> serialization of those operations at some cost (e.g., lowering in CG >> prepare) and thus faili...
2020 Nov 17
0
[Proposal] Introducing the concept of invalid costs to the IR cost model
...[Proposal] Introducing the concept of invalid costs to the IR cost model Hi David, This would be a very useful upgrade to the cost model. One thing I want to add is that we need to be mindful of the cases where the cost is proportional (or inversely proportional) to the VF, for instance in the LoopVectorizationCostModel::selectVectorizationFactor(ElementCount MaxVF), there is a point where expected cost is divided by the VF. I believe there are other places where the instruction cost is dependent on the actual number of elements in the vector. While this is not a problem for fixed vectors, for scalable vectors we...
2018 Jul 23
2
[LoopVectorizer] Improving the performance of dot product reduction loop
On 07/23/2018 06:23 PM, Hal Finkel via llvm-dev wrote: > > On 07/23/2018 05:22 PM, Craig Topper wrote: >> Hello all, >> >> This code https://godbolt.org/g/tTyxpf is a dot product reduction >> loop multipying sign extended 16-bit values to produce a 32-bit >> accumulated result. The x86 backend is currently not able to optimize >> it as well as gcc and icc.
2013 Jan 09
0
[LLVMdev] ARM vectorizer cost model
...dumper.ll -mtriple=thumbv7 -mcpu=cortex-a15" I also run the vectorizer with -debug-only=loop-vectorize because it dumps the costs of all of the instructions with different vectorization factors, and it also detects the different kinds of shuffles that we support. > As far as I can see, LoopVectorizationCostModel is the class that does all the work, with assistance from the target transform info. The LoopVectorizerCostModel only predicts which IR will be generated when vectorizing to a specific vector width. It uses TTI to get the cost of each IR instruction. Chandler recently refactored TTI (thank!) and n...
2017 Feb 27
4
[Proposal][RFC] Epilog loop vectorization
...; Subject: RE: [llvm-dev] [Proposal][RFC] Epilog loop vectorization +1 for “just rerun the vectorizer” on the scalar remainder loop, as the proposed decision process is broken down into “first determine best VF for main loop, then determine best next EpilogVF for remainder loop” anyhow: const LoopVectorizationCostModel::VectorizationFactor EpilogVF = CM.identifyNextProfitableVF(VF.Width); Raising some aspects: o The unroll factor may also affect the best EpilogVF. For instance, if UF=1 then EpilogVF < VF, as the patch currently enforces. But if UF is larger the next profitable EpilogVF could be equ...
2018 Jan 09
1
RFC: [LV] any objections in moving isLegalMasked* check from Legal to CostModel? (Cleaning up LoopVectorizationLegality)
...rizationAnalysisInfo. >> Eventually, I'd like to see these under Analysis subtree (instead of Transform), since they are indeed Analysis. >> >> As a first step of this LoopVectorizationLegality cleanup, I propose >> to move the following checks (and member functions) to LoopVectorizationCostModel. >> isLegalMaskedStore >> isLegalMaskedLoad >> isLegalMaskedScatter >> isLegalMaskedGather >> My assumption is that all SIMD architectures should support >> serialization of those operations at some cost (e.g., lowering in CG >> prepare) and thus fail...
2017 Feb 23
2
[Proposal][RFC] Epilog loop vectorization
On 02/22/2017 11:52 AM, Adam Nemet via llvm-dev wrote: > Hi Ashutosh, > >> On Feb 22, 2017, at 1:57 AM, Nema, Ashutosh via llvm-dev >> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: >> >> Hi, >> This is a proposal about epilog loop vectorization. >> Currently Loop Vectorizer inserts an epilogue loop for handling loops