[llvm] [GlobalISel] Fast path exact LLT equality (NFC) (PR #222550)

Cullen Rhodes via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 01:24:36 PDT 2026


https://github.com/c-rhodes created https://github.com/llvm/llvm-project/pull/222550

Improves CTMark geomean -0.05% on aarch64-O0-g.

https://llvm-compile-time-tracker.com/compare.php?from=87d9c3c24ff5941ac08799850a6549b561c98a81&to=a5391cd5be815299b2cddcabf62a86369b247f72&stat=instructions:u

Assisted-by: codex

>From a5391cd5be815299b2cddcabf62a86369b247f72 Mon Sep 17 00:00:00 2001
From: Cullen Rhodes <cullen.rhodes at arm.com>
Date: Mon, 4 May 2026 08:53:53 +0000
Subject: [PATCH] [GlobalISel] Fast path exact LLT equality (NFC)

Assisted-by: codex
---
 llvm/include/llvm/CodeGenTypes/LowLevelType.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/CodeGenTypes/LowLevelType.h b/llvm/include/llvm/CodeGenTypes/LowLevelType.h
index d928c7141b737..30734bcf043c9 100644
--- a/llvm/include/llvm/CodeGenTypes/LowLevelType.h
+++ b/llvm/include/llvm/CodeGenTypes/LowLevelType.h
@@ -538,6 +538,9 @@ class LLT {
 #endif
 
   bool operator==(const LLT &RHS) const {
+    if (Info == RHS.Info && RawData == RHS.RawData)
+      return true;
+
     if (isAnyScalar() || RHS.isAnyScalar())
       return isScalar() == RHS.isScalar() &&
              getScalarSizeInBits() == RHS.getScalarSizeInBits();
@@ -546,7 +549,7 @@ class LLT {
       return getElementType() == RHS.getElementType() &&
              getElementCount() == RHS.getElementCount();
 
-    return Info == RHS.Info && RawData == RHS.RawData;
+    return false;
   }
 
   bool operator!=(const LLT &RHS) const { return !(*this == RHS); }



More information about the llvm-commits mailing list