SuccessChanges

Summary

  1. [StackSafety] Ignore some use of values (details)
  2. [StackSafety] Fix formatting in the test (details)
  3. [StackSafety] Bailout on some function calls (details)
  4. [GlobalISel][InlineAsm] Add missing EarlyClobber flag to inline asm output operands (details)
  5. [X86][SSE] Convert PTEST to MOVMSK for allsign bits vector results (details)
  6. VPlanValue.h - reduce unnecessary includes to forward declarations. NFC. (details)
  7. [lldb] Don't complete ObjCInterfaceDecls in ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName (details)
  8. [llvm-readobj] - Do not skip building of the GNU hash table histogram. (details)
  9. DOTGraphTraitsPass.h - remove unnecessary includes. NFC. (details)
  10. ArchiveWriter.h - remove unnecessary includes. NFC. (details)
  11. [llvm-readelf] - Split GNUStyle<ELFT>::printHashHistogram. NFC. (details)
  12. [SimpleLoopUnswitch] Drop uses of instructions before block deletion (details)
  13. [LAA] We only need pointer checks if there are non-zero checks (NFC). (details)
  14. Revert "[LAA] We only need pointer checks if there are non-zero checks (NFC)." (details)
  15. [LAA] We only need pointer checks if there are non-zero checks (NFC). (details)
  16. [NFC] Updating tests (details)
  17. [lldb] Fix a potential bug that may cause assert failure in CommandObject::CheckRequirements (details)
  18. [ARM] Fix rewrite of frame index in Thumb2's address mode i8s4 (details)
  19. [lldb] Tab completion for process plugin name (details)
  20. [Alignment] Fix misaligned interleaved loads (details)
  21. Update release notes with porting guide for AST Matchers (details)
  22. [CodeGen][BFloat] Add bfloat MVT type (details)
  23. ObjCARCInstKind.h - remove unused includes. NFC. (details)
  24. ObjectFile.h - reduce unnecessary includes to forward declarations. NFC. (details)
  25. [IR] add set function for FMF 'contract' (details)
  26. AMDGPU: Fix backwards s_cselect_* operands (details)
  27. [UnJ] Update LI for inner nested loops (details)
  28. [IR][BFloat] add BFloat IR intrinsics support (details)
Commit b101c6251a9bce8dc11f47bce70ee169e9fe5bfe by Vitaly Buka
[StackSafety] Ignore some use of values

We should ignore value used in MemTransferInst
as other then src/dst argument.
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/local.ll
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/memintrin.ll
Commit 06a07dd6080c72ca886cc7bb21beef2a372d94cf by Vitaly Buka
[StackSafety] Fix formatting in the test
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/memintrin.ll
Commit f6383643d9e84a139f68cbe19fa16d4969d20d5c by Vitaly Buka
[StackSafety] Bailout on some function calls

Don't miss values used in calls outside regular argument list.
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
The file was modifiedllvm/test/Analysis/StackSafetyAnalysis/local.ll
Commit f2fad3f703aa20cc7b452bdf1605cb46eb960653 by konstantin.schwarz
[GlobalISel][InlineAsm] Add missing EarlyClobber flag to inline asm output operands

Summary:
Previously, we only added early-clobber flags to the 'group' immediate flag operand
of an inline asm operand.
However, we also have to add the EarlyClobber flag to the MachineOperand itself.

This fixes PR46028

Reviewers: arsenm, leonardchan

Reviewed By: arsenm, leonardchan

Subscribers: phosek, wdng, rovka, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80467
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/irtranslator-inline-asm.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
Commit 410667f1b74c614d9382f180d29f5aa1e42cc5c9 by llvm-dev
[X86][SSE] Convert PTEST to MOVMSK for allsign bits vector results

If we are using PTEST to check 'allsign bits' vector elements we can use MOVMSK to extract the signbits directly and perform the comparison on the scalar value.

For vXi16 cases, as we don't have a MOVMSK for this type, we must mask each signbit out of a PMOVMSKB v2Xi8 result, which folds into the TEST comparison.

