Changes

Summary

  1. [AMDGPU] Inline non-kernel functions using extern lds (details)
  2. [lldb] Remove SBExecutionContext::reset (NFC) (details)
  3. [LLD] Remove global state in lld/COFF (details)
  4. [RISCV] Select (srl (sext_inreg X, i32), uimm5) to SRAIW if only lower 32 bits are used. (details)
  5. [AIX][ZOS] Disable LIT tests on AIX and z/OS due to lack of Objective-C support (details)
  6. [CUDA] Pass ExecConfig through BuildCallToMemberFunction (details)
  7. [lld] Add test to check for timer output (details)
  8. [mlir][tosa] Relax ranked constraint on quantization builder (details)
  9. [fuzzer][fuchsia] Close exception channel before exiting. (details)
  10. Temporarily revert "[LLD] Remove global state in lld/COFF" and "[lld] Add test to (details)
  11. [IR] Return AAMDNodes from Instruction::getMetadata() (NFC) (details)
  12. autogen a SCEV test for ease of update (details)
  13. [MemProf] Don't instrument stack accesses unless requested (details)
  14. [OpenMP] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off build after D109635 (details)
  15. [lldb] Skip TestAppleSimulatorOSType if json parsing fails (details)
Commit 106959acc15c4b98e252af0c43406aa9342a2e05 by Vang.Thao
[AMDGPU] Inline non-kernel functions using extern lds

In https://reviews.llvm.org/D100481, forceful inline of all non-kernel
functions using lds was disabled since AMDGPULowerModuleLDS pass now handles
static lds. However that pass does not handle extern lds so non-kernel
functions using extern lds must sill be inline.

Reviewed By: hsmhsm, arsenm

Differential Revision: https://reviews.llvm.org/D109773
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/hip.extern.shared.array.ll
Commit c96d45700f6d3cb2b8d1972bb8de03522b3ff8d7 by Jonas Devlieghere
[lldb] Remove SBExecutionContext::reset (NFC)

This is a protected function that's not implemented.
The file was modifiedlldb/include/lldb/API/SBExecutionContext.h
Commit b4fa71eed34d967195514fe9b0a5211fca2bc5bc by akhuang
[LLD] Remove global state in lld/COFF

This patch removes globals from the lldCOFF library, by moving globals
into a context class (COFFLinkingContext) and passing it around wherever
it's needed.

See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html for
context about removing globals from LLD.

I also haven't moved the `driver` or `config` variables yet.

Differential Revision: https://reviews.llvm.org/D109634
The file was modifiedlld/COFF/DebugTypes.cpp
The file was modifiedlld/COFF/CallGraphSort.h
The file was modifiedlld/COFF/Chunks.h
The file was modifiedlld/COFF/MapFile.cpp
The file was modifiedlld/COFF/MarkLive.cpp
The file was modifiedlld/COFF/InputFiles.cpp
The file was modifiedlld/COFF/SymbolTable.cpp
The file was modifiedlld/COFF/LTO.cpp
The file was modifiedlld/COFF/Writer.h
The file was addedlld/COFF/COFFLinkerContext.cpp
The file was addedlld/COFF/COFFLinkerContext.h
The file was modifiedlld/COFF/Writer.cpp
The file was modifiedlld/COFF/MinGW.h
The file was modifiedlld/Common/Timer.cpp
The file was modifiedlld/COFF/SymbolTable.h
The file was modifiedlld/COFF/ICF.cpp
The file was modifiedlld/COFF/MarkLive.h
The file was modifiedlld/COFF/CallGraphSort.cpp
The file was modifiedlld/COFF/ICF.h
The file was modifiedlld/COFF/CMakeLists.txt
The file was modifiedlld/COFF/DLL.h
The file was modifiedlld/COFF/DLL.cpp
The file was modifiedlld/COFF/LLDMapFile.cpp
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedlld/COFF/Driver.h
The file was modifiedlld/COFF/LTO.h
The file was modifiedlld/COFF/MinGW.cpp
The file was modifiedlld/COFF/TypeMerger.h
The file was modifiedlld/COFF/Driver.cpp
The file was modifiedlld/COFF/PDB.h
The file was modifiedlld/COFF/InputFiles.h
The file was modifiedlld/COFF/DebugTypes.h
The file was modifiedlld/include/lld/Common/Timer.h
The file was modifiedllvm/utils/gn/secondary/lld/COFF/BUILD.gn
The file was modifiedlld/COFF/MapFile.h
The file was modifiedlld/COFF/Chunks.cpp
The file was modifiedlld/COFF/LLDMapFile.h
Commit 73e5b9ea90ba857dd7f0f6b79dc39dfc90ad66ea by craig.topper
[RISCV] Select (srl (sext_inreg X, i32), uimm5) to SRAIW if only lower 32 bits are used.

