SuccessChanges

Summary

  1. [InstSimplify] avoid crashing by trying to rem-by-zero (details)
  2. Add missing override to Makefile (details)
  3. [NFC] Rename BBSectionsPrepare -> BasicBlockSections. (details)
  4. BPF: add a SimplifyCFG IR pass during generic Scalar/IPO optimization (details)
  5. [X86] Make getX86TargetCPU return std::string instead of const char *. Remove call to MakeArgString. NFCI (details)
  6. [X86] Optimize out a few extra strlen calls in getX86TargetCPU. NFCI (details)
  7. [LegalTypes] Move VSELECT node creation out of WidenVSELECTAndMask and push to 2 of the 3 callers. (details)
  8. Add -Wtautological-value-range-compare warning. (details)
  9. Unify the code that updates the ArchSpec after finding a fat binary (details)
  10. [NFC][InstCombine] Tests for  x s/EXACT (-1 << y)  pattern (details)
  11. [NFC][InstCombine] Better tests for  x s/EXACT (1 << y)  pattern (details)
  12. [InstCombine] Generalize  sdiv exact X, 1<<C  -->  ashr exact X, C  fold to handle non-splat vectors (details)
  13. [NFC][InstCombine] Negator: add a comment about negating exact arithmentic shift (details)
  14. [InstCombine] Fold  sdiv exact X, -1<<C  -->  -(ashr exact X, C) (details)
  15. [NFC][InstCombine] Add some more tests for negation sinking into mul (details)
  16. [InstCombine] Generalize  %x * (-1<<C)  -->  (-%x) * (1<<C)  fold (details)
  17. [InstCombine] Fold  (x + C1) * (-1<<C2)  -->  (-C1 - x) * (1<<C2) (details)
  18. [flang][msvc] Do not use gcc/clang command line options for msvc. (details)
  19. [msan] Support %ms in scanf. (details)
  20. AMDGPU/GlobalISel: Enable s_{and|or}n2_{b32|b64} patterns (details)
  21. [AMDGPU] Correct missing sram-ecc target feature for gfx906 (details)
  22. BPF: fix libLLVMBPFCodeGen.so build failure (details)
  23. [ELF] Change tombstone values to (.debug_ranges/.debug_loc) 1 and (other .debug_*) 0 (details)
  24. [NewPM][GuardWidening] Fix loop guard widening tests under NPM (details)
  25. [gn build] mac: use frameworks instead of libs where appropriate (details)
  26. GlobalISel: Implement lower for G_INSERT_VECTOR_ELT (details)
  27. Factor out common code from the iPhone/AppleTV/WatchOS simulator platform plugins. (NFC) (details)
  28. [GlobalISel] Fix computing known bits for loads with range metadata (details)
  29. PR30738: Implement two-phase name lookup for fold-expressions. (details)
  30. [VE] Optimize trunc related instructions (details)
  31. fix doc typo to cycle bots (details)
  32. [clangd] Semantic highlighting for dependent template name in template argument (details)
  33. [NewPM] Add callback for skipped passes (details)
  34. [LTO,NFC] Skip generateParamAccessSummary when empty (details)
  35. Disable clang-tidy test that started failing after clang commit ed5a18f. (details)
  36. Reinstate check that we don't crash. (details)
  37. [StackSafety] Skip ambiguous lifetime analysis (details)
  38. [polly] Unbreak buildbot. (details)
  39. [LLParser,NFC] Simplify forward GV refs update (details)
  40. [StackSafety,NFC] Use CHECK-EMPTY in tests (details)
Commit 250a167c41819aa5cedd290a29e4d3af4a9bafbe by spatel
[InstSimplify] avoid crashing by trying to rem-by-zero

Bug was noted in the post-commit comments for:
rGe8760bb9a8a3
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp (diff)
The file was modifiedllvm/test/Transforms/InstSimplify/icmp-constant.ll (diff)
Commit f406a90a08c3993cd5bfd5e6a546165e55fec9b4 by Adrian Prantl
Add missing override to Makefile
The file was modifiedlldb/test/API/macosx/macCatalystAppMacOSFramework/Makefile (diff)
The file was modifiedlldb/test/API/macosx/macCatalyst/Makefile (diff)
Commit 8d943a928d254a25caa5a6d2f92f8719c92a9694 by snehasishk
[NFC] Rename BBSectionsPrepare -> BasicBlockSections.