If this allows us to remove a vector op (via the SimplifyMultipleUseDemandedBits call) this is consistently faster than a PTEST (https://godbolt.org/z/ziJUst).

I'm investigating whether we ever get regressions without the SimplifyMultipleUseDemandedBits call, even if this means we don't remove a vector op, but that has exposed some other poor codegen issues that I'm still investigating and would have to wait for a later patch.

Suggested on PR42035 to avoid unnecessary ashr(x,bw-1)/pcmpgt(0,x) sign splat patterns feeding into ptest.

Differential Revision: https://reviews.llvm.org/D80563
The file was modifiedllvm/test/CodeGen/X86/combine-ptest.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 35963f6d8519d7384c9040d629cbb4cf6ff96de8 by llvm-dev
VPlanValue.h - reduce unnecessary includes to forward declarations. NFC.
The file was modifiedllvm/lib/Transforms/Vectorize/VPlanValue.h
Commit 019bd6485c52a62c008eacfdf0d13a26ca6b0a6f by Raphael Isemann
[lldb] Don't complete ObjCInterfaceDecls in ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName

Summary:
For ObjCInterfaceDecls, LLDB iterates over the `methods` of the interface in FindExternalVisibleDeclsByName
since commit ef423a3ba57045f80b0fcafce72121449a8b54d4 .
However, when LLDB calls `oid->methods()` in that function, Clang will pull in all declarations in the current
DeclContext from the current ExternalASTSource (which is again, `ClangExternalASTSourceCallbacks`). The
reason for that is that `methods()` is just a wrapper for `decls()` which is supposed to provide a list of *all*
(both currently loaded and external) decls in the DeclContext.

However, `ClangExternalASTSourceCallbacks::FindExternalLexicalDecls` doesn't implement support for ObjCInterfaceDecl,
so we don't actually add any declarations and just mark the ObjCInterfaceDecl as having no ExternalLexicalStorage.

As LLDB uses the ExternalLexicalStorage to see if it can complete a type with the ExternalASTSource, this causes
that LLDB thinks our class can't be completed any further by the ExternalASTSource
and will from on no longer make any CompleteType/FindExternalLexicalDecls calls to that decl. This essentially
renders those types unusable in the expression parser as they will always be considered incomplete.

This patch just changes the call to `methods` (which is just a `decls()` wrapper), to some ad-hoc `noload_methods`
call which is wrapping `noload_decls()`. `noload_decls()` won't trigger any calls to the ExternalASTSource, so
this prevents that ExternalLexicalStorage will be set to false.

The test for this is just adding a method to an ObjC interface. Before this patch, this unset the ExternalLexicalStorage
flag and put the interface into the state described above.

In a normal user session this situation was triggered by setting a breakpoint in a method of some ObjC class. This
caused LLDB to create the MethodDecl for that specific method and put it into the the ObjCInterfaceDecl.
Also `ObjCLanguageRuntime::LookupInCompleteClassCache` needs to be unable to resolve the type do
an actual definition when the breakpoint is set (I'm not sure how exactly this can happen, but we just
found no Type instance that had the `TypePayloadClang::IsCompleteObjCClass` flag set in its payload in
the situation where this happens. This however doesn't seem to be a regression as logic wasn't changed
from what I can see).

The module-ownership.mm test had to be changed as the only reason why the ObjC interface in that test had
it's ExternalLexicalStorage flag set to false was because of this unintended side effect. What actually happens
in the test is that ExternalLexicalStorage is first set to false in `DWARFASTParserClang::CompleteTypeFromDWARF`
when we try to complete the `SomeClass` interface, but is then the flag is set back to true once we add
the last ivar of `SomeClass` (see `SetMemberOwningModule` in `TypeSystemClang.cpp` which is called
when we add the ivar). I'll fix the code for that in a follow-up patch.

I think some of the code here needs some rethinking. LLDB and Clang shouldn't infer anything about the ExternalASTSource
and its ability to complete the current type form the `ExternalLexicalStorage` flag. We probably should
also actually provide any declarations when we get asked for the lexical decls of an ObjCInterfaceDecl. But both of those
changes are bigger (and most likely would cause us to eagerly complete more types), so those will be follow up patches
and this patch just brings us back to the state before commit ef423a3ba57045f80b0fcafce72121449a8b54d4 .

Fixes rdar://63584164

Reviewers: aprantl, friss, shafik

Reviewed By: aprantl, shafik

Subscribers: arphaman, abidh, JDevlieghere

Differential Revision: https://reviews.llvm.org/D80556
The file was modifiedlldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.cpp
The file was modifiedlldb/unittests/Symbol/TestTypeSystemClang.cpp
Commit fc98447af65f5a51d3b62a7e76a056d2556be59d by grimar
[llvm-readobj] - Do not skip building of the GNU hash table histogram.

When the `--elf-hash-histogram` is used, the code first tries to build
a histogram for the .hash table and then for the .gnu.hash table.

The problem is that dumper might return early when unable or do not need to
build a histogram for the .hash.

This patch reorders the code slightly to fix the issue and adds a test case.

Differential revision: https://reviews.llvm.org/D80204
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/test/tools/llvm-readobj/ELF/hash-histogram.test
Commit 8062602810fed6fe377deabe8abd563a0c5d1809 by llvm-dev
DOTGraphTraitsPass.h - remove unnecessary includes. NFC.
The file was modifiedllvm/include/llvm/Analysis/DOTGraphTraitsPass.h
Commit 1e9462a201c3a09612e7fe8d56a0be0829e99dcf by llvm-dev
ArchiveWriter.h - remove unnecessary includes. NFC.
The file was modifiedllvm/include/llvm/Object/ArchiveWriter.h
Commit d804b334ed0f1c88b90ab028541582e35ba3c172 by grimar
[llvm-readelf] - Split GNUStyle<ELFT>::printHashHistogram. NFC.

As was mentioned in review comments for D80204,
`printHashHistogram` has 2 lambdas that are probably too large
and deserves splitting into member functions.

This patch does it.

Differential revision: https://reviews.llvm.org/D80546
The file was modifiedllvm/tools/llvm-readobj/llvm-readobj.cpp
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/tools/llvm-readobj/ObjDumper.h
Commit 706b22e3e446621b20befe1094c26e4eda133bc9 by suc-daniil
[SimpleLoopUnswitch] Drop uses of instructions before block deletion

Currently if instructions defined in a block are used in unreachable
blocks and SimpleLoopUnswitch attempts deleting the block, it triggers
assertion "Uses remain when a value is destroyed!".
This patch fixes it by replacing all uses of instructions from BB with
undefs before BB deletion.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D80551
The file was modifiedllvm/test/Transforms/SimpleLoopUnswitch/dead-blocks-uses-in-unreachablel-blocks.ll
The file was modifiedllvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
Commit 259abfc7cbc11cd98c05b1eb8e4b3fb6a9664bc0 by flo
[LAA] We only need pointer checks if there are non-zero checks (NFC).

If it turns out that we can do runtime checks, but there are no
runtime-checks to generate, set RtCheck.Need to false.

This can happen if we can prove statically that the pointers passed in
to canCheckPtrAtRT do not alias. This should not change any results, but
allows us to skip some work and assert that runtime checks are
generated, if LAA indicates that runtime checks are required.

Reviewers: anemet, Ayal

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D79969
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
The file was modifiedllvm/lib/Analysis/LoopAccessAnalysis.cpp
Commit 2d0389821e0c6371823198d3a5b1f032138a40bb by flo
Revert "[LAA] We only need pointer checks if there are non-zero checks (NFC)."

This reverts commit 259abfc7cbc11cd98c05b1eb8e4b3fb6a9664bc0.

Reverting this, as I missed a case where we return without setting
RtCheck.Need.
The file was modifiedllvm/lib/Analysis/LoopAccessAnalysis.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 9b507b2127f116f29437e04a187cdca70ae9aa33 by flo
[LAA] We only need pointer checks if there are non-zero checks (NFC).

If it turns out that we can do runtime checks, but there are no
runtime-checks to generate, set RtCheck.Need to false.

This can happen if we can prove statically that the pointers passed in
to canCheckPtrAtRT do not alias. This should not change any results, but
allows us to skip some work and assert that runtime checks are
generated, if LAA indicates that runtime checks are required.

Reviewers: anemet, Ayal

Reviewed By: Ayal

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

Note: This is a recommit of 259abfc7cbc11cd98c05b1eb8e4b3fb6a9664bc0,
with some suggested renaming.
The file was modifiedllvm/lib/Analysis/LoopAccessAnalysis.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 6e1eff785892edb75948f3c0a18e01ef8fbe2619 by gchatelet
[NFC] Updating tests

Summary:
Updating IR now that alignment is explicitly set.
This is a prerequisite to D80276.

Reviewers: efriedma

Subscribers: llvm-commits, craig.topper

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80549
The file was modifiedllvm/test/Transforms/InterleavedAccess/X86/interleavedLoad.ll
The file was modifiedllvm/test/Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx.ll
The file was modifiedllvm/test/Transforms/InterleavedAccess/X86/interleavedStore.ll
Commit 18bb1f1067028fbeaf92774e640bd865c53e1ce1 by Raphael Isemann
[lldb] Fix a potential bug that may cause assert failure in CommandObject::CheckRequirements

Summary: `CommandObject::CheckRequirements` requires cleaning up `m_exe_ctx`
between commands. Function `HandleOptionCompletion` returns without cleaning up
`m_exe_ctx` could cause assert failure in later `CheckRequirements`.

Reviewers: teemperor, JDevlieghere

Reviewed By: teemperor

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D80447
The file was modifiedlldb/source/Interpreter/CommandObject.cpp
Commit c7593b0f0d28f6b7f9fa4557ce73197a49b37799 by victor.campos
[ARM] Fix rewrite of frame index in Thumb2's address mode i8s4

Summary:
In Thumb2's frame index rewriting process, the address mode i8s4, which
is used by LDRD and STRD instructions, is handled by taking the
immediate offset operand and multiplying it by 4.

This behaviour is wrong, however. In this specific address mode, the
MachineInstr's immediate operand is already in the expected form. By
consequence of that, multiplying it once more by 4 yields a flawed
offset value, four times greater than it should be.

Differential Revision: https://reviews.llvm.org/D80557
The file was modifiedllvm/lib/Target/ARM/Thumb2InstrInfo.cpp
The file was addedllvm/test/CodeGen/Thumb2/frame-index-addrmode-t2i8s4.mir
Commit 763bc2305797c980a4f4fa2f6314ed78a010678d by Raphael Isemann
[lldb] Tab completion for process plugin name

Summary:

1. Added tab completion to `process launch -p`, `process attach -P`, `process
connect -p`;

2. Bound the plugin name common completion as the default completion for
`eArgTypePlugin` arguments.

Reviewers: teemperor, JDevlieghere

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D79929
The file was modifiedlldb/source/Core/PluginManager.cpp
The file was modifiedlldb/test/API/functionalities/completion/TestCompletion.py
The file was modifiedlldb/include/lldb/Core/PluginManager.h
The file was modifiedlldb/include/lldb/Interpreter/CommandCompletions.h
The file was modifiedlldb/source/Commands/CommandObjectProcess.cpp
The file was modifiedlldb/source/Commands/CommandCompletions.cpp
The file was modifiedlldb/source/Interpreter/CommandObject.cpp
Commit 5b84ee4f61419b9a911ce75b4bc1c5cc7de1d0d6 by gchatelet
[Alignment] Fix misaligned interleaved loads

Summary: Tentatively fixing https://bugs.llvm.org/show_bug.cgi?id=45957

Reviewers: craig.topper, nlopes

Subscribers: hiraditya, llvm-commits, RKSimon, jdoerfert, efriedma

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80276
The file was modifiedllvm/lib/Target/X86/X86InterleavedAccess.cpp
The file was modifiedllvm/test/Transforms/InterleavedAccess/X86/interleavedLoad.ll
Commit 63f927b17a1ce18cb922c441ffc0691a71d550b8 by steveire
Update release notes with porting guide for AST Matchers
The file was modifiedclang/docs/ReleaseNotes.rst
Commit 0508fb45dfbc3ffde6bacc1e52177f3972a3eb99 by ties.stuij
[CodeGen][BFloat] Add bfloat MVT type

Summary:
This patch adds BFloat MVT support. It also adds fixed and scalable vector MVT
types for BFloat.

This patch is part of a series that adds support for the Bfloat16 extension of the Armv8.6-a architecture, as
detailed here:

https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a

The bfloat type, and its properties are specified in the Arm Architecture
Reference Manual:

https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile

Reviewers: aemerson, huntergr, craig.topper, fpetrogalli, sdesmalen, LukeGeeson, ostannard

Reviewed By: ostannard

Subscribers: LukeGeeson, pbarrio, dschuff, kristof.beyls, hiraditya, aheejin, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79706
The file was modifiedllvm/utils/TableGen/CodeGenTarget.cpp
The file was modifiedllvm/include/llvm/CodeGen/SelectionDAG.h
The file was modifiedllvm/include/llvm/CodeGen/ValueTypes.td
The file was modifiedllvm/lib/CodeGen/ValueTypes.cpp
The file was modifiedllvm/include/llvm/Support/MachineValueType.h
The file was modifiedllvm/include/llvm/IR/Intrinsics.td
Commit ae07fabf6a705b7eb91e801d7735bda4a319567c by llvm-dev
ObjCARCInstKind.h - remove unused includes. NFC.
The file was modifiedllvm/include/llvm/Analysis/ObjCARCInstKind.h
Commit 0865d41492a7f2e8ca8ab70cb3baa121b747e9a7 by llvm-dev
ObjectFile.h - reduce unnecessary includes to forward declarations. NFC.

Fix SubtargetFeature.h include dependency in XCOFFObjectFile.cpp
The file was modifiedllvm/include/llvm/Object/ObjectFile.h
The file was modifiedllvm/lib/Object/XCOFFObjectFile.cpp
Commit 2ee4ec6b6f6d0571288db69b824f6773717d2cf7 by spatel
[IR] add set function for FMF 'contract'

This was missed when the flag was added with D31164.
The file was modifiedllvm/include/llvm/IR/Instruction.h
The file was modifiedllvm/lib/IR/Instruction.cpp
Commit 833996cef1381115b0077ab5694e189463f5d02e by Matthew.Arsenault
AMDGPU: Fix backwards s_cselect_* operands

The vector equivalent has backwards operands, but the scalar version
does not. The passes that use these hooks aren't enabled by default,
so this doesn't really change anything.
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/early-if-convert.ll
Commit 70d4a202995315c77d7daec9f332a6ceda84efc9 by david.green
[UnJ] Update LI for inner nested loops

This makes sure to correctly register the loop info of the children
of unroll and jammed loops. It re-uses some code from the unroller for
registering subloops.

Differential Revision: https://reviews.llvm.org/D80619
The file was addedllvm/test/Transforms/LoopUnrollAndJam/innerloop.ll
The file was modifiedllvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
Commit ad5d319ee85d31ee2b1ca5c29b3a10b340513fec by ties.stuij
[IR][BFloat] add BFloat IR intrinsics support

Summary:
This patch is part of a series that adds support for the Bfloat16 extension of
the Armv8.6-a architecture, as detailed here:

https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a

The bfloat type, and its properties are specified in the Arm Architecture
Reference Manual:

https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile

Reviewers: scanon, fpetrogalli, sdesmalen, craig.topper, LukeGeeson

Reviewed By: fpetrogalli

Subscribers: LukeGeeson, pbarrio, kristof.beyls, hiraditya, jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79707
The file was modifiedllvm/include/llvm/IR/IntrinsicsAArch64.td
The file was modifiedllvm/lib/IR/Function.cpp
The file was modifiedllvm/include/llvm/IR/Intrinsics.h
The file was modifiedllvm/utils/TableGen/IntrinsicEmitter.cpp
The file was modifiedllvm/include/llvm/IR/Intrinsics.td