Changes

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [libc++][format] Adds formatting benchmarks. (details)
  2. [SCEV] Turn validity check in getExistingSCEV into assert (NFC). (details)
  3. [libc++] Remove support for Clang 9 and older. (details)
  4. [libc++] Add myself to the credits. (details)
  5. [InstCombine] reduce code duplication; NFC (details)
  6. [InstCombine] use decomposeBitTestICmp to make icmp (trunc X), C more consistent (details)
  7. [ARM] Add testing for various fptosi.sat patterns. NFC (details)
  8. [clang] Fix -Wreturn-type false positive in @try statements (details)
  9. [llvm] Use range-based for loops (NFC) (details)
  10. [LV] Move code from widenGEP to VPWidenGEPRecipe (NFC). (details)
  11. [ELF] Simplify assignFileOffsets. NFC (details)
  12. [ELF] -z separate-*: Use max-page-size instead of common-page-size for text/non-SHF_ALLOC transition and writeTrapInstr (details)
  13. [DSE] Use MapVector for IOLs (details)
  14. [AArch64] Avoid crashing on invalid -Wa,-march= values (details)
  15. [mlir] NFC - Move invalid.mlir tests to the proper dialects (details)
  16. [ELF] Simplify assignFileOffsets (details)
Commit 01631ffcfca768c97e4a26c2d86af1ecb4b28b22 by koraq
[libc++][format] Adds formatting benchmarks.

These benchmarks will be used to test the performance inpact of the next
set of optimization patches.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D110501
The file was addedlibcxx/benchmarks/format_to.bench.cpp
The file was addedlibcxx/benchmarks/formatted_size.bench.cpp
The file was addedlibcxx/benchmarks/format.bench.cpp
The file was addedlibcxx/benchmarks/format_to_n.bench.cpp
Commit 7b75110fac979be24eed0178caa9d1f8c68e14eb by flo
[SCEV] Turn validity check in getExistingSCEV into assert (NFC).

Now that we track users of SCEV expressions, we should be able to always
invalidate containing expressions.

With that, I think the case where a value gets removed but
SCEVs containing references to it should not be possible any longer.
Turn check into an assert.

This slightly reduces compile-time:

NewPM-O3: -0.27%
NewPM-ReleaseThinLTO: -0.21%
NewPM-ReleaseLTO-g: -0.26%

http://llvm-compile-time-tracker.com/compare.php?from=c3dc6b081da6ba503e67d260033f81f61eb38ea3&to=95a4a028b1f1dd0bc3d221435953b7d2c031b3d5&stat=instructions

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D114633
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
Commit 730dccb98622a82d1cad65e784ce5a8e8323e8cb by koraq
[libc++] Remove support for Clang 9 and older.

I encountered this while reviewing an unrelated patch. Will land after
the CI passes.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D114673
The file was modifiedlibcxx/include/type_traits
Commit cb68fc814af63a7dc2f696fccbcc6971c76956bd by koraq
[libc++] Add myself to the credits.

Noticed while updating the credits for the to_chars patch.
The file was modifiedlibcxx/CREDITS.TXT
Commit 97755ab1c67f01031d1f2e1a972b00c76841f6f8 by spatel
[InstCombine] reduce code duplication; NFC
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Commit f55d1eb3746a17688ca10d4e699ccea7d0f15378 by spatel
[InstCombine] use decomposeBitTestICmp to make icmp (trunc X), C more consistent

This is a follow-on suggested in D112634.
Two folds that were added with that patch are subsumed in the call to
decomposeBitTestICmp, and two other folds are potentially inverted.

The deleted folds were very specialized by instcombine standards
because they were restricted to legal integer types based on the data
layout. This generalizes the canonical form independent of target/types.

This change has a reasonable chance of exposing regressions either in
IR or codegen, but I don't have any evidence for either of those yet.
A spot check of asm across several in-tree targets shows variations
that I expect are mostly neutral.

We have one improvement in an existing IR test that I noted with a
comment. Using mask ops might also make more code match with D114272.

Differential Revision: https://reviews.llvm.org/D114386
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
The file was modifiedllvm/test/Transforms/InstCombine/signed-truncation-check.ll
The file was modifiedllvm/test/Transforms/InstCombine/compare-signs.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-with-bitwise-ops.ll
The file was modifiedllvm/test/Transforms/InstCombine/getelementptr.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-icmp-and.ll
The file was modifiedllvm/test/Transforms/InstCombine/icmp-trunc.ll
The file was modifiedllvm/test/Transforms/InstCombine/and-compare.ll
Commit 04b5c00952c39e00806bc154df348f5171919788 by david.green
[ARM] Add testing for various fptosi.sat patterns. NFC
The file was addedllvm/test/CodeGen/ARM/fpclamptosat.ll
Commit 8874ada906f6a2ae0c4aa978581a0c9c26b89ffd by thakis
[clang] Fix -Wreturn-type false positive in @try statements

After 04f30795f16638, -Wreturn-type has an effect on functions that
contain @try/@catch statements. CheckFallThrough() was missing
a case for ObjCAtTryStmts, leading to a false positive.

