llvm.org GIT mirror llvm / 86312cc
Refactor: Use positive field names in VectorizeConfig. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154249 91177308-0d34-0410-b5e6-96231b3b80d8 Hongbin Zheng 8 years ago
2 changed file(s) with 27 addition(s) and 25 deletion(s). Raw diff Collapse all Expand all
2727 /// @brief The size of the native vector registers.
2828 unsigned VectorBits;
2929
30 /// @brief Don't try to vectorize integer values.
31 bool NoInts;
30 /// @brief Vectorize integer values.
31 bool VectorizeInts;
3232
33 /// @brief Don't try to vectorize floating-point values.
34 bool NoFloats;
33 /// @brief Vectorize floating-point values.
34 bool VectorizeFloats;
3535
36 /// @brief Don't try to vectorize casting (conversion) operations.
37 bool NoCasts;
36 /// @brief Vectorize casting (conversion) operations.
37 bool VectorizeCasts;
3838
39 /// @brief Don't try to vectorize floating-point math intrinsics.
40 bool NoMath;
39 /// @brief Vectorize floating-point math intrinsics.
40 bool VectorizeMath;
4141
42 /// @brief Don't try to vectorize the fused-multiply-add intrinsic.
43 bool NoFMA;
42 /// @brief Vectorize the fused-multiply-add intrinsic.
43 bool VectorizeFMA;
4444
45 /// @brief Don't try to vectorize loads and stores.
46 bool NoMemOps;
45 /// @brief Vectorize loads and stores.
46 bool VectorizeMemOps;
4747
4848 /// @brief Only generate aligned loads and stores.
4949 bool AlignedOnly;
436436 case Intrinsic::exp:
437437 case Intrinsic::exp2:
438438 case Intrinsic::pow:
439 return !Config.NoMath;
439 return Config.VectorizeMath;
440440 case Intrinsic::fma:
441 return !Config.NoFMA;
441 return Config.VectorizeFMA;
442442 }
443443 }
444444
532532 } else if (LoadInst *L = dyn_cast(I)) {
533533 // Vectorize simple loads if possbile:
534534 IsSimpleLoadStore = L->isSimple();
535 if (!IsSimpleLoadStore || Config.NoMemOps)
535 if (!IsSimpleLoadStore || !Config.VectorizeMemOps)
536536 return false;
537537 } else if (StoreInst *S = dyn_cast(I)) {
538538 // Vectorize simple stores if possbile:
539539 IsSimpleLoadStore = S->isSimple();
540 if (!IsSimpleLoadStore || Config.NoMemOps)
540 if (!IsSimpleLoadStore || !Config.VectorizeMemOps)
541541 return false;
542542 } else if (CastInst *C = dyn_cast(I)) {
543543 // We can vectorize casts, but not casts of pointer types, etc.
544 if (Config.NoCasts)
544 if (!Config.VectorizeCasts)
545545 return false;
546546
547547 Type *SrcTy = C->getSrcTy();
581581 !(VectorType::isValidElementType(T2) || T2->isVectorTy()))
582582 return false;
583583
584 if (Config.NoInts && (T1->isIntOrIntVectorTy() || T2->isIntOrIntVectorTy()))
584 if (!Config.VectorizeInts
585 && (T1->isIntOrIntVectorTy() || T2->isIntOrIntVectorTy()))
585586 return false;
586587
587 if (Config.NoFloats && (T1->isFPOrFPVectorTy() || T2->isFPOrFPVectorTy()))
588 if (!Config.VectorizeFloats
589 && (T1->isFPOrFPVectorTy() || T2->isFPOrFPVectorTy()))
588590 return false;
589591
590592 if (T1->getPrimitiveSizeInBits() > Config.VectorBits/2 ||
18861888 //===----------------------------------------------------------------------===//
18871889 VectorizeConfig::VectorizeConfig() {
18881890 VectorBits = ::VectorBits;
1889 NoInts = ::NoInts;
1890 NoFloats = ::NoFloats;
1891 NoCasts = ::NoCasts;
1892 NoMath = ::NoMath;
1893 NoFMA = ::NoFMA;
1894 NoMemOps = ::NoMemOps;
1891 VectorizeInts = !::NoInts;
1892 VectorizeFloats = !::NoFloats;
1893 VectorizeCasts = !::NoCasts;
1894 VectorizeMath = !::NoMath;
1895 VectorizeFMA = !::NoFMA;
1896 VectorizeMemOps = !::NoMemOps;
18951897 AlignedOnly = ::AlignedOnly;
18961898 ReqChainDepth= ::ReqChainDepth;
18971899 SearchLimit = ::SearchLimit;