Kazu Hirata [Sat, 26 Nov 2022 22:16:31 +0000 (14:16 -0800)]
[AsmPrinter] Use std::optional in DwarfCompileUnit.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
Kazu Hirata [Sat, 26 Nov 2022 22:13:47 +0000 (14:13 -0800)]
[AsmPrinter] Use std::optional in DbgEntityHistoryCalculator.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
Kazu Hirata [Sat, 26 Nov 2022 22:11:16 +0000 (14:11 -0800)]
[AsmPrinter] Use std::optional in AsmPrinter.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
Kazu Hirata [Sat, 26 Nov 2022 21:58:48 +0000 (13:58 -0800)]
[clang] Use std::size (NFC)
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
Kazu Hirata [Sat, 26 Nov 2022 21:47:32 +0000 (13:47 -0800)]
[llvm] Use std::size (NFC)
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
Roman Lebedev [Sat, 26 Nov 2022 21:00:06 +0000 (00:00 +0300)]
Revert "[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors of bytes (take 2)"
TableGen is still getting miscompiled on PPC buildbots.
Sent a mail with request for help.
This reverts commit
3c4d2a03968ccf5889bacffe02d6fa2443b0260f.
Aart Bik [Tue, 22 Nov 2022 18:49:12 +0000 (10:49 -0800)]
[mlir][sparse][vectorization] optimize reduction chains
A few more dots on the i's of the sparse vectorizer.
Also makes reduction matching less brittle.
Reviewed By: qcolombet
Differential Revision: https://reviews.llvm.org/D138513
Roman Lebedev [Sat, 26 Nov 2022 14:52:58 +0000 (17:52 +0300)]
[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors of bytes (take 2)
This is a recommit of
cf624b23bc5d5a6161706d1663def49380ff816a,
which was reverted in
5cfc22cafe3f2465e0bb324f8daba82ffcabd0df,
because the cut-off on the number of vector elements was not low enough,
and it triggered both SDAG SDNode operand number assertions,
and caused compile time explosions in some cases.
Let's try with something really *REALLY* conservative first,
just to get somewhere, and try to bump it (to 64/128) later.
FIXME: should this respect TTI reg width * num vec regs?
Original commit message:
Now, there's a big caveat here - these bytes
are abstract bytes, not the i8 we have in LLVM,
so strictly speaking this is not exactly legal,
see e.g. https://github.com/AliveToolkit/alive2/issues/860
^ the "bytes" "could" have been a pointer,
and loading it as an integer inserts an implicit ptrtoint.
But at the same time,
InstCombine's `InstCombinerImpl::SimplifyAnyMemTransfer()`
would expand a memtransfer of 1/2/4/8 bytes
into integer-typed load+store,
so this isn't exactly a new problem.
Note that in memory, poison is byte-wise,
so we really can't widen elements,
but SROA seems to be inconsistent here.
Fixes #59116.
Kazu Hirata [Sat, 26 Nov 2022 18:47:22 +0000 (10:47 -0800)]
[TableGen] Use std::size (NFC)
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
Manuel Klimek [Sat, 26 Nov 2022 18:20:22 +0000 (18:20 +0000)]
[NFC] Remove peekNextToken(int).
Arbitrary lookahead restricts the implementation of our TokenSource,
specifically getting in the way of changes to handle macros better.
Instead, use getNextToken to parse lookahead linearly, and
getPosition/setPosition to unwind our lookahead.
Matthias Springer [Sat, 26 Nov 2022 14:34:03 +0000 (15:34 +0100)]
[mlir][tensor][bufferize] Fix tensor.insert_slice regression
This reverts D132662 (apart from overall cleanups), which introduced a too aggressive optimization for tensor.insert_slice bufferization. Instead, bufferizesToMemoryRead is improved to handle some of these cases. The remaining cases can still bufferize efficiently when running the canonicalizer before the bufferization.
Differential Revision: https://reviews.llvm.org/D138745
Kazu Hirata [Sat, 26 Nov 2022 17:53:22 +0000 (09:53 -0800)]
[ObjectYAML] Use std::size (NFC)
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
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
Roman Lebedev [Sat, 26 Nov 2022 15:43:23 +0000 (18:43 +0300)]
[AArch64] `LowerBUILD_VECTOR()`: `NormalizeBuildVector()` might return non-BUILD_VECTOR
As apparent in the newly-added test, provided in:
https://github.com/llvm/llvm-project/commit/
cf624b23bc5d5a6161706d1663def49380ff816a#commitcomment-
90836329,
we should be more careful with handling wider vectors,
or we will assert later on.
Alexandre Ganea [Sat, 26 Nov 2022 15:38:47 +0000 (10:38 -0500)]
[CodeGen] Add missing copy assignment operator
When building on Windows with clang-cl ToT, before this patch I was seeing:
```
[2690/5505] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMISelLowering.cpp.obj
In file included from D:/git/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp:14:
In file included from D:/git/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.h:23:
D:/git/llvm-project/llvm/include\llvm/CodeGen/SelectionDAGNodes.h(760,5): warning: definition of implicit copy assignment operator for 'use_iterator' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
use_iterator(const use_iterator &I) = default;
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xutility(1015,13): note: in implicit copy assignment operator for 'llvm::SDNode::use_iterator' first required here
_It = _STD forward<_UIter>(_UIt);
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xutility(5604,5): note: in instantiation of function template specialization 'std::_Seek_wrapped<llvm::SDNode::use_iterator, llvm::SDNode::use_iterator &>' requested here
_Seek_wrapped(_First, _UFirst);
^
D:/git/llvm-project/llvm/include\llvm/ADT/STLExtras.h(1737,15): note: in instantiation of function template specialization 'std::find_if<llvm::SDNode::use_iterator, (lambda at D:/git/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp:15310:39)>' requested here
return std::find_if(adl_begin(Range), adl_end(Range), P);
^
1 warning generated.
```
Differential Revision: https://reviews.llvm.org/D138715
Krzysztof Parzyszek [Sat, 26 Nov 2022 14:26:58 +0000 (08:26 -0600)]
[LLDB] Change getValue to value in NativeRegisterContextFreeBSD_x86_64.cpp
Optional::getValue has been removed.
Alexandre Ganea [Sat, 26 Nov 2022 14:36:43 +0000 (09:36 -0500)]
[Support] Apply clang-format on .inc files. NFC.
Apply clang-format on llvm/lib/Support/Windows/ and llvm/lib/Support/Unix/ since .inc files in these folders aren't picked up by default. Eventually we need to add this extension in the monorepo .clang-format file.
Differential Revision: https://reviews.llvm.org/D138714
chenglin.bi [Sat, 26 Nov 2022 13:28:34 +0000 (21:28 +0800)]
[InstSimplify] Use dominate condtion to simplify instructions
Fix #56795
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D138542
wanglei [Sat, 26 Nov 2022 12:55:49 +0000 (20:55 +0800)]
[JITLink] Fix typo in comment. NFC
Kazu Hirata [Sat, 26 Nov 2022 08:02:40 +0000 (00:02 -0800)]
[Scalar] Use std::optional in LoopFlatten.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
Kazu Hirata [Sat, 26 Nov 2022 07:59:45 +0000 (23:59 -0800)]
[Scalar] Use std::optional in InductiveRangeCheckElimination.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
Kazu Hirata [Sat, 26 Nov 2022 07:55:43 +0000 (23:55 -0800)]
[Scalar] Use std::optional in GVN.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
Kazu Hirata [Sat, 26 Nov 2022 07:52:49 +0000 (23:52 -0800)]
[Scalar] Use std::optional in CorrelatedValuePropagation.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
Kazu Hirata [Sat, 26 Nov 2022 07:49:50 +0000 (23:49 -0800)]
[InstCombine] Use std::optional in InstructionCombining.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
Kazu Hirata [Sat, 26 Nov 2022 07:46:38 +0000 (23:46 -0800)]
[InstCombine] Use std::optional in InstCombinePHI.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
Kazu Hirata [Sat, 26 Nov 2022 07:44:08 +0000 (23:44 -0800)]
[IPO] Use std::optional in IROutliner.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
Kazu Hirata [Sat, 26 Nov 2022 07:38:32 +0000 (23:38 -0800)]
[IPO] Use std::optional in GlobalOpt.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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
Jakub Kuderski [Fri, 25 Nov 2022 19:48:23 +0000 (14:48 -0500)]
[mlir][vector] Update stale comment. NFC.
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
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
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
Jakub Kuderski [Fri, 25 Nov 2022 19:43:13 +0000 (14:43 -0500)]
[mlir][vector] Update fold pattern name. 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
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
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
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
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