SimplifyDemandedBits can turn srl into sra if the bits being shifted
in aren't demanded. This patch can recover the original sra in some cases.

I've renamed the tablegen class for detecting W users since the "overflowing operator"
term I originally borrowed from Operator.h does not include srl.

Reviewed By: luismarques

Differential Revision: https://reviews.llvm.org/D109162
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoM.td
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
The file was modifiedllvm/test/CodeGen/RISCV/srem-lkk.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.td
The file was modifiedllvm/test/CodeGen/RISCV/rv64i-exhaustive-w-insts.ll
Commit 22f01cd4fc5d2a02a156722e1dab0398fc860e74 by Jake.Egan
[AIX][ZOS] Disable LIT tests on AIX and z/OS due to lack of Objective-C support

AIX and z/OS lack Objective-C support, so mark these tests as unsupported for AIX and z/OS.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D109060
The file was addedclang/test/CodeGenObjC/lit.local.cfg
The file was modifiedclang/test/Modules/autolink.m
The file was modifiedclang/test/PCH/externally-retained.m
The file was modifiedclang/test/Modules/module_file_info.m
The file was modifiedclang/test/PCH/pending-ids.m
The file was modifiedclang/test/Modules/objc-initializer.m
The file was addedclang/test/CodeGenObjCXX/lit.local.cfg
The file was modifiedclang/test/Modules/ModuleDebugInfoDwoId.cpp
The file was modifiedclang/test/PCH/objc_container.m
The file was modifiedclang/test/Import/objc-try-catch/test.m
The file was modifiedclang/test/Modules/pch-used.m
The file was modifiedclang/test/Import/forward-declared-objc-class/test.m
The file was modifiedclang/test/Modules/ExtDebugInfo.cpp
The file was modifiedclang/test/Modules/merge-record-definition-visibility.m
The file was modifiedclang/test/Modules/use-exportas-for-link.m
The file was modifiedclang/test/Import/objc-param-decl/test.m
The file was modifiedclang/test/Modules/merge-record-definition-nonmodular.m
The file was modifiedclang/test/Modules/ModuleModuleDebugInfo.cpp
The file was modifiedclang/test/PCH/irgen-rdar13114142.mm
The file was modifiedclang/test/Modules/cxx-irgen.cpp
The file was modifiedclang/test/Modules/merge-record-definition.m
The file was modifiedclang/test/Modules/DebugInfoTransitiveImport.m
The file was modifiedclang/test/Modules/autolinkTBD.m
The file was modifiedclang/test/Modules/DebugInfoNamespace.cpp
The file was modifiedclang/test/Import/objc-definitions-in-expression/test.m
The file was modifiedclang/test/Import/objc-autoreleasepool/test.m
The file was modifiedclang/test/Modules/ExtDebugInfo.m
The file was modifiedclang/test/PCH/objcxx-ivar-class.mm
The file was modifiedclang/test/Import/objc-method/test.m
The file was modifiedclang/test/Modules/debug-info-moduleimport.m
The file was modifiedclang/test/Modules/direct-module-import.m
The file was modifiedclang/test/Import/objc-arc/test-cleanup-object.m
The file was modifiedclang/test/PCH/objc_literals.m
The file was modifiedclang/test/PCH/objc_literals.mm
Commit 6b20ea6963561f2c91490c0993390b7f2ff8f71c by tra
[CUDA] Pass ExecConfig through BuildCallToMemberFunction

