[all-commits] [llvm/llvm-project] 707fac: [GVN] Preserve vectorization opportunities when PR...

Tomas Matheson via All-commits all-commits at lists.llvm.org
Thu Oct 1 04:04:54 PDT 2026


  Branch: refs/heads/users/tommat01/dereferenceable2
  Home:   https://github.com/llvm/llvm-project
  Commit: 707faced01da1f6505e8559a0ef012e726a197e4
      https://github.com/llvm/llvm-project/commit/707faced01da1f6505e8559a0ef012e726a197e4
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    M llvm/lib/Transforms/Scalar/GVN.cpp
    A llvm/test/Transforms/GVN/PRE/loop-load-pre-vectorization.ll

  Log Message:
  -----------
  [GVN] Preserve vectorization opportunities when PREing loop loads

Loop load PRE can replace an invariant-address load with a loop-carried
PHI and conditional reload after a may-alias store. That scalar recurrence
can prevent vectorization even when runtime alias checks could disambiguate
the original accesses. Subsequent full unrolling then expands scalar code.

Conservatively preserve the header load in innermost loops whose clobber
is a conditional may-alias store through a varying pointer. Keep existing
PRE behavior for invariant-address clobbers, known aliasing, calls, ordered
memory operations, and loops with vectorization disabled or completed.
This is an opportunity heuristic, not a vectorization legality proof.


  Commit: 4eec78b0f0506eb4d3414a5e4716cafa0f18e4aa
      https://github.com/llvm/llvm-project/commit/4eec78b0f0506eb4d3414a5e4716cafa0f18e4aa
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    A clang/test/CodeGen/gvn-vectorization-pipeline.c
    M llvm/include/llvm/Transforms/Scalar/GVN.h
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/Scalar/GVN.cpp
    M llvm/test/Other/new-pm-print-pipeline.ll
    M llvm/test/Transforms/GVN/PRE/loop-load-pre-vectorization.ll

  Log Message:
  -----------
  - GVN now respects pipeline vectorization settings.
- Loop-access analysis rejects unsuitable indirect stores, retaining PRE.


Compare: https://github.com/llvm/llvm-project/compare/8e0cefb95c60...4eec78b0f050

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list