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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 9 06:07:23 PDT 2025


================
@@ -1897,6 +1900,9 @@ class VPVectorPointerRecipe : public VPRecipeWithIRFlags,
 
   VP_CLASSOF_IMPL(VPDef::VPVectorPointerSC)
 
+  /// This recipe primarily generates a GEP instruction.
+  unsigned getOpcode() const { return Instruction::GetElementPtr; }
----------------
fhahn wrote:

Sure for the specific use in this PR it is fine, but if we make this part of the generic getOpcode API we may be leaving a footgun where other places incorrectly treat this as a plain GEP. Better move the logic to the CSE logic in VPlanTransforms.cpp

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


More information about the llvm-commits mailing list