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) {
15901590 case TargetOpcode::G_UCMP: {
15911591 LLT DstTy = MRI->getType (MI->getOperand (0 ).getReg ());
15921592 LLT SrcTy = MRI->getType (MI->getOperand (1 ).getReg ());
1593- LLT SrcTy2 = MRI->getType (MI->getOperand (2 ).getReg ());
15941593
1595- if (SrcTy.isPointerOrPointerVector () || SrcTy2. isPointerOrPointerVector () ) {
1594+ if (SrcTy.isPointerOrPointerVector ()) {
15961595 report (" Generic scmp/ucmp does not support pointers as operands" , MI);
15971596 break ;
15981597 }
@@ -1602,18 +1601,18 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
16021601 break ;
16031602 }
16041603
1604+ if (DstTy.getScalarSizeInBits () < 2 ) {
1605+ report (" Result type must be at least 2 bits wide" , MI);
1606+ break ;
1607+ }
1608+
16051609 if ((DstTy.isVector () != SrcTy.isVector ()) ||
16061610 (DstTy.isVector () &&
16071611 DstTy.getElementCount () != SrcTy.getElementCount ())) {
16081612 report (" Generic vector scmp/ucmp must preserve number of lanes" , MI);
16091613 break ;
16101614 }
16111615
1612- if (SrcTy != SrcTy2) {
1613- report (" Generic scmp/ucmp must have same input types" , MI);
1614- break ;
1615- }
1616-
16171616 break ;
16181617 }
16191618 case TargetOpcode::G_EXTRACT: {
Original file line number Diff line number Diff line change @@ -19,13 +19,17 @@ body: |
1919 %23:_(<2 x s32>) = G_IMPLICIT_DEF
2020 %24:_(<2 x s32>) = G_IMPLICIT_DEF
2121 ; CHECK: Generic vector scmp/ucmp must preserve number of lanes
22- %5:_(s1 ) = G_UCMP %23, %24
22+ %5:_(s2 ) = G_UCMP %23, %24
2323
2424 %15:_(s32) = G_CONSTANT i32 0
2525 %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
2828
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
2933
3034
3135 ...
You can’t perform that action at this time.
0 commit comments