@@ -2822,46 +2822,43 @@ static bool interp__builtin_elementwise_fsh(InterpState &S, CodePtr OpPC,
28222822 unsigned BuiltinID) {
28232823 assert (Call->getNumArgs () == 3 );
28242824
2825- const QualType &Arg1Type = Call->getArg (0 )->getType ();
2826- const QualType &Arg2Type = Call->getArg (1 )->getType ();
2827- const QualType &Arg3Type = Call->getArg (2 )->getType ();
2825+ const QualType Arg0Type = Call->getArg (0 )->getType ();
2826+ const QualType Arg1Type = Call->getArg (1 )->getType ();
2827+ const QualType Arg2Type = Call->getArg (2 )->getType ();
28282828
28292829 // Non-vector integer types.
2830- if (!Arg1Type->isVectorType ()) {
2830+ if (!Arg0Type->isVectorType ()) {
2831+ assert (!Arg1Type->isVectorType ());
28312832 assert (!Arg2Type->isVectorType ());
2832- assert (!Arg3Type->isVectorType ());
2833- const APSInt &Shift = popToAPSInt (
2834- S.Stk , *S.getContext ().classify (Call->getArg (2 )->getType ()));
2835- const APSInt &Lo = popToAPSInt (
2836- S.Stk , *S.getContext ().classify (Call->getArg (1 )->getType ()));
2837- const APSInt &Hi = popToAPSInt (
2838- S.Stk , *S.getContext ().classify (Call->getArg (0 )->getType ()));
2833+ const APSInt &Shift =
2834+ popToAPSInt (S.Stk , *S.getContext ().classify (Arg2Type));
2835+ const APSInt &Lo = popToAPSInt (S.Stk , *S.getContext ().classify (Arg1Type));
2836+ const APSInt &Hi = popToAPSInt (S.Stk , *S.getContext ().classify (Arg0Type));
28392837 APSInt Result;
2840- if (BuiltinID == Builtin::BI__builtin_elementwise_fshl) {
2838+ if (BuiltinID == Builtin::BI__builtin_elementwise_fshl)
28412839 Result = APSInt (llvm::APIntOps::fshl (Hi, Lo, Shift), Hi.isUnsigned ());
2842- } else if (BuiltinID == Builtin::BI__builtin_elementwise_fshr) {
2840+ else if (BuiltinID == Builtin::BI__builtin_elementwise_fshr)
28432841 Result = APSInt (llvm::APIntOps::fshr (Hi, Lo, Shift), Hi.isUnsigned ());
2844- } else {
2842+ else
28452843 llvm_unreachable (" Wrong builtin ID" );
2846- }
28472844 pushInteger (S, Result, Call->getType ());
28482845 return true ;
28492846 }
28502847
28512848 // Vector type.
2852- assert (Arg1Type ->isVectorType () && Arg2Type ->isVectorType () &&
2853- Arg3Type ->isVectorType ());
2849+ assert (Arg0Type ->isVectorType () && Arg1Type ->isVectorType () &&
2850+ Arg2Type ->isVectorType ());
28542851
2855- const VectorType *VecT = Arg1Type ->castAs <VectorType>();
2852+ const auto *VecT = Arg0Type ->castAs <VectorType>();
28562853 const PrimType &ElemT = *S.getContext ().classify (VecT->getElementType ());
28572854 unsigned NumElems = VecT->getNumElements ();
28582855
28592856 assert (VecT->getElementType () ==
2860- Arg2Type ->castAs <VectorType>()->getElementType () &&
2857+ Arg1Type ->castAs <VectorType>()->getElementType () &&
28612858 VecT->getElementType () ==
2862- Arg3Type ->castAs <VectorType>()->getElementType ());
2863- assert (NumElems == Arg2Type ->castAs <VectorType>()->getNumElements () &&
2864- NumElems == Arg3Type ->castAs <VectorType>()->getNumElements ());
2859+ Arg2Type ->castAs <VectorType>()->getElementType ());
2860+ assert (NumElems == Arg1Type ->castAs <VectorType>()->getNumElements () &&
2861+ NumElems == Arg2Type ->castAs <VectorType>()->getNumElements ());
28652862 assert (VecT->getElementType ()->isIntegralOrEnumerationType ());
28662863
28672864 const Pointer &VecShift = S.Stk .pop <Pointer>();
0 commit comments