platform/upstream/llvm.git
21 months ago[IPO] Use std::optional in Attributor.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 07:35:05 +0000 (23:35 -0800)]
[IPO] Use std::optional in Attributor.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[IPO] Use std::optional in AttributorAttributes.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 07:23:40 +0000 (23:23 -0800)]
[IPO] Use std::optional in AttributorAttributes.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Coroutines] Use std::optional in CoroFrame.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 07:18:17 +0000 (23:18 -0800)]
[Coroutines] Use std::optional in CoroFrame.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Coroutines] Use std::optional in CoroElide.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 07:15:51 +0000 (23:15 -0800)]
[Coroutines] Use std::optional in CoroElide.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[X86] Use std::optional in X86SpeculativeLoadHardening.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 07:13:23 +0000 (23:13 -0800)]
[X86] Use std::optional in X86SpeculativeLoadHardening.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[RISCV] Use std::optional in RISCVMergeBaseOffset.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 07:08:26 +0000 (23:08 -0800)]
[RISCV] Use std::optional in RISCVMergeBaseOffset.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[RISCV] Use std::optional in RISCVISelLowering.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 07:04:58 +0000 (23:04 -0800)]
[RISCV] Use std::optional in RISCVISelLowering.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[RISCV] Use std::optional in RISCVISelDAGToDAG.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 07:02:26 +0000 (23:02 -0800)]
[RISCV] Use std::optional in RISCVISelDAGToDAG.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[RISCV] Use std::optional in RISCVGatherScatterLowering.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:59:57 +0000 (22:59 -0800)]
[RISCV] Use std::optional in RISCVGatherScatterLowering.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[PowerPC] Use std::optional in PPCMacroFusion.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:57:25 +0000 (22:57 -0800)]
[PowerPC] Use std::optional in PPCMacroFusion.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[NVPTX] Use std::optional in NVPTXTargetTransformInfo.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:54:42 +0000 (22:54 -0800)]
[NVPTX] Use std::optional in NVPTXTargetTransformInfo.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AsmParser] Use std::optional in LanaiAsmParser.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:52:18 +0000 (22:52 -0800)]
[AsmParser] Use std::optional in LanaiAsmParser.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Hexagon] Use std::optional in HexagonFrameLowering.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:49:13 +0000 (22:49 -0800)]
[Hexagon] Use std::optional in HexagonFrameLowering.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[ARM] Use std::optional in ARMISelDAGToDAG.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:45:26 +0000 (22:45 -0800)]
[ARM] Use std::optional in ARMISelDAGToDAG.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Utils] Use std::optional in AMDGPUBaseInfo.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:43:00 +0000 (22:43 -0800)]
[Utils] Use std::optional in AMDGPUBaseInfo.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AMDGPU] Use std::optional in SIPeepholeSDWA.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:40:00 +0000 (22:40 -0800)]
[AMDGPU] Use std::optional in SIPeepholeSDWA.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AsmParser] Use std::optional in AMDGPUAsmParser.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:36:37 +0000 (22:36 -0800)]
[AsmParser] Use std::optional in AMDGPUAsmParser.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AMDGPU] Use std::optional in AMDGPUReleaseVGPRs.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:30:26 +0000 (22:30 -0800)]
[AMDGPU] Use std::optional in AMDGPUReleaseVGPRs.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AMDGPU] Use std::optional in AMDGPUInstructionSelector.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:23:09 +0000 (22:23 -0800)]
[AMDGPU] Use std::optional in AMDGPUInstructionSelector.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[GISel] Use std::optional in AArch64PostLegalizerLowering.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:20:07 +0000 (22:20 -0800)]
[GISel] Use std::optional in AArch64PostLegalizerLowering.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[GISel] Use std::optional in AArch64InstructionSelector.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:17:26 +0000 (22:17 -0800)]
[GISel] Use std::optional in AArch64InstructionSelector.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AsmParser] Use std::optional in AArch64AsmParser.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:14:44 +0000 (22:14 -0800)]
[AsmParser] Use std::optional in AArch64AsmParser.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AArch64] Use std::optional in AArch64LowerHomogeneousPrologEpilog.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:11:32 +0000 (22:11 -0800)]
[AArch64] Use std::optional in AArch64LowerHomogeneousPrologEpilog.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AArch64] Use std::optional in AArch64LoadStoreOptimizer.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:08:30 +0000 (22:08 -0800)]
[AArch64] Use std::optional in AArch64LoadStoreOptimizer.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AArch64] Use std::optional in AArch64ISelLowering.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 06:06:01 +0000 (22:06 -0800)]
[AArch64] Use std::optional in AArch64ISelLowering.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AArch64] Use std::optional in AArch64FrameLowering.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:57:21 +0000 (21:57 -0800)]
[AArch64] Use std::optional in AArch64FrameLowering.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Support] Use std::optional in VirtualFileSystem.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:53:00 +0000 (21:53 -0800)]
[Support] Use std::optional in VirtualFileSystem.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Support] Use std::optional in RISCVISAInfo.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:48:18 +0000 (21:48 -0800)]
[Support] Use std::optional in RISCVISAInfo.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Support] Use std::optional in JSON.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:45:47 +0000 (21:45 -0800)]
[Support] Use std::optional in JSON.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Support] Use std::optional in FormatVariadic.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:25:27 +0000 (21:25 -0800)]
[Support] Use std::optional in FormatVariadic.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Support] Use std::optional in ARMAttributeParser.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:22:19 +0000 (21:22 -0800)]
[Support] Use std::optional in ARMAttributeParser.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Remarks] Use std::optional in YAMLRemarkSerializer.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:18:04 +0000 (21:18 -0800)]
[Remarks] Use std::optional in YAMLRemarkSerializer.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Remarks] Use std::optional in YAMLRemarkParser.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:15:34 +0000 (21:15 -0800)]
[Remarks] Use std::optional in YAMLRemarkParser.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Remarks] Use std::optional in RemarkParser.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 05:13:15 +0000 (21:13 -0800)]
[Remarks] Use std::optional in RemarkParser.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[ProfileData] Use std::optional in GCOV.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 04:35:43 +0000 (20:35 -0800)]
[ProfileData] Use std::optional in GCOV.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Coverage] Use std::optional in CoverageMapping.cpp (NFC)
Kazu Hirata [Sat, 26 Nov 2022 04:33:10 +0000 (20:33 -0800)]
[Coverage] Use std::optional in CoverageMapping.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[mlir][vector] Add fold pattern for InsertOp(Constant into Constant)
Jakub Kuderski [Sat, 26 Nov 2022 04:00:48 +0000 (23:00 -0500)]
[mlir][vector] Add fold pattern for InsertOp(Constant into Constant)