Rename the BBSectionsPrepare pass as suggested by the review comment in
https://reviews.llvm.org/D85368.

Differential Revision: https://reviews.llvm.org/D85380
The file was modifiedllvm/lib/CodeGen/CMakeLists.txt (diff)
The file was modifiedllvm/lib/CodeGen/TargetPassConfig.cpp (diff)
The file was removedllvm/lib/CodeGen/BBSectionsPrepare.cpp
The file was modifiedllvm/lib/CodeGen/CodeGen.cpp (diff)
The file was modifiedllvm/include/llvm/CodeGen/Passes.h (diff)
The file was modifiedllvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn (diff)
The file was addedllvm/lib/CodeGen/BasicBlockSections.cpp
The file was modifiedllvm/include/llvm/InitializePasses.h (diff)
Commit 87cba434027bf6ad370629f5b924ebd4543ddabc by yhs
BPF: add a SimplifyCFG IR pass during generic Scalar/IPO optimization

The following bpf linux kernel selftest failed with latest
llvm:
  $ ./test_progs -n 7/10
  ...
  The sequence of 8193 jumps is too complex.
  verification time 126272 usec
  stack depth 320
  processed 114799 insns (limit 1000000)
  ...
  libbpf: failed to load object 'pyperf600_nounroll.o'
  test_bpf_verif_scale:FAIL:110
  #7/10 pyperf600_nounroll.o:FAIL
  #7 bpf_verif_scale:FAIL

After some investigation, I found the following llvm patch
  https://reviews.llvm.org/D84108
is responsible. The patch disabled hoisting common instructions
in SimplifyCFG by default. Later on, the code changes and a
SimplifyCFG phase with hoisting on cannot do the work any more.

A test is provided to demonstrate the problem.
The IR before simplifyCFG looks like:
  for.cond:
    %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
    %cmp = icmp ult i32 %i.0, 6
    br i1 %cmp, label %for.body, label %for.cond.cleanup

  for.cond.cleanup:
    %2 = load i8*, i8** %frame_ptr, align 8, !tbaa !2
    %cmp2 = icmp eq i8* %2, null
    %conv = zext i1 %cmp2 to i32
    call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %1) #3
    call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull %0) #3
    ret i32 %conv

  for.body:
    %3 = load i8*, i8** %frame_ptr, align 8, !tbaa !2
    %tobool.not = icmp eq i8* %3, null
    br i1 %tobool.not, label %for.inc, label %land.lhs.true

The first two insns of `for.cond.cleanup` and `for.body`, load and
icmp, can be hoisted to `for.cond` block. With Patch D84108, the
optimization is delayed. But unfortunately, later on loop rotation
added addition phi nodes to `for.body` and hoisting cannot
be done any more.

Note such a hoisting is beneficial to bpf programs as
bpf verifier does path sensitive analysis and verification.
The hoisting preverts reloading from stack which will assume
conservative value and increase exploited insns. In this case,
it caused verifier failure.

To fix this problem, I added an IR pass from bpf target
to performance additional simplifycfg with hoisting common inst
enabled.

Differential Revision: https://reviews.llvm.org/D85434
The file was modifiedllvm/lib/Target/BPF/BPFTargetMachine.cpp (diff)
The file was modifiedllvm/lib/Target/BPF/BPFTargetMachine.h (diff)
The file was modifiedllvm/lib/Target/BPF/LLVMBuild.txt (diff)
The file was addedllvm/test/CodeGen/BPF/simplifycfg.ll
Commit e1cad4234cf3a3d0747c140e135e413ece22cf63 by craig.topper
[X86] Make getX86TargetCPU return std::string instead of const char *. Remove call to MakeArgString. NFCI

I believe this function used to be called directly from X86
specific code and was used to immediately create -target-cpu
command line. A later refactoring changed it to to be called from
a generic getCPU function that returns std::string. So on some
paths we created a string using MakeArgString converted that to
std::string then called MakeArgString again from that.

