[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


================
@@ -920,6 +920,8 @@ bool Instruction::hasSameSpecialState(const Instruction *I2,
   if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I1))
     return GEP->getSourceElementType() ==
            cast<GetElementPtrInst>(I2)->getSourceElementType();
+  if (const CastInst *Cast = dyn_cast<CastInst>(I1))
----------------
sdesmalen-arm wrote:

FWIW, I couldn't find any dedicated tests for `Instruction::isSameOperationAs`, so perhaps the changes to existing tests would be sufficient?

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


More information about the llvm-commits mailing list