Changes

Summary

  1. [SCEV] Support negative values in signed/unsigned predicate reasoning (details)
  2. [libc] Add implementations of div, ldiv, lldiv and imaxdiv. (details)
  3. Revert "Revert "[IndVars] Replace PHIs if loop exits on 1st iteration"" (details)
  4. [NFC] Add assert and test showing that revert of D109596 wasn't justified (details)
Commit def15c5fb6a117c1b6d8b2835f6760f814410582 by mkazantsev
[SCEV] Support negative values in signed/unsigned predicate reasoning

There is a piece of logic that uses the fact that signed and unsigned
versions of the same predicate are equivalent when both values are
non-negative. It's also true when both of them are negative.

Differential Revision: https://reviews.llvm.org/D109957
Reviewed By: nikic
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/test/Transforms/IndVarSimplify/negative_ranges.ll
Commit 74670e79b0a00224c04dfc6a446ea4439f4cfca4 by sivachandra
[libc] Add implementations of div, ldiv, lldiv and imaxdiv.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D109952
The file was addedlibc/test/src/stdlib/lldiv_test.cpp
The file was addedlibc/src/stdlib/lldiv.cpp
The file was modifiedlibc/test/src/stdlib/CMakeLists.txt
The file was addedlibc/src/stdlib/ldiv.cpp
The file was addedlibc/src/inttypes/imaxdiv.h
The file was modifiedlibc/src/stdlib/CMakeLists.txt
The file was modifiedlibc/test/src/inttypes/CMakeLists.txt
The file was addedlibc/test/src/inttypes/imaxdiv_test.cpp
The file was addedlibc/test/src/stdlib/DivTest.h
The file was modifiedlibc/config/linux/x86_64/entrypoints.txt
The file was addedlibc/src/stdlib/div.h
The file was addedlibc/src/stdlib/lldiv.h
The file was modifiedlibc/src/__support/integer_operations.h
The file was modifiedlibc/src/inttypes/CMakeLists.txt
The file was addedlibc/src/stdlib/ldiv.h
The file was addedlibc/src/stdlib/div.cpp
The file was addedlibc/test/src/stdlib/div_test.cpp
The file was modifiedlibc/config/linux/api.td
The file was modifiedlibc/spec/stdc.td
The file was modifiedlibc/config/linux/aarch64/entrypoints.txt
The file was addedlibc/test/src/stdlib/ldiv_test.cpp
The file was addedlibc/src/inttypes/imaxdiv.cpp
Commit 471217cff8e5c827f2ee52175a1c94584699cab2 by mkazantsev
Revert "Revert "[IndVars] Replace PHIs if loop exits on 1st iteration""

This reverts commit 6fec6552f54885ae06bf76b35f9f1173a0561a4c.

The patch was reverted on incorrect claim that this patch may break LCSSA form
when the loop is not in a simplify form. All IndVars' transform insure that
the loop is in simplify and LCSSA form, so if it wasn't broken before this
transform, it will also not be broken after it.
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
The file was modifiedllvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll
The file was modifiedllvm/test/Transforms/IndVarSimplify/floating-point-iv.ll
The file was modifiedllvm/test/Transforms/IndVarSimplify/eliminate-exit-no-dl.ll
Commit e9d34c54290e277e075aed33036fddae77b5f582 by mkazantsev
[NFC] Add assert and test showing that revert of D109596 wasn't justified

All transforms of IndVars have prerequisite requirement of LCSSA and LoopSimplify
form and rely on it. Added test that shows that this actually stands.
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
The file was modifiedllvm/test/Transforms/IndVarSimplify/eliminate-backedge.ll