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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 06:44:24 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)
----------------
lukel97 wrote:

Where are we checking for the indexed type? On VPVectorPointerRecipe it's stored in the class, and I think for VPWidenGEPRecipe it gets it from the underlying instruction?

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


More information about the llvm-commits mailing list