@@ -863,9 +863,9 @@ static bool upgradeArmOrAarch64IntrinsicFunction(bool IsArm, Function *F,
863
863
static const Regex LdRegex (" ^[234](.nxv[a-z0-9]+|$)" );
864
864
if (LdRegex.match (Name)) {
865
865
Type *ScalarTy =
866
- dyn_cast <VectorType>(F->getReturnType ())->getElementType ();
867
- ElementCount EC = dyn_cast<VectorType>(F-> arg_begin ()-> getType ())
868
- ->getElementCount ();
866
+ cast <VectorType>(F->getReturnType ())->getElementType ();
867
+ ElementCount EC =
868
+ cast<VectorType>(F-> arg_begin ()-> getType ()) ->getElementCount ();
869
869
Type *Ty = VectorType::get (ScalarTy, EC);
870
870
static const Intrinsic::ID LoadIDs[] = {
871
871
Intrinsic::aarch64_sve_ld2_sret,
@@ -4402,8 +4402,7 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
4402
4402
.StartsWith (" aarch64.sve.ld3" , 3 )
4403
4403
.StartsWith (" aarch64.sve.ld4" , 4 )
4404
4404
.Default (0 );
4405
- ScalableVectorType *RetTy =
4406
- dyn_cast<ScalableVectorType>(F->getReturnType ());
4405
+ auto *RetTy = cast<ScalableVectorType>(F->getReturnType ());
4407
4406
unsigned MinElts = RetTy->getMinNumElements () / N;
4408
4407
SmallVector<Value *, 2 > Args (CI->args ());
4409
4408
Value *NewLdCall = Builder.CreateCall (NewFn, Args);
@@ -4431,8 +4430,7 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
4431
4430
DefaultCase ();
4432
4431
return ;
4433
4432
}
4434
- ScalableVectorType *RetTy =
4435
- dyn_cast<ScalableVectorType>(F->getReturnType ());
4433
+ auto *RetTy = cast<ScalableVectorType>(F->getReturnType ());
4436
4434
unsigned MinElts = RetTy->getMinNumElements ();
4437
4435
unsigned I = cast<ConstantInt>(CI->getArgOperand (1 ))->getZExtValue ();
4438
4436
Value *NewIdx = ConstantInt::get (Type::getInt64Ty (C), I * MinElts);
@@ -4448,9 +4446,8 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
4448
4446
return ;
4449
4447
}
4450
4448
if (Name.starts_with (" aarch64.sve.tuple.set" )) {
4451
- unsigned I = dyn_cast<ConstantInt>(CI->getArgOperand (1 ))->getZExtValue ();
4452
- ScalableVectorType *Ty =
4453
- dyn_cast<ScalableVectorType>(CI->getArgOperand (2 )->getType ());
4449
+ unsigned I = cast<ConstantInt>(CI->getArgOperand (1 ))->getZExtValue ();
4450
+ auto *Ty = cast<ScalableVectorType>(CI->getArgOperand (2 )->getType ());
4454
4451
Value *NewIdx =
4455
4452
ConstantInt::get (Type::getInt64Ty (C), I * Ty->getMinNumElements ());
4456
4453
NewCall = Builder.CreateCall (
@@ -4464,8 +4461,7 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
4464
4461
.StartsWith (" aarch64.sve.tuple.create4" , 4 )
4465
4462
.Default (0 );
4466
4463
assert (N > 1 && " Create is expected to be between 2-4" );
4467
- ScalableVectorType *RetTy =
4468
- dyn_cast<ScalableVectorType>(F->getReturnType ());
4464
+ auto *RetTy = cast<ScalableVectorType>(F->getReturnType ());
4469
4465
Value *Ret = llvm::PoisonValue::get (RetTy);
4470
4466
unsigned MinElts = RetTy->getMinNumElements () / N;
4471
4467
for (unsigned I = 0 ; I < N; I++) {
0 commit comments