Otherwise, we fail to compile calls to CUDA kernels that are static members.

Differential Revision: https://reviews.llvm.org/D108787
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/test/SemaCUDA/kernel-call.cu
The file was modifiedclang/lib/Sema/SemaOverload.cpp
Commit e03c7e367adb8f228332e3c2ef8f45484597b719 by akhuang
[lld] Add test to check for timer output

This test checks that timers are working and printing as expected.

I also seem to have changed the order of the timers in my globals refactoring
patch, so I fixed it here.

Differential Revision: https://reviews.llvm.org/D109904
The file was modifiedlld/COFF/COFFLinkerContext.cpp
The file was modifiedlld/COFF/COFFLinkerContext.h
The file was addedlld/test/COFF/timers.ll
Commit 8662a2f2081c2a6bf51a490caa045648c88dd230 by rob.suderman
[mlir][tosa] Relax ranked constraint on quantization builder

TosaOp defintion had an artificial constraint that the input/output types
needed to be ranked to invoke the quantization builder. This is correct as an
unranked tensor could still be quantized.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D109863
The file was modifiedmlir/lib/Dialect/Tosa/IR/TosaOps.cpp
The file was modifiedmlir/lib/Dialect/Tosa/Utils/QuantUtils.cpp
Commit 5de8c7f1387dd5e2ad3b79a145baf41b21fa4952 by mvanotti
[fuzzer][fuchsia] Close exception channel before exiting.

On Fuchsia, killing or exiting a process that has a thread listening to its own process's debugger exception channel can hang. Zircon may kill all the threads, send a synthetic exceptions to debugger, and wait for the debugger to have received them. This means the thread listening to the debug exception channel may be killed even as Zircon is waiting for that thread to drain the exception channel, and the process can become stuck in a half-dead state.

This situation is "weird" as it only arises when a process is trying to debug itself. Unfortunately, this is exactly the scenario for libFuzzer on Fuchsia: FuzzerUtilFuchsia spawns a crash-handling thread that acts like a debugger in order to be able to rewrite the crashed threads stack and resume them into libFuzzer's usual POSIX signal handlers. In practice, approximately 25% of fuzzers appear to hang on exit, after generating output and artifacts. These processes hang around until the platform is torn done, which is typically a ClusterFuzz VM. Thus, real-world impact has been somewhat mitigated. The issue should still be resolved for local users, though.

This change improves the behavior of exit() in libFuzzer by adding an atexit handler which closes an event shared with the crash handling thread. This signals to the crash handler that it should close the exception channel and be joined before the process actually exits.

Reviewed By: charco

Differential Revision: https://reviews.llvm.org/D109258
The file was modifiedcompiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
Commit a2fd05ada9030eab2258fff25e77a05adccae128 by akhuang
Temporarily revert "[LLD] Remove global state in lld/COFF" and "[lld] Add test to
check for timer output"

Seems to be causing a number of asan test failures.

