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

Tomas Matheson via All-commits all-commits at lists.llvm.org
Mon Sep 28 10:10:29 PDT 2026


  Branch: refs/heads/users/tommat01/dereferenceable2
  Home:   https://github.com/llvm/llvm-project
  Commit: ef4464e0385a2a6ff1da3d0c03d0c24f1ca6992c
      https://github.com/llvm/llvm-project/commit/ef4464e0385a2a6ff1da3d0c03d0c24f1ca6992c
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2026-09-28 (Mon, 28 Sep 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.

In MonteCarloAmericanOptions, the current frontend branch already avoids
early unrolling of the payoff loop. GVN load PRE, rather than early
unrolling, blocks vectorization. This change restores VF=2 vectorization
and reduces five-run median runtime from 1876.0 to 1689.6 ms on Neoverse V3,
with identical printed prices. Disabling loop unrolling alone is slower.
Broader performance evaluation is still needed before upstream submission.

Validation: 3261 tests passed, 306 unsupported, one expected failure across
GVN, LoopVectorize, LoopUnroll, and Clang OpenMP. New checks are generated
with update_test_checks.py and a second update is unchanged.



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