@@ -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,
@@ -4385,8 +4385,7 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
4385
4385
.StartsWith (" aarch64.sve.ld3" , 3 )
4386
4386
.StartsWith (" aarch64.sve.ld4" , 4 )
4387
4387
.Default (0 );
4388
- ScalableVectorType *RetTy =
4389
- dyn_cast<ScalableVectorType>(F->getReturnType ());
4388
+ auto *RetTy = cast<ScalableVectorType>(F->getReturnType ());
4390
4389
unsigned MinElts = RetTy->getMinNumElements () / N;
4391
4390
SmallVector<Value *, 2 > Args (CI->args ());
4392
4391
Value *NewLdCall = Builder.CreateCall (NewFn, Args);
@@ -4414,8 +4413,7 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
4414
4413
DefaultCase ();
4415
4414
return ;
4416
4415
}
4417
- ScalableVectorType *RetTy =
4418
- dyn_cast<ScalableVectorType>(F->getReturnType ());
4416
+ auto *RetTy = cast<ScalableVectorType>(F->getReturnType ());
4419
4417
unsigned MinElts = RetTy->getMinNumElements ();
4420
4418
unsigned I = cast<ConstantInt>(CI->getArgOperand (1 ))->getZExtValue ();
4421
4419
Value *NewIdx = ConstantInt::get (Type::getInt64Ty (C), I * MinElts);
@@ -4431,9 +4429,8 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
4431
4429
return ;
4432
4430
}
4433
4431
if (Name.starts_with (" aarch64.sve.tuple.set" )) {
4434
- unsigned I = dyn_cast<ConstantInt>(CI->getArgOperand (1 ))->getZExtValue ();
4435
- ScalableVectorType *Ty =
4436
- dyn_cast<ScalableVectorType>(CI->getArgOperand (2 )->getType ());
4432
+ unsigned I = cast<ConstantInt>(CI->getArgOperand (1 ))->getZExtValue ();
4433
+ auto *Ty = cast<ScalableVectorType>(CI->getArgOperand (2 )->getType ());
4437
4434
Value *NewIdx =
4438
4435
ConstantInt::get (Type::getInt64Ty (C), I * Ty->getMinNumElements ());
4439
4436
NewCall = Builder.CreateCall (
@@ -4447,8 +4444,7 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
4447
4444
.StartsWith (" aarch64.sve.tuple.create4" , 4 )
4448
4445
.Default (0 );
4449
4446
assert (N > 1 && " Create is expected to be between 2-4" );
4450
- ScalableVectorType *RetTy =
4451
- dyn_cast<ScalableVectorType>(F->getReturnType ());
4447
+ auto *RetTy = cast<ScalableVectorType>(F->getReturnType ());
4452
4448
Value *Ret = llvm::PoisonValue::get (RetTy);
4453
4449
unsigned MinElts = RetTy->getMinNumElements () / N;
4454
4450
for (unsigned I = 0 ; I < N; I++) {
0 commit comments