This reverts commit b4fa71eed34d967195514fe9b0a5211fca2bc5bc
and e03c7e367adb8f228332e3c2ef8f45484597b719.
The file was modifiedlld/COFF/MinGW.h
The file was modifiedlld/COFF/ICF.cpp
The file was modifiedlld/COFF/Chunks.h
The file was modifiedlld/COFF/CallGraphSort.h
The file was modifiedlld/COFF/DLL.cpp
The file was modifiedlld/COFF/PDB.h
The file was modifiedlld/COFF/TypeMerger.h
The file was modifiedlld/COFF/ICF.h
The file was modifiedlld/COFF/Chunks.cpp
The file was modifiedlld/COFF/DebugTypes.cpp
The file was modifiedlld/COFF/Driver.h
The file was modifiedlld/COFF/MapFile.h
The file was modifiedlld/COFF/LTO.h
The file was modifiedlld/COFF/SymbolTable.h
The file was modifiedlld/COFF/MinGW.cpp
The file was modifiedlld/COFF/Driver.cpp
The file was modifiedlld/COFF/LLDMapFile.h
The file was modifiedlld/COFF/LTO.cpp
The file was removedlld/COFF/COFFLinkerContext.h
The file was modifiedlld/COFF/Writer.h
The file was modifiedlld/COFF/InputFiles.h
The file was removedlld/COFF/COFFLinkerContext.cpp
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedlld/COFF/InputFiles.cpp
The file was removedlld/test/COFF/timers.ll
The file was modifiedlld/COFF/DebugTypes.h
The file was modifiedlld/COFF/MapFile.cpp
The file was modifiedlld/COFF/CallGraphSort.cpp
The file was modifiedlld/COFF/LLDMapFile.cpp
The file was modifiedllvm/utils/gn/secondary/lld/COFF/BUILD.gn
The file was modifiedlld/COFF/MarkLive.h
The file was modifiedlld/include/lld/Common/Timer.h
The file was modifiedlld/COFF/CMakeLists.txt
The file was modifiedlld/COFF/MarkLive.cpp
The file was modifiedlld/COFF/DLL.h
The file was modifiedlld/COFF/SymbolTable.cpp
The file was modifiedlld/COFF/Writer.cpp
The file was modifiedlld/Common/Timer.cpp
Commit 0fc624f029f568e91caf74d90abc5d8d971151c2 by nikita.ppv
[IR] Return AAMDNodes from Instruction::getMetadata() (NFC)

getMetadata() currently uses a weird API where it populates a
structure passed to it, and optionally merges into it. Instead,
we can return the AAMDNodes and provide a separate merge() API.
This makes usages more compact.

Differential Revision: https://reviews.llvm.org/D109852
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
The file was modifiedllvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
The file was modifiedllvm/lib/Transforms/Scalar/SROA.cpp
The file was modifiedllvm/lib/Transforms/Scalar/GVN.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LICM.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
The file was modifiedllvm/lib/Transforms/InstCombine/InstructionCombining.cpp
The file was modifiedpolly/lib/Analysis/ScopDetection.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
The file was modifiedllvm/include/llvm/IR/Metadata.h
The file was modifiedllvm/include/llvm/IR/Instruction.h
The file was modifiedllvm/lib/Transforms/Scalar/JumpThreading.cpp
The file was modifiedllvm/lib/Transforms/IPO/ArgumentPromotion.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/FastISel.cpp
The file was modifiedllvm/lib/Transforms/IPO/FunctionAttrs.cpp
The file was modifiedllvm/lib/Analysis/MemoryLocation.cpp
Commit f79ce5875f560528c801c404b1be1ce3e203c2e1 by listmail
autogen a SCEV test for ease of update
The file was modifiedllvm/test/Analysis/ScalarEvolution/trip-count-implied-addrec.ll
Commit 88cb3e2cb6fe80dec27d8ed3cad0f63555470910 by tejohnson
[MemProf] Don't instrument stack accesses unless requested

Skip stack accesses unless requested, as the memory profiler runtime
does not currently look at or report accesses for these addresses.

Differential Revision: https://reviews.llvm.org/D109868
The file was addedllvm/test/Instrumentation/HeapProfiler/stack.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/MemProfiler.cpp
Commit 45a8608d7ba4519ce890b74db20087ba22343c50 by i
[OpenMP] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off build after D109635
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
Commit 47dd1f642846d476e3d789f4aa941699dc0ed3fe by augusto2112
[lldb] Skip TestAppleSimulatorOSType if json parsing fails

xcodebuild, which is invoked by the apple_simulator_test decorator, may
may return a successful status even if it was unable to run due to the
authorization agent denying it. This causes the TestAppleSimulatorOSType
to run when it shouldn't, and throw an excpection when parsing the JSON
that lists the simulators available. Wrap the json parsing in a
try/except block and if it fails, skip the ttest.

Differential Revision: https://reviews.llvm.org/D109336
The file was modifiedlldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py