Skip to content

78 tests fail with all SCEV verification options enabled #63195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arsenm opened this issue Jun 8, 2023 · 3 comments
Closed

78 tests fail with all SCEV verification options enabled #63195

arsenm opened this issue Jun 8, 2023 · 3 comments
Labels
llvm:SCEV Scalar Evolution

Comments

@arsenm
Copy link
Contributor

arsenm commented Jun 8, 2023

By changing the default values to enable -verify-scev, -verify-scev-strict, -verify-scev-maps, and -scev-verify-ir, I observe 78 test failures:

  LLVM :: Analysis/ScalarEvolution/infer-via-ranges.ll
  LLVM :: Analysis/ScalarEvolution/latch-dominating-conditions.ll
  LLVM :: Analysis/ScalarEvolution/pr35890.ll
  LLVM :: CodeGen/AArch64/sme-intrinsics-mova-extract.ll
  LLVM :: CodeGen/AArch64/sme-intrinsics-mova-insert.ll
  LLVM :: CodeGen/AArch64/sve-fold-vscale.ll
  LLVM :: CodeGen/AArch64/sve-int-arith.ll
  LLVM :: CodeGen/AArch64/sve-lsr-scaled-index-addressing-mode.ll
  LLVM :: CodeGen/AArch64/sve-ptest-removal-sink.ll
  LLVM :: CodeGen/ARM/branch-on-zero.ll
  LLVM :: CodeGen/Hexagon/concat-vectors-legalize.ll
  LLVM :: CodeGen/PowerPC/2011-12-05-NoSpillDupCR.ll
  LLVM :: CodeGen/RISCV/rvv/sink-splat-operands.ll
  LLVM :: CodeGen/Thumb2/LowOverheadLoops/fast-fp-loops.ll
  LLVM :: CodeGen/Thumb2/LowOverheadLoops/loop-guards.ll
  LLVM :: CodeGen/Thumb2/LowOverheadLoops/memcall.ll
  LLVM :: CodeGen/Thumb2/LowOverheadLoops/mve-float-loops.ll
  LLVM :: CodeGen/Thumb2/LowOverheadLoops/mve-tail-data-types.ll
  LLVM :: CodeGen/Thumb2/LowOverheadLoops/while-loops.ll
  LLVM :: CodeGen/Thumb2/mve-float16regloops.ll
  LLVM :: CodeGen/Thumb2/mve-float32regloops.ll
  LLVM :: CodeGen/Thumb2/mve-postinc-distribute.ll
  LLVM :: CodeGen/Thumb2/mve-postinc-lsr.ll
  LLVM :: CodeGen/Thumb2/mve-vmaxnma-commute.ll
  LLVM :: CodeGen/X86/avx512vnni-combine.ll
  LLVM :: CodeGen/X86/avxvnni-combine.ll
  LLVM :: CodeGen/X86/coalescer-commute4.ll
  LLVM :: CodeGen/X86/masked-iv-unsafe.ll
  LLVM :: CodeGen/X86/optimize-max-0.ll
  LLVM :: CodeGen/X86/optimize-max-3.ll
  LLVM :: CodeGen/X86/pr49451.ll
  LLVM :: DebugInfo/Generic/indvar-discriminator.ll
  LLVM :: Transforms/HardwareLoops/ARM/simple-do.ll
  LLVM :: Transforms/HardwareLoops/ARM/structure.ll
  LLVM :: Transforms/IndVarSimplify/2020-12-15-trunc-bug-expensive-range-inference.ll
  LLVM :: Transforms/IndVarSimplify/AArch64/widen-loop-comp.ll
  LLVM :: Transforms/IndVarSimplify/AMDGPU/no-widen-to-i64.ll
  LLVM :: Transforms/IndVarSimplify/X86/eliminate-trunc.ll
  LLVM :: Transforms/IndVarSimplify/X86/indvar-debug-value.ll
  LLVM :: Transforms/IndVarSimplify/X86/indvar-debug-value2.ll
  LLVM :: Transforms/IndVarSimplify/X86/inner-loop.ll
  LLVM :: Transforms/IndVarSimplify/X86/iv-widen.ll
  LLVM :: Transforms/IndVarSimplify/bec-cmp.ll
  LLVM :: Transforms/IndVarSimplify/deterministic-sign.ll
  LLVM :: Transforms/IndVarSimplify/elim-extend.ll
  LLVM :: Transforms/IndVarSimplify/eliminate-comparison.ll
  LLVM :: Transforms/IndVarSimplify/eliminate-max.ll
  LLVM :: Transforms/IndVarSimplify/finite-exit-comparisons.ll
  LLVM :: Transforms/IndVarSimplify/full_widening.ll
  LLVM :: Transforms/IndVarSimplify/invalidate-modified-lcssa-phi.ll
  LLVM :: Transforms/IndVarSimplify/iv-sext.ll
  LLVM :: Transforms/IndVarSimplify/iv-widen-elim-ext.ll
  LLVM :: Transforms/IndVarSimplify/lftr-reuse.ll
  LLVM :: Transforms/IndVarSimplify/lftr.ll
  LLVM :: Transforms/IndVarSimplify/no-iv-rewrite.ll
  LLVM :: Transforms/IndVarSimplify/post-inc-range.ll
  LLVM :: Transforms/IndVarSimplify/preserve-signed-wrap.ll
  LLVM :: Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
  LLVM :: Transforms/IndVarSimplify/sharpen-range.ll
  LLVM :: Transforms/IndVarSimplify/signed-trip-count.ll
  LLVM :: Transforms/IndVarSimplify/udiv.ll
  LLVM :: Transforms/IndVarSimplify/ult-sub-to-eq.ll
  LLVM :: Transforms/IndVarSimplify/use-range-metadata.ll
  LLVM :: Transforms/InferAddressSpaces/AMDGPU/flat_atomic.ll
  LLVM :: Transforms/LoopDeletion/invalidate-scev-after-hoisting.ll
  LLVM :: Transforms/LoopFlatten/widen-iv2.ll
  LLVM :: Transforms/LoopFusion/simple.ll
  LLVM :: Transforms/LoopStrengthReduce/AArch64/pr47329.ll
  LLVM :: Transforms/LoopStrengthReduce/RISCV/icmp-zero.ll
  LLVM :: Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll
  LLVM :: Transforms/LoopStrengthReduce/debuginfo-scev-salvage-0.ll
  LLVM :: Transforms/LoopStrengthReduce/debuginfo-scev-salvage-5.ll
  LLVM :: Transforms/LoopVectorize/X86/float-induction-x86.ll
  LLVM :: Transforms/LoopVectorize/X86/unroll-pm.ll
  LLVM :: Transforms/LoopVersioningLICM/loopversioningLICM2.ll
  LLVM :: Transforms/PhaseOrdering/X86/excessive-unrolling.ll
  LLVM :: Transforms/PhaseOrdering/X86/pixel-splat.ll
  LLVM :: Transforms/PhaseOrdering/X86/vdiv.ll