Instead just return std::string directly like the other targets.
The file was modifiedclang/lib/Driver/ToolChains/Arch/X86.h (diff)
The file was modifiedclang/lib/Driver/ToolChains/Arch/X86.cpp (diff)
Commit 4df38a5589f6fa23e161a76bdaa3180ad053791e by craig.topper
[X86] Optimize out a few extra strlen calls in getX86TargetCPU. NFCI

We had a conversion from const char * to StringRef and const char *
to std::string conversion. These both do their own
strlen call if the compiler doens't figure out how to share them.
By adding the temporary StringRef we can convert it to std::string
instead.

The other case is to use a StringSwitch<StringRef> instead of
StringSwitch<const char *> since the output values of the switch
are string literals. This allows the length to be computed at
compile time. Otherwise we have to convert from const char *
to std::string after the StringSwitch.
The file was modifiedclang/lib/Driver/ToolChains/Arch/X86.cpp (diff)
Commit ffc248f3b88cd6a0153d23660727b45dde8f27b5 by craig.topper
[LegalTypes] Move VSELECT node creation out of WidenVSELECTAndMask and push to 2 of the 3 callers.

One of the callers only wants the condition, but the vselect can
be simplified by getNode making it hard or impossible to retrieve
the condition.

Instead, return the condition and make the other 2 callers
responsible for creating the vselect node using the condition.
Rename the function to WidenVSELECTMask accordingly.

Differential Revision: https://reviews.llvm.org/D85468
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (diff)
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp (diff)
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h (diff)
The file was addedllvm/test/CodeGen/SystemZ/pr47019.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp (diff)
Commit d6492d874478b1d3b1ce3adb4c3044618bec29e9 by richard
Add -Wtautological-value-range-compare warning.

This warning diagnoses cases where an expression is compared to a
constant, and the comparison is tautological due to the form of the
expression (but not merely due to its type). This applies in cases such
as comparisons of bit-fields and the result of bit-masks.

The new warning is added to the Clang diagnostic group
-Wtautological-constant-in-range-compare but not to the
formerly-equivalent GCC-compatibility diagnostic group -Wtype-limits,
which retains its old meaning of diagnosing only tautological
comparisons to extremal values of a type (eg, int > INT_MAX).

Reviewed By: rtrieu

Differential Revision: https://reviews.llvm.org/D85256
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td (diff)
The file was modifiedclang/test/Sema/tautological-constant-compare.c (diff)
The file was modifiedclang/lib/Sema/SemaChecking.cpp (diff)
The file was modifiedclang/include/clang/Basic/DiagnosticGroups.td (diff)
Commit 0fa520af6734c5f1fab80629337e3f08fd8770db by Adrian Prantl
Unify the code that updates the ArchSpec after finding a fat binary
with how it is done for a lean binary

In particular this affects how target create --arch is handled — it
allowed us to override the deployment target (a useful feature for the
expression evaluator), but the fat binary case didn't.

rdar://problem/66024437

Differential Revision: https://reviews.llvm.org/D85049

(cherry picked from commit 470bdd3caaab0b6e0ffed4da304244be40b78668)
The file was modifiedlldb/test/API/macosx/universal/Makefile (diff)
The file was modifiedlldb/test/API/macosx/universal/TestUniversal.py (diff)
The file was modifiedlldb/source/Target/TargetList.cpp (diff)
Commit 1c21635c94df0e680cbb0797a64d09a63f619fc0 by lebedev.ri
[NFC][InstCombine] Tests for  x s/EXACT (-1 << y)  pattern
The file was addedllvm/test/Transforms/InstCombine/sdiv-exact-by-negative-power-of-two.ll
Commit 8633a0d985f1abc8f81dba5f699d5df627e6a9f1 by lebedev.ri
[NFC][InstCombine] Better tests for  x s/EXACT (1 << y)  pattern
The file was addedllvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll
Commit 442cb88f5344560e49fab681a9c909654d85fcc7 by lebedev.ri
[InstCombine] Generalize  sdiv exact X, 1<<C  -->  ashr exact X, C  fold to handle non-splat vectors
The file was modifiedllvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll (diff)
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (diff)
Commit 47aec80e4afc8e3746e09f4c9d309cf8941f68cc by lebedev.ri
[NFC][InstCombine] Negator: add a comment about negating exact arithmentic shift
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineNegator.cpp (diff)
Commit 7ce76b06ec908a85205d4dc7af6e73d5ecc26251 by lebedev.ri
[InstCombine] Fold  sdiv exact X, -1<<C  -->  -(ashr exact X, C)