This pattern comes with vector size threshold to make sure we do not
introduce too many large constants.

This help clean up code created by the Wide Integer Emulation pass.

Reviewed By: dcaballe

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

21 months ago[StaticAnalyzer] Don't use Optional::create (NFC)
Kazu Hirata [Fri, 25 Nov 2022 23:38:53 +0000 (15:38 -0800)]
[StaticAnalyzer] Don't use Optional::create (NFC)

Note that std::optional does not offer create().

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months agoAdd version to all LLVM cmake package
Thomas Preud'homme [Thu, 17 Nov 2022 23:35:18 +0000 (23:35 +0000)]
Add version to all LLVM cmake package

Add a version to non-LLVM cmake package so that users needing an exact
version match can use the version parameter to find_package. Also adjust
the find_package(LLVM) to use an exact version match as well.

Reviewed By: arsenm, stellaraccident, mceier

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

21 months ago[mlir][spirv] Enable WebGPU to use UnifyAliasedResourcePass
Lei Zhang [Fri, 25 Nov 2022 21:53:37 +0000 (21:53 +0000)]
[mlir][spirv] Enable WebGPU to use UnifyAliasedResourcePass

When targeting WebGPU, we also need to transcompile SPIR-V, into
WGSL this time. We have similar limitations there like when
targeting Metal or MoltenVK.

Reviewed By: kuhar

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

