File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -594,11 +594,14 @@ class IRGenSILFunction :
594
594
if (getActiveDominancePoint () == VarDominancePoint ||
595
595
isActiveDominancePointDominatedBy (VarDominancePoint)) {
596
596
llvm::Type *ArgTys;
597
- auto *Ty = Storage->getType ()-> getScalarType () ;
598
- // Pointers and Floats are expected to fit into a register.
599
- if (Ty->isPointerTy () || Ty->isFloatingPointTy ())
600
- ArgTys = { Storage-> getType () };
597
+ auto *Ty = Storage->getType ();
598
+ // Vectors, Pointers and Floats are expected to fit into a register.
599
+ if (Ty->isPointerTy () || Ty->isFloatingPointTy () || Ty-> isVectorTy () )
600
+ ArgTys = { Ty };
601
601
else {
602
+ // If this is not a scalar or vector type, we can't handle it.
603
+ if (isa<llvm::CompositeType>(Ty))
604
+ continue ;
602
605
// The storage is guaranteed to be no larger than the register width.
603
606
// Extend the storage so it would fit into a register.
604
607
llvm::Type *IntTy;
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend %s -g -emit-ir -o - | %FileCheck %s
2
+ // REQUIRES: objc_interop, CPU=x86_64
3
+ import simd
4
+
5
+ func use< T> ( _ x: T ) { }
6
+
7
+ func getInt32( ) -> Int32 { return - 1 }
8
+
9
+ public func rangeExtension( x: Int32 , y: Int32 ) {
10
+ let p = int2 ( x, y)
11
+ // CHECK: define {{.*}}rangeExtension
12
+ // CHECK: llvm.dbg.value(metadata <2 x i32> %[[P:.*]], i64 0, metadata
13
+ use ( p)
14
+ // CHECK: asm sideeffect "", "r"{{.*}}[[P]]
15
+ }
You can’t perform that action at this time.
0 commit comments