SuccessChanges

Summary

  1. [CostModel] add cl option to check size and latency costs; NFC (details)
  2. [X86] Regenerate i128 sdiv tests and add i686 coverage. (details)
  3. [X86] Add some basic i128 udiv test coverage (details)
  4. [CVP] Pass context instruction when narrowing div/rem (details)
  5. [LVI] Require context instruction in external API (NFCI) (details)
  6. [LVI] Clarify getValueAt/getValueInBlock doc comments (NFC) (details)
  7. [CVP] Make srem test more robust (NFC) (details)
  8. [InstCombine] Simplify code. NFCI. (details)
  9. [NewPM] Port ConstraintElimination to the new pass manager (details)
  10. [LVI][CVP] Use block value when simplifying icmps (details)
  11. [CVP] Remove unnecessary block splits in tests (NFC) (details)
  12. [OpenMP] Add Missing _static Director for OpenMP Documentation (details)
  13. [BuildLibCalls] Add noalias for strcat and stpcpy (details)
Commit 816b0a9c9f46cbfce253f49dad7cbf93867307ac by spatel
[CostModel] add cl option to check size and latency costs; NFC

This is a setting used by SimplifyCFG, LoopUnroll, and InlineCost,
but there is apparently no direct test coverage for any of those
cost model values.
The file was addedllvm/test/Analysis/CostModel/X86/fmaxnum-size-latency.ll
The file was addedllvm/test/Analysis/CostModel/X86/fminnum-size-latency.ll
The file was modifiedllvm/lib/Analysis/CostModel.cpp (diff)
Commit d9499c88d19bd38b17d9d7423c0d476bc77ebcb7 by llvm-dev
[X86] Regenerate i128 sdiv tests and add i686 coverage.

To hopefully help improve the codegen delta in D87976
The file was modifiedllvm/test/CodeGen/X86/i128-sdiv.ll (diff)
Commit 2d7a12f4ecfb5e0393ab0cf4ab4f46c198e808a7 by llvm-dev
[X86] Add some basic i128 udiv test coverage
The file was addedllvm/test/CodeGen/X86/i128-udiv.ll
Commit c8abf1c12dc39f3b07b887808da4bb09d5ddbe3e by nikita.ppv
[CVP] Pass context instruction when narrowing div/rem

This fold was the only place not passing the context instruction.
The tests worked around that fact by introducing a basic block split,
which is now no longer necessary.
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/sdiv.ll (diff)
The file was modifiedllvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp (diff)
Commit 9b959b59dfaf87ba978480594d2cfcf15fe66218 by nikita.ppv
[LVI] Require context instruction in external API (NFCI)

Require CxtI in getConstant() and getConstantRange() APIs.
Accordingly drop the BB parameter, as it is implied by
CxtI->getParent().

This makes sure we don't forget to pass the context instruction,
and makes the API contract clearer (also clean up the comments to
that effect -- the value holds at the context instruction, not
the end of the block).
The file was modifiedllvm/lib/Transforms/IPO/AttributorAttributes.cpp (diff)
The file was modifiedllvm/lib/Transforms/Scalar/JumpThreading.cpp (diff)
The file was modifiedllvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp (diff)
The file was modifiedllvm/lib/Analysis/LazyValueInfo.cpp (diff)
The file was modifiedllvm/lib/Transforms/Utils/LowerSwitch.cpp (diff)
The file was modifiedllvm/include/llvm/Analysis/LazyValueInfo.h (diff)
Commit 709d03f8af4da4204849a70f01798e7cebba2e32 by nikita.ppv
[LVI] Clarify getValueAt/getValueInBlock doc comments (NFC)

The lattice value returned by getValueInBlock() holds at the start
of the block, not at the end. Also make it clearer what the
difference between getValueInBlock() and getValueAt() is.
The file was modifiedllvm/lib/Analysis/LazyValueInfo.cpp (diff)
Commit 4f6e11948c37b58e307df5aeeca4c27c546e371e by nikita.ppv
[CVP] Make srem test more robust (NFC)