21 months ago[mlir][spirv] Add a field for client API in target environment
Lei Zhang [Fri, 25 Nov 2022 21:31:12 +0000 (21:31 +0000)]
[mlir][spirv] Add a field for client API in target environment

SPIR-V can be directly consumed by APIs like Vulkan and OpenCL,
where we can use the capability list to diffferentiate. It can
also be used as a compilation target to transcompile to shading
languages like WGSL to target WebGPU. We have no way to tell
that with just the capability list, so we cannot perform certain
transformations only applicable to those targets thus far. So
this commit add a field in the target environment to indicate
the client API for such purposes.

Reviewed By: kuhar

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

21 months ago[Passes] Use std::optional in PassBuilder.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:47:46 +0000 (12:47 -0800)]
[Passes] Use std::optional in PassBuilder.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Object] Use std::optional in ELFObjectFile.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:44:51 +0000 (12:44 -0800)]
[Object] Use std::optional in ELFObjectFile.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AIX][LTO] Teaching lto-aix-system-assembler Relative Path and Tilde Resolution
Qiongsi Wu [Fri, 25 Nov 2022 20:33:33 +0000 (15:33 -0500)]
[AIX][LTO] Teaching lto-aix-system-assembler Relative Path and Tilde Resolution

The `lto-aix-system-assembler` currently only understands absolute path. This patch teaches the option so that it can resolve relative paths and tilde.

Reviewed By: w2yehia

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

21 months ago[ObjectYAML] Use std::optional in MinidumpEmitter.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:34:10 +0000 (12:34 -0800)]
[ObjectYAML] Use std::optional in MinidumpEmitter.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months agoRevert "[LLDB] Recognize `std::noop_coroutine()` in `std::coroutine_handle` pretty...
Jason Molenda [Fri, 25 Nov 2022 20:28:28 +0000 (12:28 -0800)]
Revert "[LLDB] Recognize `std::noop_coroutine()` in `std::coroutine_handle` pretty printer"

This reverts commit 4346318f5c700f4e85f866610fb8328fc429319b.

This test case is failing on macOS, reverting until it can be
looked at more closely to unblock the macOS CI bots.

```
  File "/Volumes/work/llvm/llvm-project/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py", line 121, in test_libcpp
    self.do_test(USE_LIBCPP)
  File "/Volumes/work/llvm/llvm-project/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/coroutine_handle/TestCoroutineHandle.py", line 45, in do_test
    self.expect_expr("noop_hdl",
  File "/Volumes/work/llvm/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2441, in expect_expr
    value_check.check_value(self, eval_result, str(eval_result))
  File "/Volumes/work/llvm/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 306, in check_value
    test_base.assertEqual(self.expect_summary, val.GetSummary(),
AssertionError: 'noop_coroutine' != 'coro frame = 0x100004058'
- noop_coroutine+ coro frame = 0x100004058 : (std::coroutine_handle<void>) $1 = coro frame = 0x100004058 {
  resume = 0x0000000100003344 (a.out`___lldb_unnamed_symbol223)
  destroy = 0x0000000100003344 (a.out`___lldb_unnamed_symbol223)
}
Checking SBValue: (std::coroutine_handle<void>) $1 = coro frame = 0x100004058 {
  resume = 0x0000000100003344 (a.out`___lldb_unnamed_symbol223)
  destroy = 0x0000000100003344 (a.out`___lldb_unnamed_symbol223)
}
```

Those lldb_unnamed_symbols are synthetic names that ObjectFileMachO
adds to the symbol table, most often seen with stripped binaries,
based off of the function start addresses for all the functions -
if a function has no symbol name, lldb adds one of these names.
This change was originally landed via https://reviews.llvm.org/D132624

21 months ago[ObjectYAML] Use std::optional in CodeViewYAMLSymbols.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:31:45 +0000 (12:31 -0800)]
[ObjectYAML] Use std::optional in CodeViewYAMLSymbols.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[MC] Use std::optional in MCSchedule.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:28:42 +0000 (12:28 -0800)]
[MC] Use std::optional in MCSchedule.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[MCParser] Use std::optional in WasmAsmParser.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:26:10 +0000 (12:26 -0800)]
[MCParser] Use std::optional in WasmAsmParser.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[flang] Update fir.dispatch op lowering for tbp with character result
Valentin Clement [Fri, 25 Nov 2022 20:23:50 +0000 (21:23 +0100)]
[flang] Update fir.dispatch op lowering for tbp with character result

