[llvm] r275138 - [X86, IR] Remove unnecessary or unused LLVMContext parameter from some of the X86 intrinsic upgrade functions.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 11 18:42:33 PDT 2016
Author: ctopper
Date: Mon Jul 11 20:42:33 2016
New Revision: 275138
URL: http://llvm.org/viewvc/llvm-project?rev=275138&view=rev
Log:
[X86,IR] Remove unnecessary or unused LLVMContext parameter from some of the X86 intrinsic upgrade functions.
Modified:
llvm/trunk/lib/IR/AutoUpgrade.cpp
Modified: llvm/trunk/lib/IR/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AutoUpgrade.cpp?rev=275138&r1=275137&r2=275138&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AutoUpgrade.cpp (original)
+++ llvm/trunk/lib/IR/AutoUpgrade.cpp Mon Jul 11 20:42:33 2016
@@ -418,13 +418,13 @@ bool llvm::UpgradeGlobalVariable(GlobalV
// Handles upgrading SSE2/AVX2/AVX512BW PSLLDQ intrinsics by converting them
// to byte shuffles.
-static Value *UpgradeX86PSLLDQIntrinsics(IRBuilder<> &Builder, LLVMContext &C,
+static Value *UpgradeX86PSLLDQIntrinsics(IRBuilder<> &Builder,
Value *Op, unsigned Shift) {
Type *ResultTy = Op->getType();
unsigned NumElts = ResultTy->getVectorNumElements() * 8;
// Bitcast from a 64-bit element type to a byte element type.
- Type *VecTy = VectorType::get(Type::getInt8Ty(C), NumElts);
+ Type *VecTy = VectorType::get(Builder.getInt8Ty(), NumElts);
Op = Builder.CreateBitCast(Op, VecTy, "cast");
// We'll be shuffling in zeroes.
@@ -452,14 +452,13 @@ static Value *UpgradeX86PSLLDQIntrinsics
// Handles upgrading SSE2/AVX2/AVX512BW PSRLDQ intrinsics by converting them
// to byte shuffles.
-static Value *UpgradeX86PSRLDQIntrinsics(IRBuilder<> &Builder, LLVMContext &C,
- Value *Op,
+static Value *UpgradeX86PSRLDQIntrinsics(IRBuilder<> &Builder, Value *Op,
unsigned Shift) {
Type *ResultTy = Op->getType();
unsigned NumElts = ResultTy->getVectorNumElements() * 8;
// Bitcast from a 64-bit element type to a byte element type.
- Type *VecTy = VectorType::get(Type::getInt8Ty(C), NumElts);
+ Type *VecTy = VectorType::get(Builder.getInt8Ty(), NumElts);
Op = Builder.CreateBitCast(Op, VecTy, "cast");
// We'll be shuffling in zeroes.
@@ -516,7 +515,7 @@ static Value *EmitX86Select(IRBuilder<>
return Builder.CreateSelect(Mask, Op0, Op1);
}
-static Value *UpgradeX86PALIGNRIntrinsics(IRBuilder<> &Builder, LLVMContext &C,
+static Value *UpgradeX86PALIGNRIntrinsics(IRBuilder<> &Builder,
Value *Op0, Value *Op1, Value *Shift,
Value *Passthru, Value *Mask) {
unsigned ShiftVal = cast<llvm::ConstantInt>(Shift)->getZExtValue();
@@ -555,7 +554,7 @@ static Value *UpgradeX86PALIGNRIntrinsic
return EmitX86Select(Builder, Mask, Align, Passthru);
}
-static Value *UpgradeMaskedStore(IRBuilder<> &Builder, LLVMContext &C,
+static Value *UpgradeMaskedStore(IRBuilder<> &Builder,
Value *Ptr, Value *Data, Value *Mask,
bool Aligned) {
// Cast the pointer to the right type.
@@ -575,7 +574,7 @@ static Value *UpgradeMaskedStore(IRBuild
return Builder.CreateMaskedStore(Data, Ptr, Align, Mask);
}
-static Value *UpgradeMaskedLoad(IRBuilder<> &Builder, LLVMContext &C,
+static Value *UpgradeMaskedLoad(IRBuilder<> &Builder,
Value *Ptr, Value *Passthru, Value *Mask,
bool Aligned) {
// Cast the pointer to the right type.
@@ -796,7 +795,7 @@ void llvm::UpgradeIntrinsicCall(CallInst
Name.startswith("avx512.mask.storeu.w.") ||
Name.startswith("avx512.mask.storeu.d.") ||
Name.startswith("avx512.mask.storeu.q."))) {
- UpgradeMaskedStore(Builder, C, CI->getArgOperand(0), CI->getArgOperand(1),
+ UpgradeMaskedStore(Builder, CI->getArgOperand(0), CI->getArgOperand(1),
CI->getArgOperand(2), /*Aligned*/false);
// Remove intrinsic.
@@ -807,7 +806,7 @@ void llvm::UpgradeIntrinsicCall(CallInst
Name.startswith("avx512.mask.store.w.") ||
Name.startswith("avx512.mask.store.d.") ||
Name.startswith("avx512.mask.store.q."))) {
- UpgradeMaskedStore(Builder, C, CI->getArgOperand(0), CI->getArgOperand(1),
+ UpgradeMaskedStore(Builder, CI->getArgOperand(0), CI->getArgOperand(1),
CI->getArgOperand(2), /*Aligned*/true);
// Remove intrinsic.
@@ -818,7 +817,7 @@ void llvm::UpgradeIntrinsicCall(CallInst
Name.startswith("avx512.mask.loadu.w.") ||
Name.startswith("avx512.mask.loadu.d.") ||
Name.startswith("avx512.mask.loadu.q."))) {
- Rep = UpgradeMaskedLoad(Builder, C, CI->getArgOperand(0),
+ Rep = UpgradeMaskedLoad(Builder, CI->getArgOperand(0),
CI->getArgOperand(1), CI->getArgOperand(2),
/*Aligned*/false);
} else if (IsX86 && (Name.startswith("avx512.mask.load.p") ||
@@ -826,7 +825,7 @@ void llvm::UpgradeIntrinsicCall(CallInst
Name.startswith("avx512.mask.load.w.") ||
Name.startswith("avx512.mask.load.d.") ||
Name.startswith("avx512.mask.load.q."))) {
- Rep = UpgradeMaskedLoad(Builder, C, CI->getArgOperand(0),
+ Rep = UpgradeMaskedLoad(Builder, CI->getArgOperand(0),
CI->getArgOperand(1),CI->getArgOperand(2),
/*Aligned*/true);
} else if (IsX86 && Name.startswith("xop.vpcom")) {
@@ -947,7 +946,7 @@ void llvm::UpgradeIntrinsicCall(CallInst
Rep = EmitX86Select(Builder, CI->getArgOperand(2), Rep,
CI->getArgOperand(1));
} else if (IsX86 && Name.startswith("avx512.mask.palignr.")) {
- Rep = UpgradeX86PALIGNRIntrinsics(Builder, C, CI->getArgOperand(0),
+ Rep = UpgradeX86PALIGNRIntrinsics(Builder, CI->getArgOperand(0),
CI->getArgOperand(1),
CI->getArgOperand(2),
CI->getArgOperand(3),
@@ -956,26 +955,26 @@ void llvm::UpgradeIntrinsicCall(CallInst
Name == "avx2.psll.dq")) {
// 128/256-bit shift left specified in bits.
unsigned Shift = cast<ConstantInt>(CI->getArgOperand(1))->getZExtValue();
- Rep = UpgradeX86PSLLDQIntrinsics(Builder, C, CI->getArgOperand(0),
+ Rep = UpgradeX86PSLLDQIntrinsics(Builder, CI->getArgOperand(0),
Shift / 8); // Shift is in bits.
} else if (IsX86 && (Name == "sse2.psrl.dq" ||
Name == "avx2.psrl.dq")) {
// 128/256-bit shift right specified in bits.
unsigned Shift = cast<ConstantInt>(CI->getArgOperand(1))->getZExtValue();
- Rep = UpgradeX86PSRLDQIntrinsics(Builder, C, CI->getArgOperand(0),
+ Rep = UpgradeX86PSRLDQIntrinsics(Builder, CI->getArgOperand(0),
Shift / 8); // Shift is in bits.
} else if (IsX86 && (Name == "sse2.psll.dq.bs" ||
Name == "avx2.psll.dq.bs" ||
Name == "avx512.psll.dq.512")) {
// 128/256/512-bit shift left specified in bytes.
unsigned Shift = cast<ConstantInt>(CI->getArgOperand(1))->getZExtValue();
- Rep = UpgradeX86PSLLDQIntrinsics(Builder, C, CI->getArgOperand(0), Shift);
+ Rep = UpgradeX86PSLLDQIntrinsics(Builder, CI->getArgOperand(0), Shift);
} else if (IsX86 && (Name == "sse2.psrl.dq.bs" ||
Name == "avx2.psrl.dq.bs" ||
Name == "avx512.psrl.dq.512")) {
// 128/256/512-bit shift right specified in bytes.
unsigned Shift = cast<ConstantInt>(CI->getArgOperand(1))->getZExtValue();
- Rep = UpgradeX86PSRLDQIntrinsics(Builder, C, CI->getArgOperand(0), Shift);
+ Rep = UpgradeX86PSRLDQIntrinsics(Builder, CI->getArgOperand(0), Shift);
} else if (IsX86 && (Name == "sse41.pblendw" ||
Name.startswith("sse41.blendp") ||
Name.startswith("avx.blend.p") ||
More information about the llvm-commits
mailing list