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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 03:21:55 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))
----------------
david-arm wrote:

It would be good to have a PR for these changes in isolation with some non-vectoriser tests that show the improvement.

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


More information about the llvm-commits mailing list