Take into account the result passed as arguments when computing
the pass object index.

Reviewed By: jeanPerier

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

21 months agoRevert "[LLDB] Do not dereference promise pointer in `coroutine_handle` pretty printer"
Jason Molenda [Fri, 25 Nov 2022 20:15:47 +0000 (12:15 -0800)]
Revert "[LLDB] Do not dereference promise pointer in `coroutine_handle` pretty printer"

This reverts commit cd3091a88f7c55c90d9b5fff372ce1cdfc71948d.

This change crashes on macOS systems in
formatters::StdlibCoroutineHandleSyntheticFrontEnd when
it fails to create the `ValueObjectSP promise` and calls
a method on it.  The failure causes a segfault while running
TestCoroutineHandle.py on the "LLDB Incremental" CI bot,
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/

This change originally landed via https://reviews.llvm.org/D132815

21 months ago[MCParser] Use std::optional in MasmParser.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:20:51 +0000 (12:20 -0800)]
[MCParser] Use std::optional in MasmParser.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Linker] Use std::optional in IRMover.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:18:23 +0000 (12:18 -0800)]
[Linker] Use std::optional in IRMover.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[InterfaceStub] Use std::optional in ELFObjHandler.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:14:22 +0000 (12:14 -0800)]
[InterfaceStub] Use std::optional in ELFObjHandler.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months agoRevert "[lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE"
Jason Molenda [Fri, 25 Nov 2022 20:11:37 +0000 (12:11 -0800)]
Revert "[lldb][NFC] Change FindDefinitionTypeForDWARFDeclContext() to take DWARFDIE"

The changes in https://reviews.llvm.org/D138612 cause a testsuite
failure on Darwin systems in TestCPPAccelerator.py, first flagged
by the "LLDB Incremental" CI bot.
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/
with the specific failure text appended to the phabracator.

This reverts commit c3c423b6cb2e1c00483e951ce8cc4d935e31cd14.

21 months ago[IR] Use std::optional in Verifier.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:11:44 +0000 (12:11 -0800)]
[IR] Use std::optional in Verifier.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[IR] Use std::optional in PassManager.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:08:56 +0000 (12:08 -0800)]
[IR] Use std::optional in PassManager.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[IR] Use std::optional in Module.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:06:20 +0000 (12:06 -0800)]
[IR] Use std::optional in Module.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[IR] Use std::optional in IntrinsicInst.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:03:40 +0000 (12:03 -0800)]
[IR] Use std::optional in IntrinsicInst.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[IR] Use std::optional in AsmWriter.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 20:01:12 +0000 (12:01 -0800)]
[IR] Use std::optional in AsmWriter.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Symbolize] Use std::optional in MarkupFilter.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:58:33 +0000 (11:58 -0800)]
[Symbolize] Use std::optional in MarkupFilter.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Native] Use std::optional in NativeTypeEnum.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:55:58 +0000 (11:55 -0800)]
[Native] Use std::optional in NativeTypeEnum.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[GSYM] Use std::optional in FunctionInfo.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:52:53 +0000 (11:52 -0800)]
[GSYM] Use std::optional in FunctionInfo.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[GSYM] Use std::optional in DwarfTransformer.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:49:32 +0000 (11:49 -0800)]
[GSYM] Use std::optional in DwarfTransformer.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[mlir][vector] Update stale comment. NFC.
Jakub Kuderski [Fri, 25 Nov 2022 19:48:23 +0000 (14:48 -0500)]
[mlir][vector] Update stale comment. NFC.

21 months ago[openmp] Support building for armv7 Windows with mingw tools
Martin Storsjö [Thu, 10 Nov 2022 13:02:05 +0000 (15:02 +0200)]
[openmp] Support building for armv7 Windows with mingw tools

