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

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 05:41:07 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))
----------------
SamTebbs33 wrote:

It seems as though this change isn't actually necessary and I've added some tests with different destination types to show that.

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


More information about the llvm-commits mailing list