Changes

Summary

  1. [llvm-readelf/obj] - Move unique warning handling logic to the `ObjDumper`. (details)
  2. [compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way (details)
  3. [llvm-readelf] - Switch to using from `reportWarning` to `reportUniqueWarning` in `DynRegionInfo`. (details)
  4. collect_and_build_with_pgo.py: adapt to monorepo (details)
  5. [clang][cli] Factor out call to EXTRACTOR in generateCC1CommandLine (NFC) (details)
  6. [clang][cli] Split DefaultAnyOf into a default value and ImpliedByAnyOf (details)
  7. [clang][cli] Port Frontend option flags to new option parsing system (details)
  8. [mlir] AsyncRuntime: disable threading until test flakiness is fixed (details)
  9. [clang][cli] Port DependencyOutput option flags to new option parsing system (details)
  10. [llvm-readobj] - Introduce `ObjDumper::reportUniqueWarning(const Twine &Msg)`. (details)
  11. [GNU ObjC] Fix a regression listing methods twice. (details)
  12. [llvm-readobj][test] - Merge 2 test cases together. (details)
  13. [clang][cli] Port HeaderSearch option flags to new option parsing system (details)
  14. [obj2yaml] - Teach tool to emit the "SectionHeaderTable" key and sort sections by file offset. (details)
  15. [gn build] Manually merge 40659cd (details)
  16. [AMDGPU] Simplify some generation checks. NFC. (details)
  17. [ARM] PREDICATE_CAST demanded bits (details)
  18. [AArch64] Update pass pipeline test. NFC (details)
  19. ExtractValue instruction costs (details)
  20. [InstCombine][X86] Add test coverage showing failure to simplify addsub intrinsics to fadd/fsub (details)
  21. [VE] Add vadd and vsub intrinsic instructions (details)
  22. [ConstraintElimination] Decompose GEP %ptr, SHL(). (details)
  23. [clang] Enable code completion of designated initializers in Compound Literal Expressions (details)
  24. [NFC][CostModel]Extend class IntrinsicCostAttributes to use ElementCount Type (details)
  25. [InstCombine][X86] Fold addsub intrinsic to fadd/fsub depending on demanded elts (PR46277) (details)
  26. [LV] Clamp VF hint when unsafe (details)
  27. [OpenCL] Allow pointer-to-pointer kernel args beyond CL 1.2 (details)
  28. [DAG] Move vselect(icmp_ult, -1, add(x,y)) -> uaddsat(x,y) to DAGCombine (PR40111) (details)
  29. [NFC][SimplifyCFG] fold-branch-to-common-dest: add tests with cond of br not being the last op (details)
  30. [SimplifyCFG] FoldBranchToCommonDest: don't require that cmp of br is last instruction (details)
  31. [NFC][InstCombine] Autogenerate sext.ll test checklines (details)
  32. [NFC][InstCombine] Add PR48343 miscompiled testcase (details)
  33. [InstCombine] Evaluate new shift amount for sext(ashr(shl(trunc()))) fold in wide type (PR48343) (details)
  34. [NFC][InstCombine] Improve vector undef test coverage for sext(ashr(shl(trunc()))) fold (details)
  35. [InstCombine] Improve vector undef handling for sext(ashr(shl(trunc()))) fold (details)
  36. [NFC][InstCombine] sext.ll: @test9: avoid only differently-cased names for values and block names (details)
  37. Revert "[InstCombine] Improve vector undef handling for sext(ashr(shl(trunc()))) fold" (details)
  38. Remove rm -f cortex-a57-misched-mla.s; hopefully the bots have all cycled past it now (details)
  39. [InstCombine] add tests for sign-bit-shift-of-sub; NFC (details)
  40. [OpenMP] libomp: add UNLIKELY hints to rarely executed branches (details)
  41. [InstCombine] Improve vector undef handling for sext(ashr(shl(trunc()))) fold, 2 (details)
  42. [InstCombine] Optimize away the unnecessary multi-use sign-extend (details)
  43. [X86] Add PR48223 usubsat test case (details)
  44. [VE] Add vmul and vdiv intrinsic instructions (details)
  45. [RISCV][crt] support building without init_array (details)
  46. lld/ELF: Make three rarely-used flags work with --reproduce (details)
  47. [ConstraintElimination] Decompose GEP %ptr, ZEXT(SHL()). (details)
  48. [DAG] Move vselect(icmp_ult, 0, sub(x,y)) -> usubsat(x,y) to DAGCombine (PR40111) (details)
  49. [lldb][NFC] Modernize and cleanup TestClassTemplateParameterPack (details)
  50. [InstCombine] canonicalize sign-bit-shift of difference to ext(icmp) (details)
  51. [ARM] Mark select and selectcc of MVE vector operations as expand. (details)
Commit 31eeac915a0a25c2690b956931c77684bc34da0b by grimar
[llvm-readelf/obj] - Move unique warning handling logic to the `ObjDumper`.

This moves the `reportUniqueWarning` method to the base class.

My motivation is the following:
I've experimented with replacing `reportWarning` calls with `reportUniqueWarning`
in ELF dumper. I've found that for example for removing them from `DynRegionInfo` helper
class, it is worth to pass a dumper instance to it (to be able to call dumper()->reportUniqueWarning()).
The problem was that `ELFDumper<ELFT>` is a template class. I had to make `DynRegionInfo` to be templated
and do lots of minor changes everywhere what did not look reasonable/nice.

At the same time I guess one day other dumpers like COFF/MachO/Wasm etc might want to
start using `reportUniqueWarning` API too. Then it looks reasonable to move the logic to the
base class.

With that the problem of passing the dumper instance will be gone.

Differential revision: https://reviews.llvm.org/D92218
The file was modifiedllvm/tools/llvm-readobj/XCOFFDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/WasmDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/ObjDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/COFFDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/ObjDumper.h
The file was modifiedllvm/tools/llvm-readobj/MachODumper.cpp
Commit 2e5aaf65a344ae804343bfed6326ef33f61586b0 by martin
[compiler-rt] [emutls] Handle unused parameters in a compiler agnostic way

The MSVC specific pragmas disable this warning, but the pragmas themselves
(when not guarded by any _MSC_VER ifdef) cause warnings for other targets,
e.g. when targeting mingw.

Instead silence the MSVC warnings about unused parameters by casting
the parameters to void.

Differential Revision: https://reviews.llvm.org/D91851
The file was modifiedcompiler-rt/lib/builtins/emutls.c
Commit 87481068fddf29e913b129b9c962ba761ae478c8 by grimar
[llvm-readelf] - Switch to using from `reportWarning` to `reportUniqueWarning` in `DynRegionInfo`.

This is a part of the plan we had previously to convert all calls to
`reportUniqueWarning` and then rename it to just `reportWarning`.

I was a bit unsure about this particular change at first, because it doesn't add a
new functionality: seems it is impossible to trigger a warning duplication currently.

At the same time I find the idea of the plan mentioned very reasonable.
And with that we will be sure that `DynRegionInfo` can't report duplicate
warnings, what looks like a nice feature for possible refactorings and further tool development.

Differential revision: https://reviews.llvm.org/D92224
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit 424fdbc3dedadf882fda107aa5638b39e7036c4d by kristof.beyls
collect_and_build_with_pgo.py: adapt to monorepo

Differential Revision: https://reviews.llvm.org/D92328
The file was modifiedllvm/utils/collect_and_build_with_pgo.py
Commit 973843681b9df4ba9303e98f7b4531ba31c2b1bf by Jan Svoboda
[clang][cli] Factor out call to EXTRACTOR in generateCC1CommandLine (NFC)

Reviewed By: Bigcheese, dexonsmith

Original patch by Daniel Grumberg.

Differential Revision: https://reviews.llvm.org/D83211
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
Commit 88ab38449b49bf002ed7794d1b81d362aa9f9df2 by Jan Svoboda
[clang][cli] Split DefaultAnyOf into a default value and ImpliedByAnyOf

This makes the options API composable, allows boolean flags to imply non-boolean values and makes the code more logical (IMO).

Differential Revision: https://reviews.llvm.org/D91861
The file was modifiedllvm/unittests/Option/Opts.td
The file was modifiedllvm/include/llvm/Option/OptParser.td
The file was modifiedllvm/unittests/Option/OptionMarshallingTest.cpp
The file was modifiedclang/unittests/Frontend/CompilerInvocationTest.cpp
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedllvm/utils/TableGen/OptParserEmitter.cpp
Commit 2b84efa00040410d97aff403788ee5d96b1046e2 by Jan Svoboda
[clang][cli] Port Frontend option flags to new option parsing system

Depends on D91861.

Reviewed By: dexonsmith

Original patch by Daniel Grumberg.

Differential Revision: https://reviews.llvm.org/D83697
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/unittests/Frontend/CompilerInvocationTest.cpp
The file was modifiedllvm/include/llvm/Option/OptParser.td
The file was modifiedclang/include/clang/Driver/Options.td
Commit 9edcedf7f222ce7c893d1e3bf19b3a7a1f0f2218 by ezhulenev
[mlir] AsyncRuntime: disable threading until test flakiness is fixed

ExecutionEngine/LLJIT do not run globals destructors in loaded dynamic libraries when destroyed, and threads managed by ThreadPool can race with program termination, and it leads to segfaults.

TODO: Re-enable threading after fixing a problem with destructors, or removing static globals from dynamic library.

Differential Revision: https://reviews.llvm.org/D92368
The file was modifiedmlir/lib/ExecutionEngine/AsyncRuntime.cpp
Commit 8e41a688a5b1000b51c61b9d103545791c54af17 by Jan Svoboda
[clang][cli] Port DependencyOutput option flags to new option parsing system

Depends on D91861.

Reviewed By: dexonsmith

Original patch by Daniel Grumberg.

Differential Revision: https://reviews.llvm.org/D83694
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedllvm/include/llvm/Option/OptParser.td
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
Commit 82d9fb0ac19e6909a957d346a815d993774b2e98 by grimar
[llvm-readobj] - Introduce `ObjDumper::reportUniqueWarning(const Twine &Msg)`.

This introduces the overload for `reportUniqueWarning` which allows
to avoid using `createError` in many places.

Differential revision: https://reviews.llvm.org/D92371
The file was modifiedllvm/tools/llvm-readobj/ObjDumper.h
The file was modifiedllvm/tools/llvm-readobj/ObjDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit d1ed67037de6f3f44dc446784f74f0e02adec9b5 by David.Chisnall
[GNU ObjC] Fix a regression listing methods twice.

Methods synthesized from declared properties were being added to the
method lists twice.  This came from the change to list them in the
class's method list, which missed removing the place in CGObjCGNU that
added them again.

Reviewed By: lanza

Differential Revision: https://reviews.llvm.org/D91874
The file was addedclang/test/CodeGenObjC/gnu-method-only-once.m
The file was modifiedclang/lib/CodeGen/CGObjCGNU.cpp
Commit ade2fbbfb09c03ed665271247542774ecd540344 by grimar
[llvm-readobj][test] - Merge 2 test cases together.

This merges `invalid-attr-section-size.test` and `invalid-attr-version.test`
into `invalid-attributes-sec.test`.

This allows to have a single place where other related test cases can be added.

Differential revision: https://reviews.llvm.org/D92316
The file was removedllvm/test/tools/llvm-readobj/ELF/RISCV/invalid-attr-section-size.test
The file was removedllvm/test/tools/llvm-readobj/ELF/RISCV/invalid-attr-version.test
The file was addedllvm/test/tools/llvm-readobj/ELF/RISCV/attributes-invalid.test
Commit 398b729243b12bdfbc7a75b46d39b547545cbd2d by Jan Svoboda
[clang][cli] Port HeaderSearch option flags to new option parsing system

Depends on D83697.

Reviewed By: dexonsmith

Original patch by Daniel Grumberg.

Differential Revision: https://reviews.llvm.org/D83940
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
Commit ea8c8a50976fd5b9ca9799414bd3c412fce37f03 by grimar
[obj2yaml] - Teach tool to emit the "SectionHeaderTable" key and sort sections by file offset.

Currently when we dump sections, we dump them in the order,
which is specified in the sections header table.

With that the order in the output might not match the order in the file.
This patch starts sorting them by by file offsets when dumping.

When the order in the section header table doesn't match the order
in the file, we should emit the "SectionHeaderTable" key. This patch does it.

Differential revision: https://reviews.llvm.org/D91249
The file was modifiedllvm/test/Object/X86/obj2yaml-dup-section-name.s
The file was modifiedllvm/tools/obj2yaml/elf2yaml.cpp
The file was modifiedllvm/test/Object/obj2yaml.test
The file was modifiedllvm/test/tools/obj2yaml/ELF/offset.yaml
The file was modifiedllvm/lib/ObjectYAML/ELFYAML.cpp
Commit 52f3fac2245474b90c61e92a5c9bb4df2ae158da by hans
[gn build] Manually merge 40659cd
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/RISCV/Utils/BUILD.gn
Commit 839c9635edce4f6ed348b154a4e755ff8263d366 by jay.foad
[AMDGPU] Simplify some generation checks. NFC.
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Commit 7923d71b4a7a88f97c8a3efe1eb1473a4b2f5bf3 by david.green
[ARM] PREDICATE_CAST demanded bits

The PREDICATE_CAST node is used to model moves between MVE predicate
registers and gpr's, and eventually become a VMSR p0, rn. When moving to
a predicate only the bottom 16 bits of the sources register are
demanded. This adds a simple fold for that, allowing it to potentially
remove instructions like uxth.

Differential Revision: https://reviews.llvm.org/D92213
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-pred-bitcast.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-pred-constfold.ll
Commit 09d82fa95f4561a6a2ce80bce00209018ba70c24 by david.green
[AArch64] Update pass pipeline test. NFC
The file was modifiedllvm/test/CodeGen/AArch64/O3-pipeline.ll
Commit f44ba251354f98d771cd0a4268db94db4315945b by sjoerd.meijer
ExtractValue instruction costs

Instruction ExtractValue wasn't handled in
LoopVectorizationCostModel::getInstructionCost(). As a result, it was modeled
as a mul which is not really accurate. Since it is free (most of the times),
this now gets a cost of 0 using getInstructionCost.

This is a follow-up of D92208, that required changing this regression test.
In a follow up I will look at InsertValue which also isn't handled yet.

Differential Revision: https://reviews.llvm.org/D92317
The file was modifiedllvm/test/Transforms/LoopVectorize/AArch64/extractvalue-no-scalarization-required.ll
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 551a20bad987272fa61c821205bfdc0cd2cd0bd0 by llvm-dev
[InstCombine][X86] Add test coverage showing failure to simplify addsub intrinsics to fadd/fsub

If we only use odd/even lanes then we just need fadd/fsub ops
The file was modifiedllvm/test/Transforms/InstCombine/X86/x86-addsub.ll
Commit c3fe6ea22e963d7fa3579ecfeff5591449abf583 by marukawa
[VE] Add vadd and vsub intrinsic instructions

Add vadd and vsub intrinsic instructions and regression tests.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D92332
The file was addedllvm/test/CodeGen/VE/VELIntrinsics/vadd.ll
The file was addedllvm/test/CodeGen/VE/VELIntrinsics/vsub.ll
The file was modifiedllvm/include/llvm/IR/IntrinsicsVEVL.gen.td
The file was modifiedllvm/lib/Target/VE/VEInstrIntrinsicVL.gen.td
Commit efa9728a50012c9ead2b0110620e8865b36bef73 by flo
[ConstraintElimination] Decompose GEP %ptr, SHL().

Add support the decompose a GEP with an SHL operand.
The file was modifiedllvm/test/Transforms/ConstraintElimination/geps.ll
The file was modifiedllvm/lib/Transforms/Scalar/ConstraintElimination.cpp
Commit e98d3be11c2991c7d446d5c7c714d0384f3b7432 by kadircet
[clang] Enable code completion of designated initializers in Compound Literal Expressions

PreferedType were not set when parsing compound literals, hence
designated initializers were not available as code completion suggestions.

This patch sets the preferedtype to parsed type for the following initializer
list.

Fixes https://github.com/clangd/clangd/issues/142.

Differential Revision: https://reviews.llvm.org/D92370
The file was modifiedclang/test/CodeCompletion/desig-init.cpp
The file was modifiedclang/lib/Parse/ParseExpr.cpp
Commit 4b0ef2b075002f94e37dc2f28caf6b167052f93f by caroline.concatto
[NFC][CostModel]Extend class IntrinsicCostAttributes to use ElementCount Type

This patch replaces the attribute  `unsigned VF`  in the class
IntrinsicCostAttributes by `ElementCount VF`.
This is a non-functional change to help upcoming patches to compute the cost
model for scalable vector inside this class.

Differential Revision: https://reviews.llvm.org/D91532
The file was modifiedllvm/include/llvm/Analysis/TargetTransformInfo.h
The file was modifiedllvm/include/llvm/CodeGen/BasicTTIImpl.h
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
The file was modifiedllvm/lib/Analysis/TargetTransformInfo.cpp
Commit c63799fc52ff2473dc64cdbc343cefb8bb786b6b by llvm-dev
[InstCombine][X86] Fold addsub intrinsic to fadd/fsub depending on demanded elts (PR46277)
The file was modifiedllvm/test/Transforms/InstCombine/X86/x86-addsub.ll
The file was modifiedllvm/lib/Target/X86/X86InstCombineIntrinsic.cpp
Commit cba4accda08f90bbc96d7662ef6b1bb12a7733f2 by cullen.rhodes
[LV] Clamp VF hint when unsafe

In the following loop the dependence distance is 2 and can only be
vectorized if the vector length is no larger than this.

  void foo(int *a, int *b, int N) {
    #pragma clang loop vectorize(enable) vectorize_width(4)
    for (int i=0; i<N; ++i) {
      a[i + 2] = a[i] + b[i];
    }
  }

However, when specifying a VF of 4 via a loop hint this loop is
vectorized. According to [1][2], loop hints are ignored if the
optimization is not safe to apply.

This patch introduces a check to bail of vectorization if the user
specified VF is greater than the maximum feasible VF, unless explicitly
forced with '-force-vector-width=X'.

[1] https://llvm.org/docs/LangRef.html#llvm-loop-vectorize-and-llvm-loop-interleave
[2] https://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations

Reviewed By: sdesmalen, fhahn, Meinersbur

Differential Revision: https://reviews.llvm.org/D90687
The file was addedllvm/test/Transforms/LoopVectorize/AArch64/unsafe-vf-hint-remark.ll
The file was addedllvm/test/Transforms/LoopVectorize/unsafe-vf-hint-remark.ll
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 523775f96742e6f099b3498b6606b7250c0af841 by sven.vanhaastregt
[OpenCL] Allow pointer-to-pointer kernel args beyond CL 1.2

The restriction on pointer-to-pointer kernel arguments has been
relaxed in OpenCL 2.0.  Apply the same address space restrictions for
pointer argument types to the inner pointer types.

Differential Revision: https://reviews.llvm.org/D92091
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/test/SemaOpenCL/invalid-kernel-parameters.cl
Commit 6dbd0d36a1729e129bb11647b91bdb615d42c98c by llvm-dev
[DAG] Move vselect(icmp_ult, -1, add(x,y)) -> uaddsat(x,y) to DAGCombine (PR40111)

Move the X86 VSELECT->UADDSAT fold to DAGCombiner - there's nothing target specific about these folds.

The SSE42 test diffs are relatively benign - its avoiding an extra constant load in exchange for an extra xor operation - there are extra register moves, which is annoying as all those operations should commute them away.

Differential Revision: https://reviews.llvm.org/D91876
The file was modifiedllvm/test/CodeGen/X86/uadd_sat_vec.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
The file was modifiedllvm/test/CodeGen/X86/sat-add.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/sat-add.ll
The file was modifiedllvm/test/CodeGen/PowerPC/sat-add.ll
Commit b52029224c183d33c5a3bd9b14f3375e25f15fa5 by lebedev.ri
[NFC][SimplifyCFG] fold-branch-to-common-dest: add tests with cond of br not being the last op
The file was modifiedllvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll
Commit 15f8060f6f2388d503fcd400e1226c69554c1924 by lebedev.ri
[SimplifyCFG] FoldBranchToCommonDest: don't require that cmp of br is last instruction

There is no correctness need for that, and since we allow live-out
uses, this could theoretically happen, because currently nothing
will move the cond to right before the branch in those tests.
But regardless, lifting that restriction even makes the transform
easier to understand.

This makes the transform happen in 81 more cases (+0.55%)
)
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
The file was modifiedllvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll
Commit 0e11f3ade5eaa5ef7fe87014edd3abc708807aba by lebedev.ri
[NFC][InstCombine] Autogenerate sext.ll test checklines
The file was modifiedllvm/test/Transforms/InstCombine/sext.ll
Commit 799626b1117c4cecba7c2c67c1ed7c5f1856fb24 by lebedev.ri
[NFC][InstCombine] Add PR48343 miscompiled testcase
The file was modifiedllvm/test/Transforms/InstCombine/sext.ll
Commit 8e29e20e0d84719e1ad24f28be458db1d9c858db by lebedev.ri
[InstCombine] Evaluate new shift amount for sext(ashr(shl(trunc()))) fold in wide type (PR48343)

