File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -690,6 +690,10 @@ G_SPLAT_VECTOR
690
690
691
691
Create a vector where all elements are the scalar from the source operand.
692
692
693
+ The type of the operand must be equal to or larger than the vector element
694
+ type. If the operand is larger than the vector element type, the scalar is
695
+ implicitly truncated to the vector element type.
696
+
693
697
Vector Reduction Operations
694
698
---------------------------
695
699
Original file line number Diff line number Diff line change @@ -1768,16 +1768,23 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
1768
1768
LLT DstTy = MRI->getType (MI->getOperand (0 ).getReg ());
1769
1769
LLT SrcTy = MRI->getType (MI->getOperand (1 ).getReg ());
1770
1770
1771
- if (!DstTy.isScalableVector ())
1771
+ if (!DstTy.isScalableVector ()) {
1772
1772
report (" Destination type must be a scalable vector" , MI);
1773
+ break ;
1774
+ }
1773
1775
1774
- if (!SrcTy.isScalar ())
1776
+ if (!SrcTy.isScalar ()) {
1775
1777
report (" Source type must be a scalar" , MI);
1778
+ break ;
1779
+ }
1776
1780
1777
- if (DstTy.getScalarType () != SrcTy)
1778
- report (" Element type of the destination must be the same type as the "
1779
- " source type" ,
1781
+ if (TypeSize::isKnownGT (DstTy.getScalarType ().getSizeInBits (),
1782
+ SrcTy.getSizeInBits ())) {
1783
+ report (" Element type of the destination must be the same size or smaller "
1784
+ " than the source type" ,
1780
1785
MI);
1786
+ break ;
1787
+ }
1781
1788
1782
1789
break ;
1783
1790
}
Original file line number Diff line number Diff line change @@ -22,6 +22,6 @@ body: |
22
22
; CHECK: Source type must be a scalar
23
23
%6:_(<vscale x 2 x s32>) = G_SPLAT_VECTOR %2
24
24
25
- ; CHECK: Element type of the destination must be the same type as the source type
26
- %7:_(<vscale x 2 x s64 >) = G_SPLAT_VECTOR %0
25
+ ; CHECK: Element type of the destination must be the same size or smaller than the source type
26
+ %7:_(<vscale x 2 x s128 >) = G_SPLAT_VECTOR %0
27
27
...
You can’t perform that action at this time.
0 commit comments