D69686 will be able to determine that the icmp is always false.
As this is not the purpose of the test, use a different modulus
that doesn't trivialize the condition.
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/srem.ll (diff)
Commit 7b782062b4d580e48ab724e278f38cc3da763f02 by benny.kra
[InstCombine] Simplify code. NFCI.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp (diff)
Commit 50bd71e1d727f2fb82bfa306da00e386267572da by i
[NewPM] Port ConstraintElimination to the new pass manager

If -enable-constraint-elimination is specified, add it to the -O2/-O3 pipeline.
(-O1 uses a separate function now.)

Reviewed By: fhahn, aeubanks

Differential Revision: https://reviews.llvm.org/D88365
The file was modifiedllvm/lib/Passes/PassBuilder.cpp (diff)
The file was addedllvm/include/llvm/Transforms/Scalar/ConstraintElimination.h
The file was modifiedllvm/test/Transforms/ConstraintElimination/dom.ll (diff)
The file was modifiedllvm/lib/Passes/PassRegistry.def (diff)
The file was modifiedllvm/lib/Transforms/Scalar/ConstraintElimination.cpp (diff)
Commit fe79061be2b2915993b5568cddc6b64ea0a525f6 by nikita.ppv
[LVI][CVP] Use block value when simplifying icmps

Add a flag to getPredicateAt() that allows making use of the block
value. This allows us to take into account range information from
the current block, rather than only information that is threaded
over edges, making the icmp simplification in CVP a lot more
powerful.

I'm not changing getPredicateAt() to use the block value
unconditionally to avoid any impact on the JumpThreading pass,
which is somewhat picky about LVI query order.

Most test changes here are just icmps that now get dropped (while
previously only a result used in a return was replaced). The three
tests in icmp.ll show some representative improvements. Some of
the folds this enables have been covered by IPSCCP in the meantime,
but LVI can reason about some cases which are hard to support in
IPSCCP, such as in test_br_cmp_with_offset.

The compile-time time cost of doing this is fairly minimal, with
a ~0.05% CTMark regression for ReleaseThinLTO:
https://llvm-compile-time-tracker.com/compare.php?from=709d03f8af4da4204849a70f01798e7cebba2e32&to=6236fd503761f43c99f4537121e057a01056f185&stat=instructions

This is because the block values will typically already be queried
and cached by other CVP optimizations anyway.

Differential Revision: https://reviews.llvm.org/D69686
The file was modifiedllvm/include/llvm/Analysis/LazyValueInfo.h (diff)
The file was modifiedllvm/lib/Analysis/LazyValueInfo.cpp (diff)
The file was modifiedllvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/basic.ll (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/range.ll (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/icmp.ll (diff)
Commit 01bde7310bb92d39d86ff4ceae8ae626555e30eb by nikita.ppv
[CVP] Remove unnecessary block splits in tests (NFC)

These are no longer necessary since D69686.
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/srem.ll (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/minmaxabs.ll (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/icmp.ll (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/overflow_predicate.ll (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/overflows.ll (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/select.ll (diff)
The file was modifiedllvm/test/Transforms/CorrelatedValuePropagation/basic.ll (diff)
Commit 0103df7903b328aa4ca8116a5c4cb4c01d48ea7d by huberjn
[OpenMP] Add Missing _static Director for OpenMP Documentation

Summary:
Adding a missing directory needed for generating Sphinx documentation without
errors. Directory current contains a placeholder image just to populate the
directory.
The file was addedopenmp/docs/_static/lines.gif
Commit 155ac333945d7af507bb28dc6f2539300a4c0666 by Dávid Bolvanský
[BuildLibCalls] Add noalias for strcat and stpcpy

strcat:
destination and source shall not overlap. (http://www.cplusplus.com/reference/cstring/strcat/)

stpcpy:
The strings may not overlap, and the destination string dest must be  large enough to receive the copy. (https://man7.org/linux/man-pages/man3/stpcpy.3.html)

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D88335
The file was modifiedllvm/lib/Transforms/Utils/BuildLibCalls.cpp (diff)
The file was modifiedllvm/test/Transforms/InferFunctionAttrs/annotate.ll (diff)