It is not correct to compute that new shift amount in it's narrow type
and only then extend it into the wide type:

----------------------------------------
Optimization: PR48343 good
Precondition: (width(%X) == width(%r))
  %o0 = trunc %X
  %o1 = shl %o0, %Y
  %o2 = ashr %o1, %Y
  %r = sext %o2
=>
  %n0 = sext %Y
  %n1 = sub width(%o0), %n0
  %n2 = sub width(%X), %n1
  %n3 = shl %X, %n2
  %r = ashr %n3, %n2

Done: 2016
Optimization is correct!

----------------------------------------
Optimization: PR48343 bad
Precondition: (width(%X) == width(%r))
  %o0 = trunc %X
  %o1 = shl %o0, %Y
  %o2 = ashr %o1, %Y
  %r = sext %o2
=>
  %n0 = sub width(%o0), %Y
  %n1 = sub width(%X), %n0
  %n2 = sext %n1
  %n3 = shl %X, %n2
  %r = ashr %n3, %n2

Done: 1
ERROR: Domain of definedness of Target is smaller than Source's for i9 %r

Example:
%X i9 = 0x000 (0)
%Y i4 = 0x3 (3)
%o0 i4 = 0x0 (0)
%o1 i4 = 0x0 (0)
%o2 i4 = 0x0 (0)
%n0 i4 = 0x1 (1)
%n1 i4 = 0x8 (8, -8)
%n2 i9 = 0x1F8 (504, -8)
%n3 i9 = 0x000 (0)
Source value: 0x000 (0)
Target value: undef