While that does increases instruction count,
shift is obviously better than a division.

Name: base
Pre: (1<<C1) >= 0
%o0 = shl i8 1, C1
%r = sdiv exact i8 C0, %o0
  =>
%r = ashr exact i8 C0, C1

Name: neg
%o0 = shl i8 -1, C1
%r = sdiv exact i8 C0, %o0
  =>
%t0 = ashr exact i8 C0, C1
%r = sub i8 0, %t0

Name: reverse
Pre: C1 != 0 && C1 u< 8
%t0 = ashr exact i8 C0, C1
%r = sub i8 0, %t0
  =>
%o0 = shl i8 -1, C1
%r = sdiv exact i8 C0, %o0

https://rise4fun.com/Alive/MRplf
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (diff)
The file was modifiedllvm/test/Transforms/InstCombine/sdiv-exact-by-negative-power-of-two.ll (diff)
Commit a404acb86af7d62390a2599bb86bba2c5f840f68 by lebedev.ri
[NFC][InstCombine] Add some more tests for negation sinking into mul
The file was modifiedllvm/test/Transforms/InstCombine/mul.ll (diff)
The file was modifiedllvm/test/Transforms/InstCombine/sub-of-negatible.ll (diff)
Commit 0c1c756a31536666a7b6f5bdb744dbce923a0c9e by lebedev.ri
[InstCombine] Generalize  %x * (-1<<C)  -->  (-%x) * (1<<C)  fold

Multiplication is commutative, and either of operands can be negative,
so if the RHS is a negated power-of-two, we should try to make it
true power-of-two (which will allow us to turn it into a left-shift),
by trying to sink the negation down into LHS op.

But, we shouldn't re-invent the logic for sinking negation,
let's just use Negator for that.

Tests and original patch by: Simon Pilgrim @RKSimon!

Differential Revision: https://reviews.llvm.org/D85446
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (diff)
The file was modifiedllvm/test/Transforms/InstCombine/mul.ll (diff)
Commit be02adfad7acf8040ad025b58052b3838db7e23b by lebedev.ri
[InstCombine] Fold  (x + C1) * (-1<<C2)  -->  (-C1 - x) * (1<<C2)

Negator knows how to do this, but the one-use reasoning is getting
a bit muddy here, we don't really want to increase instruction count,
so we need to both lie that "IsNegation" and have an one-use check
on the outermost LHS value.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (diff)
The file was modifiedllvm/test/Transforms/InstCombine/mul.ll (diff)
Commit f81bae9ff42f760ed4e3d8f7314a7aee2effe6aa by llvm-project
[flang][msvc] Do not use gcc/clang command line options for msvc.

The command line options `-Wno-error` and `-Wno-unused-parameter` are specific to gcc/clang, do not use them when compiling with other compilers.

This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].

Reviewed By: isuruf

Differential Revision: https://reviews.llvm.org/D85355
The file was modifiedflang/lib/Lower/CMakeLists.txt (diff)
The file was modifiedflang/lib/Optimizer/CMakeLists.txt (diff)
Commit aa57cabae2fc5abc08ab3e17b45f2890fc7c9e42 by eugenis
[msan] Support %ms in scanf.

Differential Revision: https://reviews.llvm.org/D85350
The file was addedcompiler-rt/test/msan/scanf-allocate.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cpp (diff)
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_format.inc (diff)
Commit 87b2af814078d319dd823eb9c0a279a96ae5f349 by Matthew.Arsenault
AMDGPU/GlobalISel: Enable s_{and|or}n2_{b32|b64} patterns
The file was modifiedllvm/lib/Target/AMDGPU/SOPInstructions.td (diff)
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/andn2.ll (diff)
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/orn2.ll (diff)
Commit ce74e97d9b15514020bd7ffa1917291240b4e693 by Tony.Tye
[AMDGPU] Correct missing sram-ecc target feature for gfx906

