[llvm] [ScalarEvolutionExpander] Don't drop nowrap flags on addrec expansion (PR #78199)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 01:12:24 PST 2024


nikic wrote:

> I'm not sure where exactly we expand addrecs in canonical mode, so I'd suggest adding an assert into the branch and seeing which tests fail, then modify those.

Ah well, it looks like you effectively already did that by trying to use an invalid nowrap flag. List of failing tests:
```
  LLVM :: CodeGen/AMDGPU/loop-prefetch-data.ll
  LLVM :: CodeGen/PowerPC/hardware-loops-crash.ll
  LLVM :: CodeGen/PowerPC/loop-data-prefetch-inner.ll
  LLVM :: CodeGen/PowerPC/loop-data-prefetch.ll
  LLVM :: CodeGen/PowerPC/loop-hoist-toc-save.ll
  LLVM :: CodeGen/PowerPC/ppc64-get-cache-line-size.ll
  LLVM :: CodeGen/SystemZ/prefetch-02.ll
  LLVM :: CodeGen/SystemZ/prefetch-03.ll
  LLVM :: CodeGen/SystemZ/prefetch-04.ll
  LLVM :: CodeGen/Thumb2/LowOverheadLoops/tail-pred-reduce.ll
  LLVM :: CodeGen/Thumb2/LowOverheadLoops/varying-outer-2d-reduction.ll
  LLVM :: Transforms/IRCE/pr57335.ll
  LLVM :: Transforms/LICM/AliasSetMemSet.ll
  LLVM :: Transforms/LoopDataPrefetch/AArch64/kryo-large-stride.ll
  LLVM :: Transforms/LoopDataPrefetch/AArch64/large-stride.ll
  LLVM :: Transforms/LoopDataPrefetch/AArch64/opt-remark-with-hotness.ll
  LLVM :: Transforms/LoopDataPrefetch/AArch64/opt-remark.ll
  LLVM :: Transforms/LoopDataPrefetch/PowerPC/basic.ll
  LLVM :: Transforms/LoopDataPrefetch/RISCV/basic.ll
  LLVM :: Transforms/LoopIdiom/basic-address-space.ll
  LLVM :: Transforms/LoopIdiom/basic.ll
  LLVM :: Transforms/LoopIdiom/lir-heurs-multi-block-loop.ll
  LLVM :: Transforms/LoopVectorize/multiple-strides-vectorization.ll
  LLVM :: Transforms/LoopVectorize/pr55100-expand-scev-predicate-used.ll
  LLVM :: Transforms/LoopVectorize/runtime-checks-difference.ll
  LLVM :: Transforms/LoopVersioningLICM/loopversioningLICM1.ll
  LLVM :: Transforms/LoopVersioningLICM/loopversioningLICM2.ll
  LLVM :: Transforms/LoopVersioningLICM/metadata.ll
```
Probably LoopIdiom is the best candidate for a test case.

https://github.com/llvm/llvm-project/pull/78199


More information about the llvm-commits mailing list