I.e. we should be computing it in the wide type from the beginning.

Fixes https://bugs.llvm.org/show_bug.cgi?id=48343
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sext.ll
Commit 075faa8d40b113d19c3643b3bf2cc74f146612b0 by lebedev.ri
[NFC][InstCombine] Improve vector undef test coverage for sext(ashr(shl(trunc()))) fold
The file was modifiedllvm/test/Transforms/InstCombine/sext.ll
Commit aa1aa135097ecfab6d9917a435142030eff0a226 by lebedev.ri
[InstCombine] Improve vector undef handling for sext(ashr(shl(trunc()))) fold

If the shift amount was undef for some lane, the shift amount in opposite
shift is irrelevant for that lane, and the new shift amount for that lane
can be undef.
The file was modifiedllvm/test/Transforms/InstCombine/sext.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
Commit 55c06a3070340124a726d1d030559856ed2da168 by lebedev.ri
[NFC][InstCombine] sext.ll: @test9: avoid only differently-cased names for values and block names
The file was modifiedllvm/test/Transforms/InstCombine/sext.ll
Commit 52533b52b868e055fe86061cf71a49601d0cbeb9 by lebedev.ri
Revert "[InstCombine] Improve vector undef handling for sext(ashr(shl(trunc()))) fold"

It seems i have missed checklines, temporairly reverting,
will reland momentairly..

