mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 05:31:06 +00:00
b0ee2374ce
The vectorizer only knows how to vectorize intrinics by widening all operands by the same factor. Patch by Tyler Nowicki! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205855 91177308-0d34-0410-b5e6-96231b3b80d8
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
//===- llvm/Transforms/Utils/VectorUtils.h - Vector utilities -*- C++ -*-=====//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines some vectorizer utilities.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_TRANSFORMS_UTILS_VECTORUTILS_H
|
|
#define LLVM_TRANSFORMS_UTILS_VECTORUTILS_H
|
|
|
|
namespace llvm {
|
|
|
|
/// \brief Identify if the intrinsic is trivially vectorizable.
|
|
///
|
|
/// This method returns true if the intrinsic's argument types are all
|
|
/// scalars for the scalar form of the intrinsic and all vectors for
|
|
/// the vector form of the intrinsic.
|
|
static inline bool isTriviallyVectorizable(Intrinsic::ID ID) {
|
|
switch (ID) {
|
|
case Intrinsic::sqrt:
|
|
case Intrinsic::sin:
|
|
case Intrinsic::cos:
|
|
case Intrinsic::exp:
|
|
case Intrinsic::exp2:
|
|
case Intrinsic::log:
|
|
case Intrinsic::log10:
|
|
case Intrinsic::log2:
|
|
case Intrinsic::fabs:
|
|
case Intrinsic::copysign:
|
|
case Intrinsic::floor:
|
|
case Intrinsic::ceil:
|
|
case Intrinsic::trunc:
|
|
case Intrinsic::rint:
|
|
case Intrinsic::nearbyint:
|
|
case Intrinsic::round:
|
|
case Intrinsic::ctpop:
|
|
case Intrinsic::pow:
|
|
case Intrinsic::fma:
|
|
case Intrinsic::fmuladd:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
} // llvm namespace
|
|
|
|
#endif
|