[llvm] [GVN] Replace icmp samesign with icmp flipped signedness (PR #227855)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 06:34:47 PDT 2026


================
@@ -3477,6 +3477,21 @@ bool GVNPass::processInstruction(Instruction *I) {
           return true;
         }
       }
+      auto *ICmp = dyn_cast<ICmpInst>(Cmp);
+      if (ICmp && ICmp->hasSameSign()) {
----------------
nikic wrote:

Check for !isEquality here? It can have samesign, but flipped pred is the same.

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


More information about the llvm-commits mailing list