This does things in the same way as
D137168 / a356782426f5bf54a00570e1f925345e5fda7b2e and
D101173 / 4fb0aaf03381473ec8af727edb4b5d59b64b0d60 did for aarch64.

This adds a C implementation of __kmp_invoke_microtask in the same
way as the fallback C implementation in z_Linux_util.cpp.

Both the existing C fallback used on arm linux, and this one added here,
fail test/misc_bugs/many-microtask-args.c similarly (which could be
considered as an XFAIL).

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

21 months ago[openmp] Fix build break for less common architectures
Martin Storsjö [Fri, 25 Nov 2022 12:17:24 +0000 (14:17 +0200)]
[openmp] Fix build break for less common architectures

fb947c358661b3bd3d5e1fa776ec74cc0f308854 introduced the gas
macro COMMON, but it was only defined within ifdefs of the form:

    #if (KMP_OS_LINUX || KMP_OS_DARWIN || KMP_OS_WINDOWS) && KMP_ARCH_AARCH64

It was used, however, within other conditions:

    #if KMP_ARCH_ARM || KMP_ARCH_MIPS

and:

    #if KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64 || KMP_ARCH_RISCV64 || KMP_ARCH_LOONGARCH64

Move the definition of the COMMON macro out from the current ifdef,
so that it always gets defined (as it's only dependent on the target
platform).

This fixes building on ARM (and presumably all the other mentioned
architectures except aarch64).

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

21 months ago[DWARF] Use std::optional in DWARFFormValue.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:45:47 +0000 (11:45 -0800)]
[DWARF] Use std::optional in DWARFFormValue.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[mlir][vector] Update fold pattern name. NFC.
Jakub Kuderski [Fri, 25 Nov 2022 19:43:13 +0000 (14:43 -0500)]
[mlir][vector] Update fold pattern name. NFC.

21 months ago[DWARF] Use std::optional in DWARFDebugFrame.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:41:44 +0000 (11:41 -0800)]
[DWARF] Use std::optional in DWARFDebugFrame.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[CodeView] Use std::optional in TypeStreamMerger.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:37:32 +0000 (11:37 -0800)]
[CodeView] Use std::optional in TypeStreamMerger.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Reader] Use std::optional in BitcodeReader.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:33:19 +0000 (11:33 -0800)]
[Reader] Use std::optional in BitcodeReader.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Analysis] Use std::optional in ValueTracking.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:30:34 +0000 (11:30 -0800)]
[Analysis] Use std::optional in ValueTracking.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Analysis] Use std::optional in ScalarEvolution.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 19:25:45 +0000 (11:25 -0800)]
[Analysis] Use std::optional in ScalarEvolution.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[AArch64] Assembly support for FEAT_LRCPC3
Tomas Matheson [Tue, 8 Mar 2022 16:46:50 +0000 (16:46 +0000)]
[AArch64] Assembly support for FEAT_LRCPC3

This patch implements assembly support for the 2022 A-Profile Architecture
extension FEAT_LRCPC3. FEAT_LRCPC3 is AArch64 only and introduces new
variants of load/store instructions with release consistency ordering.

Specs for individual instructions can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/

This feature is optionally available from v8.2a and therefore not enabled by
default.

Contributors:
  Lucas Prates
  Sam Elliot
  Son Tuan Vu
  Tomas Matheson

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

21 months ago[mlir][vector] Add fold for ExtractStridedSlice(non-splat ConstantOp)
Jakub Kuderski [Fri, 25 Nov 2022 18:41:24 +0000 (13:41 -0500)]
[mlir][vector] Add fold for ExtractStridedSlice(non-splat ConstantOp)

This allows us to better canonicalize/clean-up code created by the Wide
Integer Emulation pass.

Reviewed By: antiagainst

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

21 months ago[mlir][vector] Constant fold sub-vector extraction
Jakub Kuderski [Fri, 25 Nov 2022 18:39:35 +0000 (13:39 -0500)]
[mlir][vector] Constant fold sub-vector extraction

This generalizes the existing fold for `ExtractOp(non-splat constant)`
to work with vector results. The vector case is handled by extracting
the subrange of attribute array.

My main use it to clean up code generated by the Wide Integer Emulation
pass.

