mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[GlobalISel] Simpler verification of G_SEXT_INREG and G_ASSERT_ZEXT
There's no need to call verifyVectorElementMatch since we already know that the source and destination types are identical. Differential Revision: https://reviews.llvm.org/D96589
This commit is contained in:
parent
6bb03a7eef
commit
d27645b72c
@ -949,9 +949,7 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
|
|||||||
|
|
||||||
Register Dst = MI->getOperand(0).getReg();
|
Register Dst = MI->getOperand(0).getReg();
|
||||||
Register Src = MI->getOperand(1).getReg();
|
Register Src = MI->getOperand(1).getReg();
|
||||||
LLT DstTy = MRI->getType(Dst);
|
|
||||||
LLT SrcTy = MRI->getType(Src);
|
LLT SrcTy = MRI->getType(Src);
|
||||||
verifyVectorElementMatch(DstTy, SrcTy, MI);
|
|
||||||
int64_t Imm = MI->getOperand(2).getImm();
|
int64_t Imm = MI->getOperand(2).getImm();
|
||||||
if (Imm <= 0) {
|
if (Imm <= 0) {
|
||||||
report("G_ASSERT_ZEXT size must be >= 1", MI);
|
report("G_ASSERT_ZEXT size must be >= 1", MI);
|
||||||
@ -1398,10 +1396,7 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLT DstTy = MRI->getType(MI->getOperand(0).getReg());
|
|
||||||
LLT SrcTy = MRI->getType(MI->getOperand(1).getReg());
|
LLT SrcTy = MRI->getType(MI->getOperand(1).getReg());
|
||||||
verifyVectorElementMatch(DstTy, SrcTy, MI);
|
|
||||||
|
|
||||||
int64_t Imm = MI->getOperand(2).getImm();
|
int64_t Imm = MI->getOperand(2).getImm();
|
||||||
if (Imm <= 0)
|
if (Imm <= 0)
|
||||||
report("G_SEXT_INREG size must be >= 1", MI);
|
report("G_SEXT_INREG size must be >= 1", MI);
|
||||||
|
@ -19,11 +19,9 @@ body: |
|
|||||||
|
|
||||||
; CHECK: *** Bad machine code: Type mismatch in generic instruction ***
|
; CHECK: *** Bad machine code: Type mismatch in generic instruction ***
|
||||||
; CHECK: instruction: %assert_zext_3:_(<2 x s32>) = G_ASSERT_ZEXT
|
; CHECK: instruction: %assert_zext_3:_(<2 x s32>) = G_ASSERT_ZEXT
|
||||||
; CHECK: *** Bad machine code: operand types must be all-vector or all-scalar ***
|
|
||||||
; CHECK: instruction: %assert_zext_3:_(<2 x s32>) = G_ASSERT_ZEXT
|
|
||||||
%assert_zext_3:_(<2 x s32>) = G_ASSERT_ZEXT %0, 8
|
%assert_zext_3:_(<2 x s32>) = G_ASSERT_ZEXT %0, 8
|
||||||
|
|
||||||
; CHECK: *** Bad machine code: operand types must preserve number of vector elements ***
|
; CHECK: *** Bad machine code: Type mismatch in generic instruction ***
|
||||||
; CHECK: instruction: %assert_zext_4:_(<2 x s32>) = G_ASSERT_ZEXT
|
; CHECK: instruction: %assert_zext_4:_(<2 x s32>) = G_ASSERT_ZEXT
|
||||||
%assert_zext_4:_(<2 x s32>) = G_ASSERT_ZEXT %1, 8
|
%assert_zext_4:_(<2 x s32>) = G_ASSERT_ZEXT %1, 8
|
||||||
|
|
||||||
|
@ -36,11 +36,9 @@ body: |
|
|||||||
|
|
||||||
; CHECK: *** Bad machine code: Type mismatch in generic instruction ***
|
; CHECK: *** Bad machine code: Type mismatch in generic instruction ***
|
||||||
; CHECK: instruction: %4:gpr(<2 x s32>) = G_SEXT_INREG
|
; CHECK: instruction: %4:gpr(<2 x s32>) = G_SEXT_INREG
|
||||||
; CHECK: *** Bad machine code: operand types must be all-vector or all-scalar ***
|
|
||||||
; CHECK: instruction: %4:gpr(<2 x s32>) = G_SEXT_INREG
|
|
||||||
%4(<2 x s32>) = G_SEXT_INREG %0, 8
|
%4(<2 x s32>) = G_SEXT_INREG %0, 8
|
||||||
|
|
||||||
; CHECK: *** Bad machine code: operand types must preserve number of vector elements ***
|
; CHECK: *** Bad machine code: Type mismatch in generic instruction ***
|
||||||
; CHECK: instruction: %5:gpr(<2 x s32>) = G_SEXT_INREG
|
; CHECK: instruction: %5:gpr(<2 x s32>) = G_SEXT_INREG
|
||||||
%5(<2 x s32>) = G_SEXT_INREG %1, 8
|
%5(<2 x s32>) = G_SEXT_INREG %1, 8
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user