[llvm] [GlobalIsel] Add G_SCMP and G_UCMP instructions (PR #98894)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 11:58:13 PDT 2024
================
@@ -1544,6 +1544,26 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
break;
}
+ case TargetOpcode::G_SCMP:
+ case TargetOpcode::G_UCMP: {
+ LLT DstTy = MRI->getType(MI->getOperand(0).getReg());
+ LLT SrcTy = MRI->getType(MI->getOperand(1).getReg());
+ LLT SrcTy2 = MRI->getType(MI->getOperand(2).getReg());
+
+ if ((DstTy.isVector() != SrcTy.isVector()) ||
+ (DstTy.isVector() &&
+ DstTy.getElementCount() != SrcTy.getElementCount())) {
+ report("Generic vector scmp/ucmp must preserve number of lanes", MI);
+ break;
+ }
+
+ if (SrcTy != SrcTy2) {
+ report("Generic scmp/ucmp must have same input types", MI);
+ break;
+ }
+
----------------
tschuett wrote:
I linked the LangRef PR. Langref claims it is integer-only.
https://github.com/llvm/llvm-project/pull/98894
More information about the llvm-commits
mailing list