(What about the other two places in CheckFallThrough() that handle
CXXTryStmt but not ObjCAtTryStmts?

- I think the last use of CXXTryStmt is dead in practice: 04c6851cd made it so
  that calls never add edges to try bodies, and the CFG block for a try
  statement is always an empty block containing just the try element itself as
  terminator (the try body itself is part of the normal flow of the function
  and not connected to the block for the try statement itself. The try statment
  cfg block is only connected to the catch bodies, and only reachable from
  throw expressions within the try body.)

- The first use of CXXTryStmt might be important. It looks similar to
  the code that adds all cfg blocks for try statements as roots of
  the reachability graph for the reachability warnings, but I can't
  find a way to trigger it. So I'm omitting it for now. The CXXTryStmt
  code path seems to only be hit by try statements that are function
  bodies without a surrounding compound statements
  (`f() try { ... } catch ...`), and those don't exist for ObjC
  @try statements.
)

Fixes PR52473.

Differential Revfision: https://reviews.llvm.org/D114660
The file was modifiedclang/lib/Sema/AnalysisBasedWarnings.cpp
The file was addedclang/test/SemaObjC/return-noreturn.m
Commit c73fc74ce0f85510ebedd9fe8bcad51d53f2465c by kazu
[llvm] Use range-based for loops (NFC)
The file was modifiedllvm/lib/Target/Mips/MipsConstantIslandPass.cpp
The file was modifiedllvm/lib/Target/X86/X86ExpandPseudo.cpp
The file was modifiedllvm/lib/CodeGen/MachinePipeliner.cpp
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/lib/CodeGen/RegAllocFast.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonCopyToCombine.cpp
The file was modifiedllvm/lib/CodeGen/ModuloSchedule.cpp
The file was modifiedllvm/lib/Target/ARM/ARMConstantIslandPass.cpp
The file was modifiedllvm/lib/CodeGen/StackSlotColoring.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64CondBrTuning.cpp
The file was modifiedllvm/lib/CodeGen/InlineSpiller.cpp
Commit 3495090b9bfdb1daf9c64585b4c02284dc99a180 by flo
[LV] Move code from widenGEP to VPWidenGEPRecipe (NFC).

The code in widenGEP has already been transitioned to only rely on
information provided by VPWidenGEPRecipe directly.

Moving the code directly to VPWidenGEPRecipe::execute completes
the transition for the recipe.

It provides the following advantages:

1. Less indirection, easier to see what's going on.
2. Removes accesses to fields of ILV.

2) in particular ensures that no dependencies on
fields in ILV for GEP code generation are re-introduced.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D114321
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 6c1c2313d1b7bea4e9d831fe061c37735b7d4802 by i
[ELF] Simplify assignFileOffsets. NFC
The file was modifiedlld/ELF/Writer.cpp
Commit f9a4d9aa0309ca353de909a19b648ab34f6c0c68 by i
[ELF] -z separate-*: Use max-page-size instead of common-page-size for text/non-SHF_ALLOC transition and writeTrapInstr

For -z separate-code and -z separate-loadable-segments:

When RW is present, the RX to RW transition is aligned with max-page-size.
When RW is absent, the RX to non-SHF_ALLOC transition should use max-page-size as well.
The file was modifiedlld/test/ELF/fill-trap.s
The file was modifiedlld/test/ELF/fill-trap-ppc.s
The file was modifiedlld/ELF/Writer.cpp
Commit 3608e18a946e77a474a468304b6c3904c55dbce0 by nikita.ppv
[DSE] Use MapVector for IOLs

I'm not sure whether this can cause any actual non-determinism,
but at least it makes the DSE debug log non-deterministic, which
makes it harder to debug other non-determinism issues.
The file was modifiedllvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
Commit df08b2fe8b35cb63dfb3b49738a3494b9b4e6f8e by dimitry
[AArch64] Avoid crashing on invalid -Wa,-march= values

As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles
pass -Wa,-march=all to compile a number of assembly files. Clang does
not support this -march value, but because of a mistake in handling
the arguments, an unitialized Arg pointer is dereferenced, which can
cause a segfault.

Work around this by adding a check if the local WaMArch variable is
initialized, and if so, using its value in the diagnostic message.

Reviewed By: tschuett

Differential Revision: https://reviews.llvm.org/D114677
The file was modifiedclang/test/Driver/aarch64-target-as-march.s
The file was modifiedclang/lib/Driver/ToolChains/Arch/AArch64.cpp
Commit f5a9bfdf8f4a278ba725fee50d5b5054f95e88f2 by nicolas.vasilache
[mlir] NFC - Move invalid.mlir tests to the proper dialects
The file was modifiedmlir/test/Dialect/MemRef/invalid.mlir
The file was modifiedmlir/test/Dialect/Tensor/invalid.mlir
The file was modifiedmlir/test/IR/invalid-ops.mlir
Commit cecc6893a08618fc753cd55893b720a01fbd2b51 by i
[ELF] Simplify assignFileOffsets

There is a difference with non-SHF_ALLOC SHT_NOBITS when off%sh_addralign!=0
which doesn't happen/matter in practice.
The file was modifiedlld/ELF/Writer.cpp