[llvm] [LV] Remove common extends and selects in CSE (PR #147731)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 03:34:59 PDT 2025


================
@@ -804,6 +804,10 @@ int FunctionComparator::cmpOperations(const Instruction *L,
         return Res;
     }
   }
+  if (const CastInst *Cast = dyn_cast<CastInst>(L)) {
----------------
sdesmalen-arm wrote:

I just asked myself the same question, because it is surprising this requires explicit code, but my understanding is that a return value of `!= 0` means that they different and don't match. So this only returns `Res` here if they are not the same.

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


More information about the llvm-commits mailing list