[llvm] [VPlan] Extend CSE to eliminate GEPs (PR #156699)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 06:47:40 PDT 2025


================
@@ -1976,8 +1976,11 @@ struct VPCSEDenseMapInfo : public DenseMapInfo<VPSingleDefRecipe *> {
   static bool canHandle(const VPSingleDefRecipe *Def) {
     // We can extend the list of handled recipes in the future,
     // provided we account for the data embedded in them while checking for
-    // equality or hashing.
-    auto C = getOpcodeOrIntrinsicID(Def);
+    // equality or hashing. We assign VPVectorEndPointerRecipe the GEP opcode,
+    // as it is essentially a GEP with different semantics.
+    auto C = isa<VPVectorPointerRecipe>(Def)
----------------
artagnon wrote:

I think this is type of the GEP, and hence VPTypeAnalysis::inferScalarType() should automatically check it?

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


More information about the llvm-commits mailing list