Differential Revision: https://reviews.llvm.org/D85476
The file was modifiedllvm/docs/AMDGPUUsage.rst (diff)
Commit c50f5dece9728c377e6f77cb3874de2e406c4268 by yhs
BPF: fix libLLVMBPFCodeGen.so build failure

Buildbot reported a build failure when building shared
library libLLVMBPFCodeGen.so with unknown reference to
"createCFGSimplificationPass".

Commit 87cba434027b ("BPF: add a SimplifyCFG IR pass during
generic Scalar/IPO optimization") added an IR pass SimplifyCFG
by BPF target. The commit called function
createCFGSimplificationPass() defined in "Scalar" library.
Add this library in Target/BPF/LLVMBuild.txt so
shared library build can succeed.
The file was modifiedllvm/lib/Target/BPF/LLVMBuild.txt (diff)
Commit 004be4037e1e9c6092323c5c9268acb3ecf9176c by maskray
[ELF] Change tombstone values to (.debug_ranges/.debug_loc) 1 and (other .debug_*) 0

tl;dr See D81784 for the 'tombstone value' concept. This patch changes our behavior to be almost the same as GNU ld (except that we also use 1 for .debug_loc):

* .debug_ranges & .debug_loc: 1 (LLD<11: 0+addend; GNU ld uses 1 for .debug_ranges)
* .debug_*: 0 (LLD<11: 0+addend; GNU ld uses 0; future LLD: -1)

We make the tweaks because:

1) The new tombstone is novel and needs more time to be adopted by consumers before it's the default.
2) The old (gold) strategy had problems with zero-length functions - so rather than going back that, we're going to the GNU ld strategy which doesn't have that problem.
3) One slight tweak to (2) is to apply the .debug_ranges workaround to .debug_loc for the same reasons it applies to debug_ranges - to avoid terminating lists early.

-----

http://lists.llvm.org/pipermail/llvm-dev/2020-July/143482.html