Reviewed By: antiagainst

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

21 months ago[Analysis] Use std::optional in MemoryLocation.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 18:32:21 +0000 (10:32 -0800)]
[Analysis] Use std::optional in MemoryLocation.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Analysis] Use std::optional in LoopAnalysisManager.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 18:28:54 +0000 (10:28 -0800)]
[Analysis] Use std::optional in LoopAnalysisManager.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Analysis] Use std::optional in LazyValueInfo.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 18:25:36 +0000 (10:25 -0800)]
[Analysis] Use std::optional in LazyValueInfo.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Analysis] Use std::optional in InlineCost.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 18:22:33 +0000 (10:22 -0800)]
[Analysis] Use std::optional in InlineCost.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Analysis] Use std::optional in CGSCCPassManager.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 18:18:53 +0000 (10:18 -0800)]
[Analysis] Use std::optional in CGSCCPassManager.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Analysis] Use std::optional in CFLAndersAliasAnalysis.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 18:16:32 +0000 (10:16 -0800)]
[Analysis] Use std::optional in CFLAndersAliasAnalysis.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[Analysis] Use std::optional in BasicAliasAnalysis.cpp (NFC)
Kazu Hirata [Fri, 25 Nov 2022 18:11:42 +0000 (10:11 -0800)]
[Analysis] Use std::optional in BasicAliasAnalysis.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[include-cleaner] Fix a warning
Kazu Hirata [Fri, 25 Nov 2022 17:51:25 +0000 (09:51 -0800)]
[include-cleaner] Fix a warning

This patch fixes:

  clang-tools-extra/include-cleaner/lib/HTMLReport.cpp:240:51: error:
  missing field 'Locations' initializer
  [-Werror,-Wmissing-field-initializers]

21 months ago[RISCV] Add ADD to getRegAllocationHints to improve to improve use of c.add.
Craig Topper [Fri, 25 Nov 2022 16:57:34 +0000 (08:57 -0800)]
[RISCV] Add ADD to getRegAllocationHints to improve to improve use of c.add.

add can always be compressed to c.add if one of the sources is the
same as the destination.

The same is not true for c.addw where the registers need to be x8-x15.

21 months ago[libc++][NFC] Add missing include to ext/__hash
Louis Dionne [Fri, 25 Nov 2022 15:25:57 +0000 (10:25 -0500)]
[libc++][NFC] Add missing include to ext/__hash

Note that we use <stddef.h> instead of <cstddef> because we're
using size_t (not std::size_t) and we're outside of namespace std.

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

21 months ago[RISCV] Use register allocation hints to improve use of compressed instructions.
Craig Topper [Fri, 25 Nov 2022 16:39:44 +0000 (08:39 -0800)]
[RISCV] Use register allocation hints to improve use of compressed instructions.

Compressed instructions usually require one of the source registers
to also be the source register. The register allocator doesn't have
that bias on its own.

This patch adds register allocation hints to introduce this bias.
I've started with ADDI, ADDIW, and SLLI. These all have a 5-bit
field for the register. If the source and dest register are the
same they are guaranteed to compress as long as the immediate is
also 6 bits.

This code was inspired by similar code from the SystemZ target.

Reviewed By: reames

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

21 months ago[mlir][Vector] Add a LowerVectorsOp to VectorTransformOps
Nicolas Vasilache [Fri, 25 Nov 2022 16:13:08 +0000 (08:13 -0800)]
[mlir][Vector] Add a LowerVectorsOp to VectorTransformOps

This op significantly improves transfor dialect usage when using vector abstractions.
It also brings us closer to writing simple end-to-end unit tests that guard against subtle regressions in how patterns combine.

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

