SuccessChanges

Summary

  1. [OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1 (details)
  2. Add test exposing a bug in SimpleLoopUnswitch. (details)
  3. [VE] Dynamic stack allocation (details)
  4. [X86] Add helper function to reduce some code duplication when shrinking a vector load to a vzext_load. (details)
  5. [NFC][Debugify] Format the CheckModuleDebugify output (details)
  6. [DebugInfo] - Fix typo in comment. NFC. (details)
  7. [StackSafety] Ignore some use of values (details)
  8. [StackSafety] Fix formatting in the test (details)
  9. [StackSafety] Bailout on some function calls (details)
  10. [GlobalISel][InlineAsm] Add missing EarlyClobber flag to inline asm output operands (details)
  11. [X86][SSE] Convert PTEST to MOVMSK for allsign bits vector results (details)
  12. VPlanValue.h - reduce unnecessary includes to forward declarations. NFC. (details)
  13. [lldb] Don't complete ObjCInterfaceDecls in ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName (details)
Commit 602d9b0afc77828f419869289b159a567c62ae81 by Saiyedul.Islam
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1

Summary:
Allow AMDGCN as a GPU offloading target for OpenMP during compiler
invocation and allow setting CUDAMode for it.

Originally authored by Greg Rodgers (@gregrodgers).

Reviewers: ronlieb, yaxunl, b-sumner, scchan, JonChesterfield, jdoerfert, sameerds, msearles, hliao, arsenm

Reviewed By: sameerds

Subscribers: sstefan1, jvesely, wdng, arsenm, guansong, dexonsmith, cfe-commits, llvm-commits, gregrodgers

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D79754
The file was addedclang/test/OpenMP/amdgcn_device_function_call.cpp
The file was modifiedllvm/include/llvm/ADT/Triple.h
The file was modifiedclang/test/Driver/openmp-offload-gpu.c
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
The file was modifiedclang/test/OpenMP/target_parallel_no_exceptions.cpp
The file was modifiedclang/lib/AST/Decl.cpp
Commit fc44da746faab5c0ad20e9de8b8fca43b7c5f408 by suc-daniil
Add test exposing a bug in SimpleLoopUnswitch.
The file was addedllvm/test/Transforms/SimpleLoopUnswitch/dead-blocks-uses-in-unreachablel-blocks.ll
Commit dedaf3a2ac59548c70a0d54da7267bbb082782c0 by simon.moll
[VE] Dynamic stack allocation

Summary:
This patch implements dynamic stack allocation for the VE target. Changes:
* compiler-rt: `__ve_grow_stack` to request stack allocation on the VE.
* VE: base pointer support, dynamic stack allocation.

Differential Revision: https://reviews.llvm.org/D79084
The file was addedllvm/test/CodeGen/VE/alloca.ll
The file was modifiedllvm/lib/Target/VE/VEISelLowering.cpp
The file was addedcompiler-rt/lib/builtins/ve/grow_stack.S
The file was modifiedllvm/lib/Target/VE/VEISelLowering.h
The file was addedcompiler-rt/lib/builtins/ve/grow_stack_align.S
The file was modifiedcompiler-rt/cmake/Modules/CompilerRTUtils.cmake
The file was modifiedllvm/lib/Target/VE/VEInstrInfo.td
The file was addedllvm/test/CodeGen/VE/alloca_aligned.ll
The file was modifiedllvm/lib/Target/VE/VEFrameLowering.h
The file was modifiedcompiler-rt/lib/builtins/CMakeLists.txt
The file was modifiedllvm/lib/Target/VE/VESubtarget.h
The file was modifiedcompiler-rt/cmake/builtin-config-ix.cmake
The file was modifiedllvm/lib/Target/VE/VEInstrInfo.h
The file was modifiedllvm/lib/Target/VE/VECallingConv.td
The file was modifiedcompiler-rt/cmake/base-config-ix.cmake
The file was modifiedllvm/lib/Target/VE/VERegisterInfo.cpp
The file was modifiedllvm/lib/Target/VE/VEFrameLowering.cpp
The file was modifiedllvm/lib/Target/VE/VEInstrInfo.cpp
Commit a1dfd6d828ac4f8e11e8013b952f0ef080890dcf by craig.topper
[X86] Add helper function to reduce some code duplication when shrinking a vector load to a vzext_load.

There's more code for calling CombineTo and replacing the nodes
that I'd like to share, but its complicated by the getNode call
in the middle that needs to be specific to each opcode.

While there are also make sure we recursively delete the load
we're replacing. It eventually gets removed by a RemoveDeadNodes
call at the end of DAG combine, but we should be more eager about
it. We were inconsistently doing this in some places but not all.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 65030821d4a6af94b84a33e66a40c08ca26f1526 by djordje.todorovic
[NFC][Debugify] Format the CheckModuleDebugify output

This fixes the output of the check-debugify option.
Without the patch an example of running the option:

$ opt -check-debugify test.ll -S -o testDebugify.ll
CheckModuleDebugifySkipping module without debugify metadata

After the patch:

$ opt -check-debugify test.ll -S -o testDebugify.ll
CheckModuleDebugify: Skipping module without debugify metadata

Differential Revision: https://reviews.llvm.org/D80553
The file was modifiedllvm/lib/Transforms/Utils/Debugify.cpp
Commit 84c643358691b8057199e8c8597428ad0d960786 by grimar
[DebugInfo] - Fix typo in comment. NFC.

I've forgot to address this bit when landed D80476.
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
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/source/Plugins/ExpressionParser/Clang/ClangExternalASTSourceCallbacks.cpp
The file was modifiedlldb/unittests/Symbol/TestTypeSystemClang.cpp
The file was modifiedlldb/test/Shell/SymbolFile/DWARF/module-ownership.mm