[NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV expressions
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 26 Feb 2021 13:48:58 +0000 (16:48 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 6 Mar 2021 18:52:46 +0000 (21:52 +0300)
commitb46c085d2b6d15873fb53718f0a70b3848e19e4a
tree59738a0d0244c509d4f2fa921a9b5c7b115ec3a3
parentf0904a62085aa84737e7e6f2a2318cda0d52c371
[NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV expressions

These intrinsics, not the icmp+select are the canonical form nowadays,
so we might as well directly emit them.

This should not cause any regressions, but if it does,
then then they would needed to be fixed regardless.

Note that this doesn't deal with `SCEVExpander::isHighCostExpansion()`,
but that is a pessimization, not a correctness issue.

Additionally, the non-intrinsic form has issues with undef,
see https://reviews.llvm.org/D88287#2587863
49 files changed:
llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
llvm/test/Analysis/ScalarEvolution/2007-08-06-MisinterpretBranch.ll
llvm/test/CodeGen/Thumb2/LowOverheadLoops/unpredload.ll
llvm/test/Transforms/HardwareLoops/ARM/fp-emulation.ll
llvm/test/Transforms/HardwareLoops/ARM/simple-do.ll
llvm/test/Transforms/HardwareLoops/loop-guards.ll
llvm/test/Transforms/IRCE/bad_expander.ll
llvm/test/Transforms/IRCE/clamp.ll
llvm/test/Transforms/IRCE/conjunctive-checks.ll
llvm/test/Transforms/IRCE/correct-loop-info.ll
llvm/test/Transforms/IRCE/decrementing-loop.ll
llvm/test/Transforms/IRCE/multiple-access-no-preloop.ll
llvm/test/Transforms/IRCE/non-loop-invariant-rhs-instr.ll
llvm/test/Transforms/IRCE/range_intersect_miscompile.ll
llvm/test/Transforms/IRCE/ranges_of_different_types.ll
llvm/test/Transforms/IRCE/rc-negative-bound.ll
llvm/test/Transforms/IRCE/single-access-no-preloop.ll
llvm/test/Transforms/IRCE/single-access-with-preloop.ll
llvm/test/Transforms/IRCE/unsigned_comparisons_ugt.ll
llvm/test/Transforms/IRCE/unsigned_comparisons_ult.ll
llvm/test/Transforms/IndVarSimplify/ARM/code-size.ll
llvm/test/Transforms/IndVarSimplify/X86/eliminate-trunc.ll
llvm/test/Transforms/IndVarSimplify/X86/iv-widen.ll
llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
llvm/test/Transforms/IndVarSimplify/elim-extend.ll
llvm/test/Transforms/IndVarSimplify/eliminate-comparison.ll
llvm/test/Transforms/IndVarSimplify/full_widening.ll
llvm/test/Transforms/IndVarSimplify/lcssa-preservation.ll
llvm/test/Transforms/IndVarSimplify/lftr-multi-exit.ll
llvm/test/Transforms/IndVarSimplify/lftr-reuse.ll
llvm/test/Transforms/IndVarSimplify/loop-predication.ll
llvm/test/Transforms/IndVarSimplify/no-iv-rewrite.ll
llvm/test/Transforms/IndVarSimplify/replace-loop-exit-folds.ll
llvm/test/Transforms/IndVarSimplify/sentinel.ll
llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll
llvm/test/Transforms/LoopPredication/predicate-exits.ll
llvm/test/Transforms/LoopUnroll/runtime-loop-multiexit-dom-verify.ll
llvm/test/Transforms/LoopVectorize/X86/cost-model-assert.ll
llvm/test/Transforms/LoopVectorize/X86/float-induction-x86.ll
llvm/test/Transforms/LoopVectorize/X86/invariant-load-gather.ll
llvm/test/Transforms/LoopVectorize/X86/invariant-store-vectorization.ll
llvm/test/Transforms/LoopVectorize/X86/pr23997.ll
llvm/test/Transforms/LoopVectorize/X86/pr35432.ll
llvm/test/Transforms/LoopVectorize/first-order-recurrence-complex.ll
llvm/test/Transforms/LoopVectorize/first-order-recurrence.ll
llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
llvm/test/Transforms/LoopVectorize/invariant-store-vectorization.ll
llvm/test/Transforms/LoopVectorize/loop-form.ll