21 months ago[X86] lowerShuffleAsDecomposedShuffleMerge - try to match unpck(permute(x),permute...
Simon Pilgrim [Fri, 25 Nov 2022 16:24:56 +0000 (16:24 +0000)]
[X86] lowerShuffleAsDecomposedShuffleMerge - try to match unpck(permute(x),permute(y)) for v4i32/v2i64 shuffles

We're using lowerShuffleAsPermuteAndUnpack, which can probably be improved to handle 256/512-bit types pretty easily.

First step towards trying to address the poor vector-shuffle-sse4a.ll pre-SSSE3 codegen mentioned on D127115

21 months ago[X86] oddshuffles.ll - update check-prefixes
Simon Pilgrim [Fri, 25 Nov 2022 16:13:14 +0000 (16:13 +0000)]
[X86] oddshuffles.ll - update check-prefixes

Share AVX common prefix with XOP as well as AVX1/AVX2

21 months agoRevert "[clang][modules] NFCI: Pragma diagnostic mappings: write/read FileID instead...
Alexander Kornienko [Fri, 25 Nov 2022 15:33:47 +0000 (16:33 +0100)]
Revert "[clang][modules] NFCI: Pragma diagnostic mappings: write/read FileID instead of SourceLocation"

This reverts commit f61c135a69084e470b73c26a8134785808ee246f. The commit affects
some build setups. See https://reviews.llvm.org/D137213#3939959.

21 months ago[libc++][NFC] Remove unused includes from poll_with_backoff.h
Louis Dionne [Thu, 24 Nov 2022 21:20:11 +0000 (16:20 -0500)]
[libc++][NFC] Remove unused includes from poll_with_backoff.h

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

21 months ago[LV] Use separate index to access StoredValues in vectorizeInterleave.
Florian Hahn [Fri, 25 Nov 2022 15:28:04 +0000 (15:28 +0000)]
[LV] Use separate index to access StoredValues in vectorizeInterleave.

StoredValues only has entries for members of the interleave group. If
there are gaps, then using the index i here will either access a wrong
entry or be out-of-bounds.

Instead use a dedicated index that only gets incremented for members of
the interleave group.

Fixes #59090.

21 months ago[libc++][NFC] Consistently use newline between license and include guard
Louis Dionne [Fri, 25 Nov 2022 15:25:10 +0000 (10:25 -0500)]
[libc++][NFC] Consistently use newline between license and include guard

21 months ago[AMDGPU][MC] Refactor MC Code Emitter to avoid using magic values
Dmitry Preobrazhensky [Fri, 25 Nov 2022 14:37:24 +0000 (17:37 +0300)]
[AMDGPU][MC] Refactor MC Code Emitter to avoid using magic values

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

21 months ago[X86] Move lowerShuffleAsPermuteAndUnpack earlier in the source next to similar helpe...
Simon Pilgrim [Fri, 25 Nov 2022 14:56:34 +0000 (14:56 +0000)]
[X86] Move lowerShuffleAsPermuteAndUnpack earlier in the source next to similar helpers. NFC.

I'm currently investigating using this inside lowerShuffleAsDecomposedShuffleMerge

21 months ago[libc++] Bump AppleClang compiler requirement
Louis Dionne [Thu, 24 Nov 2022 20:18:26 +0000 (15:18 -0500)]
[libc++] Bump AppleClang compiler requirement

Per our policy, the latest released AppleClang has been 14 for a while,
so libc++ is removing support for AppleClang 13. Our CI bots have been
moved to AppleClang 14 a few weeks ago.

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

21 months ago[clang-tidy] Ignore cxxRewrittenBinaryOperator in defaulted function decls in moderni...
Jens Massberg [Fri, 25 Nov 2022 14:29:57 +0000 (15:29 +0100)]
[clang-tidy] Ignore cxxRewrittenBinaryOperator in defaulted function decls in modernize-use-nullptr

The check has produced false positives when checking the default implementation of the spaceship operator.
The default implementation should be skipped by the check.

Modified the existing test so that the check runs into the bug without this fix and add another test case.

Fixes #53961.

Patch by Jens Massberg.

Reviewed By: ilya-biryukov

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

21 months ago[NFC] Clean up printing of UnwrappedLines.
Manuel Klimek [Fri, 25 Nov 2022 13:28:55 +0000 (13:28 +0000)]
[NFC] Clean up printing of UnwrappedLines.

Move print functions to start of UnwarppedLineParser so they can be
used from everywhere in the file.
Pull out function that doesn't hard-code the stream.