This reverts commit aa1aa135097ecfab6d9917a435142030eff0a226.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sext.ll
Commit 2ca4785ac7001204f2c63a6f5764c4294ff4891d by hans
Remove rm -f cortex-a57-misched-mla.s; hopefully the bots have all cycled past it now
The file was modifiedllvm/test/CodeGen/ARM/cortex-a57-misched-mla.mir
Commit b2cdd776e3e5a709d5904633956d3e9eaad78020 by spatel
[InstCombine] add tests for sign-bit-shift-of-sub; NFC
The file was modifiedllvm/test/Transforms/InstCombine/lshr.ll
The file was modifiedllvm/test/Transforms/InstCombine/ashr-lshr.ll
Commit 6bf84871e9382fe7bde1117194bc15abb2b09f68 by Andrey.Churbanov
[OpenMP] libomp: add UNLIKELY hints to rarely executed branches

Added UNLIKELY hint to one-time or rarely executed branches.
This improves performance of the library on some tasking benchmarks.

Differential Revision: https://reviews.llvm.org/D92322
The file was modifiedopenmp/runtime/src/kmp_itt.inl
The file was modifiedopenmp/runtime/src/kmp_tasking.cpp
Commit 94ead0190ff18be337c5c84abccc315fd68f41fc by lebedev.ri
[InstCombine] Improve vector undef handling for sext(ashr(shl(trunc()))) fold, 2

