File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed
Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -408,18 +408,11 @@ bool StructType::isScalableTy(SmallPtrSetImpl<Type *> &Visited) const {
408408 return false ;
409409
410410 for (Type *Ty : elements ()) {
411- if (isa<ScalableVectorType>(Ty )) {
411+ if (Ty-> isScalableTy (Visited )) {
412412 const_cast <StructType *>(this )->setSubclassData (
413413 getSubclassData () | SCDB_ContainsScalableVector);
414414 return true ;
415415 }
416- if (auto *STy = dyn_cast<StructType>(Ty)) {
417- if (STy->isScalableTy (Visited)) {
418- const_cast <StructType *>(this )->setSubclassData (
419- getSubclassData () | SCDB_ContainsScalableVector);
420- return true ;
421- }
422- }
423416 }
424417
425418 // For structures that are opaque, return false but do not set the
Original file line number Diff line number Diff line change 1515; CHECK-NEXT: ptr @ScalableVecStructGlobal
1616@ScalableVecStructGlobal = global { i32 , <vscale x 4 x i32 > } zeroinitializer
1717
18+ ; CHECK-NEXT: Globals cannot contain scalable types
19+ ; CHECK-NEXT: ptr @StructTestGlobal
20+ %struct.test = type { <vscale x 1 x double >, <vscale x 1 x double > }
21+ @StructTestGlobal = global %struct.test zeroinitializer
22+
23+ ; CHECK-NEXT: Globals cannot contain scalable types
24+ ; CHECK-NEXT: ptr @StructArrayTestGlobal
25+ %struct.array.test = type { [2 x <vscale x 1 x double >] }
26+ @StructArrayTestGlobal = global %struct.array.test zeroinitializer
27+
28+ ; CHECK-NEXT: Globals cannot contain scalable types
29+ ; CHECK-NEXT: ptr @StructTargetTestGlobal
30+ %struct.target.test = type { target ("aarch64.svcount" ), target ("aarch64.svcount" ) }
31+ @StructTargetTestGlobal = global %struct.target.test zeroinitializer
You can’t perform that action at this time.
0 commit comments