[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
================
@@ -804,6 +804,10 @@ int FunctionComparator::cmpOperations(const Instruction *L,
return Res;
}
}
+ if (const CastInst *Cast = dyn_cast<CastInst>(L)) {
----------------
david-arm wrote:
Perhaps I'm missing something here, but I'm surprised this isn't already caught by
```
if (int Res = cmpTypes(L->getType(), R->getType()))
return Res;
```
above? Wouldn't `L->getType()` be equivalent to `Cast->getDestTy()`?
https://github.com/llvm/llvm-project/pull/147731
More information about the llvm-commits
mailing list