mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
SLPVectorizer: Only vectorize intrinsics whose operands are widened equally
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
This commit is contained in:
54
include/llvm/Transforms/Utils/VectorUtils.h
Normal file
54
include/llvm/Transforms/Utils/VectorUtils.h
Normal file
@ -0,0 +1,54 @@
|
||||
//===- 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
|
Reference in New Issue
Block a user