[llvm] Add 3 way compare <=> integer intrinsics to Langref (PR #83227)
    Miguel Raz Guzmán Macedo via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Mar 11 17:35:11 PDT 2024
    
    
  
================
@@ -5235,6 +5235,23 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
     }
     break;
   }
+  case Intrinsic::ucmp:
+  case Intrinsic::scmp: {
+
+    Type *SrcTy = Call.getOperand(0)->getType();
+    Type *DestTy = Call.getType();
+
+    Check(DestTy->getScalarSizeInBits() >= 2, "DestTy must be at least 2 bits wide", Call);
+
+    bool isDestTypeVector = DestTy->isVectorTy();
+    Check(SrcTy->isVectorTy() == isDestTypeVector,
+        "[u]scmp source and destination must both be a vector or neither", Call);
+    if (isDestTypeVector) {
+      Check(SrcTy->getArrayNumElements() == DestTy->getArrayNumElements(),
----------------
miguelraz wrote:
Hmph, fixing that here, but maybe I can write that down as a separate TODO for later.
https://github.com/llvm/llvm-project/pull/83227
    
    
More information about the llvm-commits
mailing list