Most look like this trip count changed sample:

Trip Count for Loop at depth 1 containing: %bb<header><latch><exiting>
 Changed!
Old: (-1 + (1 umax %c))
New: (-1 + %c)

A few are different:

test/Analysis/ScalarEvolution/pr35890.ll
--
Exit Code: 2

Command Output (stderr):
--
SCEV for value   %iv.next = add i32 %iv, %a.1 changed!
Old: {(1 + %a),+,(1 + %a)}<%loop>
New: (1 + {0,+,(1 + %a)}<%loop> + %a)
Delta: (-1 + (-1 * {0,+,(1 + %a)}<%loop>) + (-1 * %a) + {(1 + %a),+,(1 + %a)}<%loop>)
@arsenm arsenm added the llvm:SCEV Scalar Evolution label Jun 8, 2023
@jayfoad
Copy link
Contributor

jayfoad commented Jun 8, 2023

See also #128, #55689.

@nikic
Copy link
Contributor

nikic commented Jun 8, 2023

We should remove -verify-scev-strict -- it just confuses people not familiar with SCEV ("strict must be better, right?"). -verify-scev-maps can be removed as well, this is mostly covered by -verify-scev now. -scev-verify-ir might still have some value as a debugging option.

@nikic
Copy link
Contributor

nikic commented Jun 9, 2023

-verify-scev-maps removed in c1aa0dc. I've put up https://reviews.llvm.org/D152513 to slightly strengthen -verify-scev with the hopefully false positive free subset of -verify-scev-strict. Once that is done, we should rename -verify-scev-strict to -verify-scev-with-false-positives or similar.

@arsenm arsenm closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:SCEV Scalar Evolution
Projects
None yet
Development

No branches or pull requests

3 participants