[all-commits] [llvm/llvm-project] 4db93e: [IndVars] Recompute flags if needed in widenIVUse ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Feb 20 06:03:38 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4db93e5d56440be44d8ad2036e2579208c82ad37
      https://github.com/llvm/llvm-project/commit/4db93e5d56440be44d8ad2036e2579208c82ad37
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2024-02-20 (Tue, 20 Feb 2024)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
    M llvm/test/Transforms/IndVarSimplify/hoist-wide-inc-for-narrow-use-recompute-flags.ll

  Log Message:
  -----------
  [IndVars] Recompute flags if needed in widenIVUse of IV increment. (#82352)

widenIVUse may hoist a wide induction increment and introduce new uses,
but does not recompute the wrap flags. In some cases this can make the
new uses of the wide IV inc more poisonous.

Update the code to recompute flags if needed when hoisting an IV. If
both the narrow and wide IV increment's flags match and we can re-use
the flags from the increments, there's no need to recompute the flags,
as the replacement won't make the new uses of the wide IV's increment
more poisonous.

Note that this also updates a stale comment which claimed that the widen
increment is only used if it dominates the new use.

The helper should also be used to guard the code added in da437330be,
which I am planning on doing separately once the helper lands.

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



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