llvm.org GIT mirror llvm / 52aa6d3
[TTI] Add a hook for specifying per-target defaults for Interleaved Accesses Summary: This adds a hook to TTI which enables us to selectively turn on by default interleaved access vectorization for targets on which we have have performed the required benchmarking. Reviewers: rengolin Subscribers: rengolin, llvm-commits Differential Revision: http://reviews.llvm.org/D11901 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244449 91177308-0d34-0410-b5e6-96231b3b80d8 Silviu Baranga 4 years ago
4 changed file(s) with 21 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
356356 /// \brief Don't restrict interleaved unrolling to small loops.
357357 bool enableAggressiveInterleaving(bool LoopHasReductions) const;
358358
359 /// \brief Enable matching of interleaved access groups.
360 bool enableInterleavedAccessVectorization() const;
361
359362 /// \brief Return hardware support for population count.
360363 PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const;
361364
577580 virtual unsigned getJumpBufSize() = 0;
578581 virtual bool shouldBuildLookupTables() = 0;
579582 virtual bool enableAggressiveInterleaving(bool LoopHasReductions) = 0;
583 virtual bool enableInterleavedAccessVectorization() = 0;
580584 virtual PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) = 0;
581585 virtual bool haveFastSqrt(Type *Ty) = 0;
582586 virtual int getFPOpCost(Type *Ty) = 0;
718722 bool enableAggressiveInterleaving(bool LoopHasReductions) override {
719723 return Impl.enableAggressiveInterleaving(LoopHasReductions);
720724 }
725 bool enableInterleavedAccessVectorization() override {
726 return Impl.enableInterleavedAccessVectorization();
727 }
721728 PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) override {
722729 return Impl.getPopcntSupport(IntTyWidthInBit);
723730 }
228228 bool shouldBuildLookupTables() { return true; }
229229
230230 bool enableAggressiveInterleaving(bool LoopHasReductions) { return false; }
231
232 bool enableInterleavedAccessVectorization() { return false; }
231233
232234 TTI::PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) {
233235 return TTI::PSK_Software;
165165 return TTIImpl->enableAggressiveInterleaving(LoopHasReductions);
166166 }
167167
168 bool TargetTransformInfo::enableInterleavedAccessVectorization() const {
169 return TTIImpl->enableInterleavedAccessVectorization();
170 }
171
168172 TargetTransformInfo::PopcntSupportKind
169173 TargetTransformInfo::getPopcntSupport(unsigned IntTyWidthInBit) const {
170174 return TTIImpl->getPopcntSupport(IntTyWidthInBit);
38793879 : "")
38803880 << "!\n");
38813881
3882 bool UseInterleaved = TTI->enableInterleavedAccessVectorization();
3883
3884 // If an override option has been passed in for interleaved accesses, use it.
3885 if (EnableInterleavedMemAccesses.getNumOccurrences() > 0)
3886 UseInterleaved = EnableInterleavedMemAccesses;
3887
38823888 // Analyze interleaved memory accesses.
3883 if (EnableInterleavedMemAccesses)
3884 InterleaveInfo.analyzeInterleaving(Strides);
3889 if (UseInterleaved)
3890 InterleaveInfo.analyzeInterleaving(Strides);
38853891
38863892 // Okay! We can vectorize. At this point we don't have any other mem analysis
38873893 // which may limit our maximum vectorization factor, so just return true with