[llvm] Add 3 way compare <=> integer intrinsics to Langref (PR #83227)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 08:28:39 PDT 2024


Miguel Raz =?utf-8?q?Guzmán?= Macedo,
Miguel Raz =?utf-8?q?Guzmán?= Macedo,
Miguel Raz =?utf-8?q?Guzmán?= Macedo,
Miguel Raz =?utf-8?q?Guzmán?= Macedo,miguelraz
 <miguelraz at ciencias.unam.mx>,miguelraz <miguelraz at ciencias.unam.mx>,miguelraz
 <miguelraz at ciencias.unam.mx>,miguelraz <miguelraz at ciencias.unam.mx>,miguelraz
 <miguelraz at ciencias.unam.mx>,miguelraz <miguelraz at ciencias.unam.mx>,
Miguel Raz =?utf-8?q?Guzmán?= Macedo,
Miguel Raz =?utf-8?q?Guzmán?= Macedo
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/83227 at github.com>


================
@@ -5235,6 +5235,24 @@ 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, "result type must be at least 2 bits wide", Call);
+
+    bool isDestTypeVector = DestTy->isVectorTy();
----------------
nikic wrote:

```suggestion
    bool IsDestTypeVector = DestTy->isVectorTy();
```
Here and below. LLVM has an unusual coding style where variable names must start with an uppercase letter, see https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly.

https://github.com/llvm/llvm-project/pull/83227


More information about the llvm-commits mailing list