[all-commits] [llvm/llvm-project] fc48c7: [VPlan] Fix nowrap flags for strided access pointe...

Mel Chen via All-commits all-commits at lists.llvm.org
Wed Jul 15 11:05:21 PDT 2026


  Branch: refs/heads/release/23.x
  Home:   https://github.com/llvm/llvm-project
  Commit: fc48c7e574f87f478ed17cee143afae350f7be88
      https://github.com/llvm/llvm-project/commit/fc48c7e574f87f478ed17cee143afae350f7be88
  Author: Mel Chen <mel.chen at sifive.com>
  Date:   2026-07-15 (Wed, 15 Jul 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
    M llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses-unroll.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll

  Log Message:
  -----------
  [VPlan] Fix nowrap flags for strided access pointers from SCEV (#209453)

This patch addresses two things. First, the offset calculation
(canonical IV * stride) should not reuse the NSW flag of the add
recurrence. The NSW property from SCEV for the original scalar
recurrence does not necessarily hold for the reconstructed
multiplication using the vector canonical IV. The NUW flag, however, can
still be safely propagated.
Second, because vputils::getGEPFlagsForPtr currently doesn't support
recipes other than VPInstruction, and to avoid relying on LLVM IR
function (like calling stripPointerCasts()), we change
VPVectorPointerRecipe's GEP flags to use the add recurrence's flags to
prevent propagating unprovable GEP flags like inbounds.

(cherry picked from commit 1d4148821bf96bef23ea77952031e3e7bec26d3a)



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