Koakuma [Sun, 27 Nov 2022 04:29:05 +0000 (23:29 -0500)]
[SPARC] Add tail call support for 64-bit target
Extend SPARC tail call support, first introduced in D51206 (commit
1c235c375492180c2eecb6331f169486019fd2d2),
to also cover 64-bit target.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D138741
Fangrui Song [Sun, 27 Nov 2022 03:19:15 +0000 (19:19 -0800)]
[ELF] Change most llvm::Optional to std::optional
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Kazu Hirata [Sun, 27 Nov 2022 03:09:32 +0000 (19:09 -0800)]
[yaml2obj] Use std::optional in yaml2obj.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 [Sun, 27 Nov 2022 03:06:49 +0000 (19:06 -0800)]
[obj2yaml] Use std::optional in elf2yaml.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 [Sun, 27 Nov 2022 03:05:08 +0000 (19:05 -0800)]
[llvm-readobj] Use std::optional in ELFDumper.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 [Sun, 27 Nov 2022 03:01:24 +0000 (19:01 -0800)]
[llvm-profgen] Use std::optional in ProfiledBinary.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 [Sun, 27 Nov 2022 02:59:41 +0000 (18:59 -0800)]
[llvm-profdata] Use std::optional in llvm-profdata.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 [Sun, 27 Nov 2022 02:58:05 +0000 (18:58 -0800)]
[llvm-objdump] Use std::optional in llvm-objdump.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 [Sun, 27 Nov 2022 02:53:51 +0000 (18:53 -0800)]
[llvm-lipo] Use std::optional in llvm-lipo.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 [Sun, 27 Nov 2022 02:51:35 +0000 (18:51 -0800)]
[llvm-ifs] Use std::optional in llvm-ifs.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 [Sun, 27 Nov 2022 02:49:27 +0000 (18:49 -0800)]
[llvm-dwp] Use std::optional in llvm-dwp.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 [Sun, 27 Nov 2022 02:47:28 +0000 (18:47 -0800)]
[llvm-cov] Use std::optional in SourceCoverageViewText.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 [Sun, 27 Nov 2022 02:45:08 +0000 (18:45 -0800)]
[llvm-cov] Use std::optional in SourceCoverageViewHTML.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 [Sun, 27 Nov 2022 02:42:47 +0000 (18:42 -0800)]
[llvm-cov] Use std::optional in CodeCoverage.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 [Sun, 27 Nov 2022 02:39:27 +0000 (18:39 -0800)]
[lli] Use std::optional in lli.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 [Sun, 27 Nov 2022 02:36:55 +0000 (18:36 -0800)]
[dsymutil] Use std::optional in DwarfLinkerForBinary.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 [Sun, 27 Nov 2022 02:11:32 +0000 (18:11 -0800)]
[Vectorize] Use std::optional in VPlanSLP.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 [Sun, 27 Nov 2022 02:03:49 +0000 (18:03 -0800)]
[Vectorize] Use std::optional in SLPVectorizer.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 [Sun, 27 Nov 2022 01:55:33 +0000 (17:55 -0800)]
[Utils] Use std::optional in SimplifyCFG.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 [Sun, 27 Nov 2022 01:53:17 +0000 (17:53 -0800)]
[Utils] Use std::optional in LoopPeel.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 [Sun, 27 Nov 2022 01:49:07 +0000 (17:49 -0800)]
[Utils] Use std::optional in Local.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 [Sun, 27 Nov 2022 01:44:44 +0000 (17:44 -0800)]
[Utils] Use std::optional in CloneFunction.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 [Sun, 27 Nov 2022 01:41:52 +0000 (17:41 -0800)]
[Scalar] Use std::optional in SimpleLoopUnswitch.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 [Sun, 27 Nov 2022 01:39:36 +0000 (17:39 -0800)]
[Scalar] Use std::optional in ScalarizeMaskedMemIntrin.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 [Sun, 27 Nov 2022 01:36:26 +0000 (17:36 -0800)]
[Scalar] Use std::optional in PartiallyInlineLibCalls.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 [Sun, 27 Nov 2022 01:33:11 +0000 (17:33 -0800)]
[Scalar] Use std::optional in LowerConstantIntrinsics.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 [Sun, 27 Nov 2022 01:29:32 +0000 (17:29 -0800)]
[Scalar] Use std::optional in LoopUnrollPass.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 [Sun, 27 Nov 2022 01:26:57 +0000 (17:26 -0800)]
[Scalar] Use std::optional in LoopStrengthReduce.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 [Sun, 27 Nov 2022 01:24:20 +0000 (17:24 -0800)]
[Scalar] Use std::optional in LoopSimplifyCFG.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 [Sun, 27 Nov 2022 01:21:19 +0000 (17:21 -0800)]
[Scalar] Use std::optional in LoopRotation.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 [Sun, 27 Nov 2022 01:18:54 +0000 (17:18 -0800)]
[Scalar] Use std::optional in LoopPredication.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 [Sun, 27 Nov 2022 01:14:23 +0000 (17:14 -0800)]
[Scalar] Use std::optional in LoopInstSimplify.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 [Sun, 27 Nov 2022 01:08:27 +0000 (17:08 -0800)]
Revert "[FileCheck] Use std::optional in FileCheck.cpp (NFC)"
This reverts commit
e5a1ee531b2d325b0c793f849abbbbd4c9d315fd.
Build errors have been reported:
https://lab.llvm.org/buildbot/#/builders/123/builds/14344
https://lab.llvm.org/buildbot#builders/216/builds/13360
Florian Hahn [Sat, 26 Nov 2022 23:48:46 +0000 (23:48 +0000)]
[LV] Move trunc codegen to buildScalarSteps (NFCI).
This moves the code to truncate step and IV into buildScalarSteps,
closer to the place where they are actually used.
Suggested in D133758.
Kazu Hirata [Sat, 26 Nov 2022 23:29:30 +0000 (15:29 -0800)]
[LTO] Use std::optional in LTO.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 23:27:16 +0000 (15:27 -0800)]
[FileCheck] Use std::optional in FileCheck.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 23:24:34 +0000 (15:24 -0800)]
[Orc] Use std::optional in ObjectFileInterface.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 23:22:05 +0000 (15:22 -0800)]
[Orc] Use std::optional in MachOPlatform.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 23:19:50 +0000 (15:19 -0800)]
[Orc] Use std::optional in ELFNixPlatform.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 23:17:41 +0000 (15:17 -0800)]
[Orc] Use std::optional in Core.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 23:15:18 +0000 (15:15 -0800)]
[JITLink] Use std::optional in MachOLinkGraphBuilder.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 23:12:11 +0000 (15:12 -0800)]
[CodeGen] Use std::optional in TargetPassConfig.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 23:09:25 +0000 (15:09 -0800)]
[CodeGen] Use std::optional in ShadowStackGCLowering.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 23:07:23 +0000 (15:07 -0800)]
[SelectionDAG] Use std::optional in SelectionDAGISel.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 23:05:06 +0000 (15:05 -0800)]
[SelectionDAG] Use std::optional in SelectionDAGBuilder.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 23:02:45 +0000 (15:02 -0800)]
[SelectionDAG] Use std::optional in FastISel.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 23:00:23 +0000 (15:00 -0800)]
[SelectionDAG] Use std::optional in DAGCombiner.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:57:44 +0000 (14:57 -0800)]
[CodeGen] Use std::optional in SafeStack.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:55:08 +0000 (14:55 -0800)]
[CodeGen] Use std::optional in MachineOperand.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:52:33 +0000 (14:52 -0800)]
[LiveDebugValues] Use std::optional in InstrRefBasedImpl.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:50:12 +0000 (14:50 -0800)]
[CodeGen] Use std::optional in IndirectBrExpandPass.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:47:46 +0000 (14:47 -0800)]
[GlobalISel] Use std::optional in Utils.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
Florian Hahn [Sat, 26 Nov 2022 22:47:13 +0000 (22:47 +0000)]
[VPlan] Move cast codegen to emitTransformedIndex (NFCI).
This reduces duplication a bit.
Suggested as simplification in D133758.
Kazu Hirata [Sat, 26 Nov 2022 22:44:54 +0000 (14:44 -0800)]
[GlobalISel] Use std::optional in LegalizerHelper.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:33:45 +0000 (14:33 -0800)]
[GlobalISel] Use std::optional in CombinerHelper.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:29:56 +0000 (14:29 -0800)]
[CodeGen] Use std::optional in ExpandMemCmp.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:27:19 +0000 (14:27 -0800)]
[CodeGen] Use std::optional in CodeGenPrepare.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:24:38 +0000 (14:24 -0800)]
[CodeGen] Use std::optional in BasicBlockSections.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:21:32 +0000 (14:21 -0800)]
[AsmPrinter] Use std::optional::value_or (NFC)
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