If the shift amount was undef for some lane, the shift amount in opposite
shift is irrelevant for that lane, and the new shift amount for that lane
can be undef.
The file was modifiedllvm/test/Transforms/InstCombine/trunc.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sext.ll
Commit fd679107d670d8fd31b62245b433187b4d72a9d0 by lebedev.ri
[InstCombine] Optimize away the unnecessary multi-use sign-extend

C.f. https://bugs.llvm.org/show_bug.cgi?id=47765

Added a case for handling the sign-extend (Shl+AShr) for multiple uses,
to optimize it away for an individual use,
when the demanded bits aren't affected by sign-extend.

https://rise4fun.com/Alive/lgf

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D91343
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
The file was modifiedllvm/test/Transforms/InstCombine/and.ll
Commit 00f4269cef3773df932158728de9fe07d2f7ff41 by llvm-dev
[X86] Add PR48223 usubsat test case
The file was modifiedllvm/test/CodeGen/X86/usub_sat_vec.ll
Commit 10b164d2f72aa696e077507b4c5a3a5e11be8e6f by marukawa
[VE] Add vmul and vdiv intrinsic instructions

Add vmul and vdiv intrinsic instructions and regression tests.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D92377
The file was addedllvm/test/CodeGen/VE/VELIntrinsics/vmul.ll
The file was addedllvm/test/CodeGen/VE/VELIntrinsics/vdiv.ll
The file was modifiedllvm/include/llvm/IR/IntrinsicsVEVL.gen.td
The file was modifiedllvm/lib/Target/VE/VEInstrIntrinsicVL.gen.td
Commit 17427ec3f31c2a95c106dbaa98c43b72a7c06a31 by kupokupokupopo
[RISCV][crt] support building without init_array

