[llvm] [CVP] #114820 add 'samesign' for 'icmp' (PR #115642)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 10 01:22:26 PST 2024


================
@@ -288,24 +288,36 @@ static bool processICmp(ICmpInst *Cmp, LazyValueInfo *LVI) {
   if (!Cmp->getOperand(0)->getType()->isIntOrIntVectorTy())
     return false;
 
-  if (!Cmp->isSigned())
+  if (!(Cmp->isSigned() || (Cmp->isUnsigned() && !Cmp->hasSameSign())))
----------------
nikic wrote:

```suggestion
  if (!Cmp->isSigned() && (!Cmp->isUnsigned() || Cmp->hasSameSign())))
```
nit: Prefer pushing `!` into conditions.

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


More information about the llvm-commits mailing list