mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
[VectorUtils] Accept IRBuilderBase; NFC
This commit is contained in:
parent
051ae19c80
commit
7115dff351
@ -17,7 +17,6 @@
|
||||
#include "llvm/ADT/SmallSet.h"
|
||||
#include "llvm/Analysis/LoopAccessAnalysis.h"
|
||||
#include "llvm/Analysis/TargetLibraryInfo.h"
|
||||
#include "llvm/IR/IRBuilder.h"
|
||||
#include "llvm/Support/CheckedArithmetic.h"
|
||||
|
||||
namespace llvm {
|
||||
@ -254,6 +253,7 @@ template <typename T> class ArrayRef;
|
||||
class DemandedBits;
|
||||
class GetElementPtrInst;
|
||||
template <typename InstTy> class InterleaveGroup;
|
||||
class IRBuilderBase;
|
||||
class Loop;
|
||||
class ScalarEvolution;
|
||||
class TargetTransformInfo;
|
||||
@ -394,7 +394,7 @@ Instruction *propagateMetadata(Instruction *I, ArrayRef<Value *> VL);
|
||||
/// Note: The result is a mask of 0's and 1's, as opposed to the other
|
||||
/// create[*]Mask() utilities which create a shuffle mask (mask that
|
||||
/// consists of indices).
|
||||
Constant *createBitMaskForGaps(IRBuilder<> &Builder, unsigned VF,
|
||||
Constant *createBitMaskForGaps(IRBuilderBase &Builder, unsigned VF,
|
||||
const InterleaveGroup<Instruction> &Group);
|
||||
|
||||
/// Create a mask with replicated elements.
|
||||
@ -409,8 +409,8 @@ Constant *createBitMaskForGaps(IRBuilder<> &Builder, unsigned VF,
|
||||
/// For example, the mask for \p ReplicationFactor=3 and \p VF=4 is:
|
||||
///
|
||||
/// <0,0,0,1,1,1,2,2,2,3,3,3>
|
||||
Constant *createReplicatedMask(IRBuilder<> &Builder, unsigned ReplicationFactor,
|
||||
unsigned VF);
|
||||
Constant *createReplicatedMask(IRBuilderBase &Builder,
|
||||
unsigned ReplicationFactor, unsigned VF);
|
||||
|
||||
/// Create an interleave shuffle mask.
|
||||
///
|
||||
@ -423,7 +423,7 @@ Constant *createReplicatedMask(IRBuilder<> &Builder, unsigned ReplicationFactor,
|
||||
/// For example, the mask for VF = 4 and NumVecs = 2 is:
|
||||
///
|
||||
/// <0, 4, 1, 5, 2, 6, 3, 7>.
|
||||
Constant *createInterleaveMask(IRBuilder<> &Builder, unsigned VF,
|
||||
Constant *createInterleaveMask(IRBuilderBase &Builder, unsigned VF,
|
||||
unsigned NumVecs);
|
||||
|
||||
/// Create a stride shuffle mask.
|
||||
@ -438,7 +438,7 @@ Constant *createInterleaveMask(IRBuilder<> &Builder, unsigned VF,
|
||||
/// For example, the mask for Start = 0, Stride = 2, and VF = 4 is:
|
||||
///
|
||||
/// <0, 2, 4, 6>
|
||||
Constant *createStrideMask(IRBuilder<> &Builder, unsigned Start,
|
||||
Constant *createStrideMask(IRBuilderBase &Builder, unsigned Start,
|
||||
unsigned Stride, unsigned VF);
|
||||
|
||||
/// Create a sequential shuffle mask.
|
||||
@ -452,7 +452,7 @@ Constant *createStrideMask(IRBuilder<> &Builder, unsigned Start,
|
||||
/// For example, the mask for Start = 0, NumInsts = 4, and NumUndefs = 4 is:
|
||||
///
|
||||
/// <0, 1, 2, 3, undef, undef, undef, undef>
|
||||
Constant *createSequentialMask(IRBuilder<> &Builder, unsigned Start,
|
||||
Constant *createSequentialMask(IRBuilderBase &Builder, unsigned Start,
|
||||
unsigned NumInts, unsigned NumUndefs);
|
||||
|
||||
/// Concatenate a list of vectors.
|
||||
@ -462,7 +462,7 @@ Constant *createSequentialMask(IRBuilder<> &Builder, unsigned Start,
|
||||
/// their element types should be the same. The number of elements in the
|
||||
/// vectors should also be the same; however, if the last vector has fewer
|
||||
/// elements, it will be padded with undefs.
|
||||
Value *concatenateVectors(IRBuilder<> &Builder, ArrayRef<Value *> Vecs);
|
||||
Value *concatenateVectors(IRBuilderBase &Builder, ArrayRef<Value *> Vecs);
|
||||
|
||||
/// Given a mask vector of the form <Y x i1>, Return true if all of the
|
||||
/// elements of this predicate mask are false or undef. That is, return true
|
||||
|
@ -665,7 +665,7 @@ Instruction *llvm::propagateMetadata(Instruction *Inst, ArrayRef<Value *> VL) {
|
||||
}
|
||||
|
||||
Constant *
|
||||
llvm::createBitMaskForGaps(IRBuilder<> &Builder, unsigned VF,
|
||||
llvm::createBitMaskForGaps(IRBuilderBase &Builder, unsigned VF,
|
||||
const InterleaveGroup<Instruction> &Group) {
|
||||
// All 1's means mask is not needed.
|
||||
if (Group.getNumMembers() == Group.getFactor())
|
||||
@ -684,7 +684,7 @@ llvm::createBitMaskForGaps(IRBuilder<> &Builder, unsigned VF,
|
||||
return ConstantVector::get(Mask);
|
||||
}
|
||||
|
||||
Constant *llvm::createReplicatedMask(IRBuilder<> &Builder,
|
||||
Constant *llvm::createReplicatedMask(IRBuilderBase &Builder,
|
||||
unsigned ReplicationFactor, unsigned VF) {
|
||||
SmallVector<Constant *, 16> MaskVec;
|
||||
for (unsigned i = 0; i < VF; i++)
|
||||
@ -694,7 +694,7 @@ Constant *llvm::createReplicatedMask(IRBuilder<> &Builder,
|
||||
return ConstantVector::get(MaskVec);
|
||||
}
|
||||
|
||||
Constant *llvm::createInterleaveMask(IRBuilder<> &Builder, unsigned VF,
|
||||
Constant *llvm::createInterleaveMask(IRBuilderBase &Builder, unsigned VF,
|
||||
unsigned NumVecs) {
|
||||
SmallVector<Constant *, 16> Mask;
|
||||
for (unsigned i = 0; i < VF; i++)
|
||||
@ -704,7 +704,7 @@ Constant *llvm::createInterleaveMask(IRBuilder<> &Builder, unsigned VF,
|
||||
return ConstantVector::get(Mask);
|
||||
}
|
||||
|
||||
Constant *llvm::createStrideMask(IRBuilder<> &Builder, unsigned Start,
|
||||
Constant *llvm::createStrideMask(IRBuilderBase &Builder, unsigned Start,
|
||||
unsigned Stride, unsigned VF) {
|
||||
SmallVector<Constant *, 16> Mask;
|
||||
for (unsigned i = 0; i < VF; i++)
|
||||
@ -713,7 +713,7 @@ Constant *llvm::createStrideMask(IRBuilder<> &Builder, unsigned Start,
|
||||
return ConstantVector::get(Mask);
|
||||
}
|
||||
|
||||
Constant *llvm::createSequentialMask(IRBuilder<> &Builder, unsigned Start,
|
||||
Constant *llvm::createSequentialMask(IRBuilderBase &Builder, unsigned Start,
|
||||
unsigned NumInts, unsigned NumUndefs) {
|
||||
SmallVector<Constant *, 16> Mask;
|
||||
for (unsigned i = 0; i < NumInts; i++)
|
||||
@ -729,7 +729,7 @@ Constant *llvm::createSequentialMask(IRBuilder<> &Builder, unsigned Start,
|
||||
/// A helper function for concatenating vectors. This function concatenates two
|
||||
/// vectors having the same element type. If the second vector has fewer
|
||||
/// elements than the first, it is padded with undefs.
|
||||
static Value *concatenateTwoVectors(IRBuilder<> &Builder, Value *V1,
|
||||
static Value *concatenateTwoVectors(IRBuilderBase &Builder, Value *V1,
|
||||
Value *V2) {
|
||||
VectorType *VecTy1 = dyn_cast<VectorType>(V1->getType());
|
||||
VectorType *VecTy2 = dyn_cast<VectorType>(V2->getType());
|
||||
@ -752,7 +752,8 @@ static Value *concatenateTwoVectors(IRBuilder<> &Builder, Value *V1,
|
||||
return Builder.CreateShuffleVector(V1, V2, Mask);
|
||||
}
|
||||
|
||||
Value *llvm::concatenateVectors(IRBuilder<> &Builder, ArrayRef<Value *> Vecs) {
|
||||
Value *llvm::concatenateVectors(IRBuilderBase &Builder,
|
||||
ArrayRef<Value *> Vecs) {
|
||||
unsigned NumVecs = Vecs.size();
|
||||
assert(NumVecs > 1 && "Should be at least two vectors");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user