File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -1590,9 +1590,8 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
1590
1590
case TargetOpcode::G_UCMP: {
1591
1591
LLT DstTy = MRI->getType (MI->getOperand (0 ).getReg ());
1592
1592
LLT SrcTy = MRI->getType (MI->getOperand (1 ).getReg ());
1593
- LLT SrcTy2 = MRI->getType (MI->getOperand (2 ).getReg ());
1594
1593
1595
- if (SrcTy.isPointerOrPointerVector () || SrcTy2. isPointerOrPointerVector () ) {
1594
+ if (SrcTy.isPointerOrPointerVector ()) {
1596
1595
report (" Generic scmp/ucmp does not support pointers as operands" , MI);
1597
1596
break ;
1598
1597
}
@@ -1602,18 +1601,18 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
1602
1601
break ;
1603
1602
}
1604
1603
1604
+ if (DstTy.getScalarSizeInBits () < 2 ) {
1605
+ report (" Result type must be at least 2 bits wide" , MI);
1606
+ break ;
1607
+ }
1608
+
1605
1609
if ((DstTy.isVector () != SrcTy.isVector ()) ||
1606
1610
(DstTy.isVector () &&
1607
1611
DstTy.getElementCount () != SrcTy.getElementCount ())) {
1608
1612
report (" Generic vector scmp/ucmp must preserve number of lanes" , MI);
1609
1613
break ;
1610
1614
}
1611
1615
1612
- if (SrcTy != SrcTy2) {
1613
- report (" Generic scmp/ucmp must have same input types" , MI);
1614
- break ;
1615
- }
1616
-
1617
1616
break ;
1618
1617
}
1619
1618
case TargetOpcode::G_EXTRACT: {
Original file line number Diff line number Diff line change @@ -19,13 +19,17 @@ body: |
19
19
%23:_(<2 x s32>) = G_IMPLICIT_DEF
20
20
%24:_(<2 x s32>) = G_IMPLICIT_DEF
21
21
; CHECK: Generic vector scmp/ucmp must preserve number of lanes
22
- %5:_(s1 ) = G_UCMP %23, %24
22
+ %5:_(s2 ) = G_UCMP %23, %24
23
23
24
24
%15:_(s32) = G_CONSTANT i32 0
25
25
%16:_(s64) = G_CONSTANT i64 2
26
- ; CHECK: Generic scmp/ucmp must have same input types
27
- %17:_(s1 ) = G_SCMP %15, %16
26
+ ; CHECK: Type mismatch in generic instruction
27
+ %17:_(s2 ) = G_SCMP %15, %16
28
28
29
+ %18:_(s32) = G_CONSTANT i32 0
30
+ %19:_(s32) = G_CONSTANT i32 2
31
+ ; CHECK: Result type must be at least 2 bits wide
32
+ %20:_(s1) = G_SCMP %18, %19
29
33
30
34
31
35
...
You can’t perform that action at this time.
0 commit comments