The tombstone value -1 in .debug_line caused problems to lldb (fixed by D83957;
will be included in 11.0.0) and breakpad (fixed by
https://crrev.com/c/2321300). It may potentially affects other DWARF consumers.

For .debug_ranges & .debug_loc: 1, an argument preferring 1 (GNU ld for .debug_ranges) over -2 is that:
```
{-1, -2}    <<< base address selection entry
{0, length} <<< address range
```
may create a situation where low_pc is greater than high_pc. So we use
1, the GNU ld behavior for .debug_ranges

For other .debug_* sections, there haven't been many reports. One issue is that
bloaty (src/dwarf.cc) can incorrectly count address ranges in .debug_ranges . To
reduce similar disruption, this patch changes the tombstone values to be similar to GNU ld.

This does mean another behavior change to the default trunk behavior. Sorry
about it. The default trunk behavior will be similar to release/11.x while we work on a transition plan for LLD users.

Reviewed By: dblaikie, echristo

Differential Revision: https://reviews.llvm.org/D84825
The file was modifiedlld/test/ELF/debug-dead-reloc.s (diff)
The file was modifiedlld/ELF/InputSection.cpp (diff)
The file was modifiedlld/test/ELF/debug-dead-reloc-32.s (diff)
The file was modifiedlld/test/ELF/dead-reloc-in-nonalloc.s (diff)
The file was modifiedlld/test/ELF/debug-dead-reloc-tls.s (diff)
The file was modifiedlld/test/ELF/debug-dead-reloc-tls-arm.s (diff)
The file was modifiedlld/test/ELF/debug-dead-reloc-icf.s (diff)
Commit 039fb7f68af9f89f8116d769a9e4cae458baca38 by aeubanks
[NewPM][GuardWidening] Fix loop guard widening tests under NPM

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D85394
The file was modifiedllvm/test/Transforms/GuardWidening/basic-loop.ll (diff)
The file was modifiedllvm/test/Transforms/GuardWidening/loop-schedule.ll (diff)
Commit 92d58392975b908055e22c9f24dcf8e84cc58a1b by thakis
[gn build] mac: use frameworks instead of libs where appropriate

As of GN 3028c6a426a4, the hack that transformed "libs" ending in
".framework" from -l arguments to -framework arguments has been removed.
Instead, "frameworks" must be used, and the toolchain must provide
support.

Differential Revision: https://reviews.llvm.org/D84219
The file was modifiedllvm/utils/gn/secondary/llvm/tools/dsymutil/BUILD.gn (diff)
The file was modifiedllvm/utils/gn/build/toolchain/BUILD.gn (diff)
Commit 1ad051dd8c86d62f60e62295daa670c5cfb7d8fb by Matthew.Arsenault
GlobalISel: Implement lower for G_INSERT_VECTOR_ELT
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h (diff)
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/insertelement-stack-lower.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp (diff)
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-insert-vector-elt.mir (diff)
Commit 243903f3262d0e1727fe7d473da741c4a742a937 by Adrian Prantl
Factor out common code from the iPhone/AppleTV/WatchOS simulator platform plugins. (NFC)

The implementation of these classes was copied & pasted from the
iPhone simulator plugin with only a handful of configuration
parameters substituted. This patch moves the redundant implementations
into the base class PlatformAppleSimulator.

Differential Revision: https://reviews.llvm.org/D85243
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (diff)
The file was modifiedlldb/unittests/Platform/PlatformAppleSimulatorTest.cpp (diff)
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp (diff)
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h (diff)
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h
The file was removedlldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
The file was modifiedlldb/source/Plugins/Platform/MacOSX/CMakeLists.txt (diff)
Commit c8a282bcf7b6304e99f65bf22eea4553e240fb40 by Jessica Paquette
[GlobalISel] Fix computing known bits for loads with range metadata

In GlobalISel, if you have a load into a small type with a range, you'll hit
an assert if you try to compute known bits on it starting at a larger type.

e.g.

```
%x:_(s8) = G_LOAD %whatever(p0) :: (load 1 ... !range !n)
...
%y:_(s32) = G_SOMETHING %x
```

When we walk through G_SOMETHING and hit the load, the width of our known bits
is 32. However, the width of the range is going to be 8. This will cause us
to hit an assert.

To fix this, make computeKnownBitsFromRangeMetadata zero extend or truncate
the range type to match the bitwidth of the known bits we're calculating.

Add a testcase in CodeGen/GlobalISel/KnownBitsTest.cpp to reflect that this
works now.

https://reviews.llvm.org/D85375
The file was modifiedllvm/lib/Analysis/ValueTracking.cpp (diff)
The file was modifiedllvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp (diff)
Commit ed5a18fc0399dce994aa354a33e6f981f9828647 by richard
PR30738: Implement two-phase name lookup for fold-expressions.
The file was modifiedclang/lib/Parse/ParseExpr.cpp (diff)
The file was modifiedclang/include/clang/AST/ExprCXX.h (diff)
The file was modifiedclang/lib/AST/ASTContext.cpp (diff)
The file was modifiedclang/lib/Sema/SemaTemplate.cpp (diff)
The file was modifiedclang/lib/Sema/SemaExpr.cpp (diff)
The file was modifiedclang/lib/Serialization/ASTWriterStmt.cpp (diff)
The file was modifiedclang/lib/Sema/SemaDeclCXX.cpp (diff)
The file was modifiedclang/test/AST/ast-dump-expr.cpp (diff)
The file was modifiedclang/include/clang/Sema/Sema.h (diff)
The file was modifiedclang/lib/Sema/SemaOverload.cpp (diff)
The file was modifiedclang/lib/Sema/TreeTransform.h (diff)
The file was modifiedclang/lib/Sema/SemaTemplateVariadic.cpp (diff)
The file was modifiedclang/lib/Sema/SemaLookup.cpp (diff)
The file was modifiedclang/test/AST/ast-dump-expr-json.cpp (diff)
The file was modifiedclang/lib/Serialization/ASTReaderStmt.cpp (diff)
The file was modifiedclang/test/SemaTemplate/cxx1z-fold-expressions.cpp (diff)
Commit f92e0d9384763913a745cbe9c757fbb40691dcd1 by marukawa
[VE] Optimize trunc related instructions

Change to not generate truncate instructions if all use of a truncate
operation don't care about higher bits.  For example, an i32 add
instruction doesn't care about higher 32 bits in 64 bit registers.
Updates regression tests also.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D85418
The file was modifiedllvm/test/CodeGen/VE/selectccf64c.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/addition.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/bitcast.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/rem.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/select.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/cast.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/rotr.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/selectccf32c.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/selectcci32i.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/bswap.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/setcci32.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/branch1.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/setcci32i.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/min.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/right_shift.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/div.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/selectcci32.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/int_to_fp.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/rotl.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/left_shift.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/selectcci64c.ll (diff)
The file was modifiedllvm/lib/Target/VE/VEISelLowering.cpp (diff)
The file was modifiedllvm/test/CodeGen/VE/multiply.ll (diff)
The file was modifiedllvm/lib/Target/VE/VEISelLowering.h (diff)
The file was modifiedllvm/test/CodeGen/VE/max.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/subtraction.ll (diff)
The file was modifiedllvm/test/CodeGen/VE/selectcci32c.ll (diff)
Commit ecbf2b3496cb708ea854278e3efe16e0244bcbf2 by thakis
fix doc typo to cycle bots
The file was modifiedllvm/docs/CommandGuide/lit.rst (diff)
Commit f4ba7a100a56b63f9b3eac709ecea9f514d90c00 by zeratul976
[clangd] Semantic highlighting for dependent template name in template argument

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

Differential Revision: https://reviews.llvm.org/D85272
The file was modifiedclang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp (diff)
The file was modifiedclang-tools-extra/clangd/SemanticHighlighting.cpp (diff)
Commit 72c95b22137da97b0c573113771d7bd159fff230 by aeubanks
[NewPM] Add callback for skipped passes

Parallel to https://reviews.llvm.org/D84772.

Will use this for printing when a pass is skipped.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D85478
The file was modifiedllvm/unittests/IR/PassBuilderCallbacksTest.cpp (diff)
The file was modifiedllvm/include/llvm/IR/PassInstrumentation.h (diff)
Commit 5c6d9b2bbfafb47363b31ad06f2c21a9cc93e6ad by Vitaly Buka
[LTO,NFC] Skip generateParamAccessSummary when empty

addGlobalValueSummary can check newly added FunctionSummary
and set HasParamAccess to mark that generateParamAccessSummary
is needed.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D85182
The file was modifiedllvm/include/llvm/IR/ModuleSummaryIndex.h (diff)
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp (diff)
Commit 2f1fffab73f83e6a729cb4d68a99f930e44bc7a8 by richard
Disable clang-tidy test that started failing after clang commit ed5a18f.

This checker appears to be intentionally not diagnosing cases where an
operator appearing in a duplicated expression might have side-effects;
Clang is now modeling fold-expressions as having an unresolved operator
name within them, so they now trip up this check.
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/misc-redundant-expression.cpp (diff)
Commit b2847671b83f6acb71a78d4e37bd57967c858f4e by richard
Reinstate check that we don't crash.
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/misc-redundant-expression.cpp (diff)
Commit 0b2616a8045cb776ea1514c3401d0a8577de1060 by Vitaly Buka
[StackSafety] Skip ambiguous lifetime analysis

If we can't identify alloca used in lifetime marker we
need to assume to worst case scenario.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D84630
The file was modifiedllvm/lib/Analysis/StackLifetime.cpp (diff)
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/lifetime.ll (diff)
The file was modifiedllvm/include/llvm/Analysis/StackLifetime.h (diff)
The file was modifiedllvm/test/CodeGen/AArch64/stack-tagging.ll (diff)
Commit 1139d899d58916a0662c76e1847b3b12c5a4a5dc by llvm-project
[polly] Unbreak buildbot.

The test failed since commit
bc10888dc "DomTree: Make PostDomTree indifferent to block successors swap"
which is a re-commit of
c35585e20 "DomTree: Make PostDomTree immune to block successors swap"
The file was modifiedpolly/test/Isl/Ast/alias_checks_with_empty_context.ll (diff)
Commit faeeed6f52455c872431d7173a00e72660d11a11 by Vitaly Buka
[LLParser,NFC] Simplify forward GV refs update

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D85238
The file was modifiedllvm/lib/AsmParser/LLParser.cpp (diff)
Commit 92dcf12b2f2011b0ecc1610281209e554a5047a8 by Vitaly Buka
[StackSafety,NFC] Use CHECK-EMPTY in tests
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll (diff)
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/ipa.ll (diff)
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/memintrin.ll (diff)
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp (diff)
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/local.ll (diff)