[llvm] r244021 - Fixed line endings.
Simon Pilgrim
llvm-dev at redking.me.uk
Wed Aug 5 01:18:01 PDT 2015
Author: rksimon
Date: Wed Aug 5 03:18:00 2015
New Revision: 244021
URL: http://llvm.org/viewvc/llvm-project?rev=244021&view=rev
Log:
Fixed line endings.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=244021&r1=244020&r2=244021&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCalls.cpp Wed Aug 5 03:18:00 2015
@@ -194,44 +194,44 @@ Instruction *InstCombiner::SimplifyMemSe
return MI;
}
- return nullptr;
-}
-
-static Value *SimplifyX86immshift(const IntrinsicInst &II,
- InstCombiner::BuilderTy &Builder,
- bool ShiftLeft) {
- // Simplify if count is constant. To 0 if >= BitWidth,
- // otherwise to shl/lshr.
- auto CDV = dyn_cast<ConstantDataVector>(II.getArgOperand(1));
- auto CInt = dyn_cast<ConstantInt>(II.getArgOperand(1));
- if (!CDV && !CInt)
- return nullptr;
- ConstantInt *Count;
- if (CDV)
- Count = cast<ConstantInt>(CDV->getElementAsConstant(0));
- else
- Count = CInt;
-
- auto Vec = II.getArgOperand(0);
- auto VT = cast<VectorType>(Vec->getType());
- auto SVT = VT->getElementType();
- if (Count->getZExtValue() > (SVT->getPrimitiveSizeInBits() - 1))
- return ConstantAggregateZero::get(VT);
-
- unsigned VWidth = VT->getNumElements();
-
- // Get a constant vector of the same type as the first operand.
- auto VTCI = ConstantInt::get(VT->getElementType(), Count->getZExtValue());
-
- if (ShiftLeft)
- return Builder.CreateShl(Vec, Builder.CreateVectorSplat(VWidth, VTCI));
-
- return Builder.CreateLShr(Vec, Builder.CreateVectorSplat(VWidth, VTCI));
-}
-
-static Value *SimplifyX86extend(const IntrinsicInst &II,
- InstCombiner::BuilderTy &Builder,
- bool SignExtend) {
+ return nullptr;
+}
+
+static Value *SimplifyX86immshift(const IntrinsicInst &II,
+ InstCombiner::BuilderTy &Builder,
+ bool ShiftLeft) {
+ // Simplify if count is constant. To 0 if >= BitWidth,
+ // otherwise to shl/lshr.
+ auto CDV = dyn_cast<ConstantDataVector>(II.getArgOperand(1));
+ auto CInt = dyn_cast<ConstantInt>(II.getArgOperand(1));
+ if (!CDV && !CInt)
+ return nullptr;
+ ConstantInt *Count;
+ if (CDV)
+ Count = cast<ConstantInt>(CDV->getElementAsConstant(0));
+ else
+ Count = CInt;
+
+ auto Vec = II.getArgOperand(0);
+ auto VT = cast<VectorType>(Vec->getType());
+ auto SVT = VT->getElementType();
+ if (Count->getZExtValue() > (SVT->getPrimitiveSizeInBits() - 1))
+ return ConstantAggregateZero::get(VT);
+
+ unsigned VWidth = VT->getNumElements();
+
+ // Get a constant vector of the same type as the first operand.
+ auto VTCI = ConstantInt::get(VT->getElementType(), Count->getZExtValue());
+
+ if (ShiftLeft)
+ return Builder.CreateShl(Vec, Builder.CreateVectorSplat(VWidth, VTCI));
+
+ return Builder.CreateLShr(Vec, Builder.CreateVectorSplat(VWidth, VTCI));
+}
+
+static Value *SimplifyX86extend(const IntrinsicInst &II,
+ InstCombiner::BuilderTy &Builder,
+ bool SignExtend) {
VectorType *SrcTy = cast<VectorType>(II.getArgOperand(0)->getType());
VectorType *DstTy = cast<VectorType>(II.getType());
unsigned NumDstElts = DstTy->getNumElements();
@@ -750,46 +750,46 @@ Instruction *InstCombiner::visitCallInst
II->setArgOperand(0, V);
return II;
}
- break;
- }
-
- // Constant fold lshr( <A x Bi>, Ci ).
- case Intrinsic::x86_sse2_psrl_d:
- case Intrinsic::x86_sse2_psrl_q:
- case Intrinsic::x86_sse2_psrl_w:
- case Intrinsic::x86_sse2_psrli_d:
- case Intrinsic::x86_sse2_psrli_q:
- case Intrinsic::x86_sse2_psrli_w:
- case Intrinsic::x86_avx2_psrl_d:
- case Intrinsic::x86_avx2_psrl_q:
- case Intrinsic::x86_avx2_psrl_w:
- case Intrinsic::x86_avx2_psrli_d:
- case Intrinsic::x86_avx2_psrli_q:
- case Intrinsic::x86_avx2_psrli_w:
- if (Value *V = SimplifyX86immshift(*II, *Builder, false))
- return ReplaceInstUsesWith(*II, V);
- break;
-
- // Constant fold shl( <A x Bi>, Ci ).
- case Intrinsic::x86_sse2_psll_d:
- case Intrinsic::x86_sse2_psll_q:
- case Intrinsic::x86_sse2_psll_w:
+ break;
+ }
+
+ // Constant fold lshr( <A x Bi>, Ci ).
+ case Intrinsic::x86_sse2_psrl_d:
+ case Intrinsic::x86_sse2_psrl_q:
+ case Intrinsic::x86_sse2_psrl_w:
+ case Intrinsic::x86_sse2_psrli_d:
+ case Intrinsic::x86_sse2_psrli_q:
+ case Intrinsic::x86_sse2_psrli_w:
+ case Intrinsic::x86_avx2_psrl_d:
+ case Intrinsic::x86_avx2_psrl_q:
+ case Intrinsic::x86_avx2_psrl_w:
+ case Intrinsic::x86_avx2_psrli_d:
+ case Intrinsic::x86_avx2_psrli_q:
+ case Intrinsic::x86_avx2_psrli_w:
+ if (Value *V = SimplifyX86immshift(*II, *Builder, false))
+ return ReplaceInstUsesWith(*II, V);
+ break;
+
+ // Constant fold shl( <A x Bi>, Ci ).
+ case Intrinsic::x86_sse2_psll_d:
+ case Intrinsic::x86_sse2_psll_q:
+ case Intrinsic::x86_sse2_psll_w:
case Intrinsic::x86_sse2_pslli_d:
case Intrinsic::x86_sse2_pslli_q:
case Intrinsic::x86_sse2_pslli_w:
case Intrinsic::x86_avx2_psll_d:
case Intrinsic::x86_avx2_psll_q:
case Intrinsic::x86_avx2_psll_w:
- case Intrinsic::x86_avx2_pslli_d:
- case Intrinsic::x86_avx2_pslli_q:
- case Intrinsic::x86_avx2_pslli_w:
- if (Value *V = SimplifyX86immshift(*II, *Builder, true))
- return ReplaceInstUsesWith(*II, V);
- break;
-
- case Intrinsic::x86_sse41_pmovsxbd:
- case Intrinsic::x86_sse41_pmovsxbq:
- case Intrinsic::x86_sse41_pmovsxbw:
+ case Intrinsic::x86_avx2_pslli_d:
+ case Intrinsic::x86_avx2_pslli_q:
+ case Intrinsic::x86_avx2_pslli_w:
+ if (Value *V = SimplifyX86immshift(*II, *Builder, true))
+ return ReplaceInstUsesWith(*II, V);
+ break;
+
+ case Intrinsic::x86_sse41_pmovsxbd:
+ case Intrinsic::x86_sse41_pmovsxbq:
+ case Intrinsic::x86_sse41_pmovsxbw:
case Intrinsic::x86_sse41_pmovsxdq:
case Intrinsic::x86_sse41_pmovsxwd:
case Intrinsic::x86_sse41_pmovsxwq:
More information about the llvm-commits
mailing list