[llvm] [LV] Convert gather loads with invariant stride into strided loads (PR #147297)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 23 01:09:12 PDT 2025


================
@@ -1805,6 +1802,29 @@ class LLVM_ABI_FOR_TEST VPWidenGEPRecipe : public VPRecipeWithIRFlags {
   /// This recipe generates a GEP instruction.
   unsigned getOpcode() const { return Instruction::GetElementPtr; }
 
+  bool isPointerLoopInvariant() const {
+    return getOperand(0)->isDefinedOutsideLoopRegions();
+  }
----------------
Mel-Chen wrote:

Change it to public because `determineBaseAndStride` calls `isPointerLoopInvariant()` to temporarily exclude cases where the base address is not invariant.

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


More information about the llvm-commits mailing list