Reviewed By: luismarques, phosek, kito-cheng

Differential Revision: https://reviews.llvm.org/D87997
The file was modifiedcompiler-rt/lib/crt/crtbegin.c
Commit 4431c212a0a08c2b6552e6a476a15b142d7c6bb9 by thakis
lld/ELF: Make three rarely-used flags work with --reproduce

All three use readFile() for their argument so their argument file is
already copied to the tar, but we weren't rewriting the argument to
point to the path used in the tar file.

No test because the change is trivial (several other flags in
createResponseFile() also aren't tested, likely for the same reason.)

Differential Revision: https://reviews.llvm.org/D92356
The file was modifiedlld/ELF/DriverUtils.cpp
Commit 7a4f1d59b82e5defbce4498347291e6ef9f1281c by flo
[ConstraintElimination] Decompose GEP %ptr, ZEXT(SHL()).

Add support to decompose a GEP with a ZEXT(SHL()) operand.
The file was modifiedllvm/test/Transforms/ConstraintElimination/geps.ll
The file was modifiedllvm/lib/Transforms/Scalar/ConstraintElimination.cpp
Commit 1b209ff9e3e13492fd56ae6662989ef47510db4d by llvm-dev
[DAG] Move vselect(icmp_ult, 0, sub(x,y)) -> usubsat(x,y) to DAGCombine (PR40111)

Move the X86 VSELECT->USUBSAT fold to DAGCombiner - there's nothing target specific about these folds.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
The file was modifiedllvm/test/CodeGen/X86/usub_sat_vec.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 64f04629aa7a4cf9d2deb725683959faa4a857fe by Raphael Isemann
[lldb][NFC] Modernize and cleanup TestClassTemplateParameterPack

* Un-inline the test.
* Use expect_expr everywhere and also check all involved types.
* Clang-format the test sources.
* Explain what we're actually testing with the 'C' and 'D' templates.
* Split out the non-template-parameter-pack part of the test into its own small test.
The file was addedlldb/test/API/lang/cpp/non-type-template-param/TestAlignAsBaseClass.py
The file was addedlldb/test/API/lang/cpp/class-template-parameter-pack/Makefile
The file was addedlldb/test/API/lang/cpp/non-type-template-param/Makefile
The file was modifiedlldb/test/API/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
The file was modifiedlldb/test/API/lang/cpp/class-template-parameter-pack/main.cpp
The file was addedlldb/test/API/lang/cpp/non-type-template-param/main.cpp
Commit 9f60b8b3d2e2cd38b9ae45da7e36a77b3c9dd258 by spatel
[InstCombine] canonicalize sign-bit-shift of difference to ext(icmp)

icmp is the preferred spelling in IR because icmp analysis is
expected to be better than any other analysis. This should
lead to more follow-on folding potential.

It's difficult to say exactly what we should do in codegen to
compensate. For example on AArch64, which of these is preferred:
sub w8, w0, w1
lsr w0, w8, #31

vs:
cmp w0, w1
cset w0, lt

If there are perf regressions, then we should deal with those in
codegen on a case-by-case basis.

A possible motivating example for better optimization is shown in:
https://llvm.org/PR43198 but that will require other transforms
before anything changes there.

Alive proof:
https://rise4fun.com/Alive/o4E

  Name: sign-bit splat
  Pre: C1 == (width(%x) - 1)
  %s = sub nsw %x, %y
  %r = ashr %s, C1
  =>
  %c = icmp slt %x, %y
  %r = sext %c

  Name: sign-bit LSB
  Pre: C1 == (width(%x) - 1)
  %s = sub nsw %x, %y
  %r = lshr %s, C1
  =>
  %c = icmp slt %x, %y
  %r = zext %c
The file was modifiedllvm/test/Transforms/InstCombine/sub-ashr-or-to-icmp-select.ll
The file was modifiedllvm/test/Transforms/InstCombine/sub-ashr-and-to-icmp-select.ll
The file was modifiedllvm/test/Transforms/InstCombine/ashr-lshr.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
Commit eedf0ed63e82ba2f8d2cbc12d6dae61035ed4f9a by david.green
[ARM] Mark select and selectcc of MVE vector operations as expand.

We already expand select and select_cc in codegenprepare, but they can
still be generated under some situations. Explicitly mark them as expand
to ensure they are not produced, leading to a failure to select the
nodes.

Differential Revision: https://reviews.llvm.org/D92373
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-selectcc.ll