[all-commits] [llvm/llvm-project] af9a42: [LAA] Only use inbounds/nusw in isNoWrap if the GE...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Nov 4 09:08:33 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: af9a4263a1a209953a1d339ef781a954e31268ff
      https://github.com/llvm/llvm-project/commit/af9a4263a1a209953a1d339ef781a954e31268ff
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2025-11-04 (Tue, 04 Nov 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/LoopAccessAnalysis.h
    M llvm/lib/Analysis/LoopAccessAnalysis.cpp
    M llvm/lib/Analysis/VectorUtils.cpp
    M llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
    M llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
    M llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
    M llvm/test/Analysis/LoopAccessAnalysis/inbounds-gep-in-predicated-blocks.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/masked_gather_scatter.ll
    M llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll

  Log Message:
  -----------
  [LAA] Only use inbounds/nusw in isNoWrap if the GEP is dereferenced. (#161445)

Update isNoWrap to only use the inbounds/nusw flags from GEPs that are
guaranteed to be dereferenced on every iteration. This fixes a case
where we incorrectly determine no dependence.

I think the issue is isolated to code that evaluates the resulting
AddRec at BTC, just using it to compute the distance between accesses
should still be fine; if the access does not execute in a given
iteration, there's no dependence in that iteration. But isolating the
code is not straight-forward, so be conservative for now. The practical
impact should be very minor (only one loop changed across a corpus with
27k modules from large C/C++ workloads.

Fixes https://github.com/llvm/llvm-project/issues/160912.

PR: https://github.com/llvm/llvm-project/pull/161445



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