Matt Arsenault [Sun, 27 Nov 2022 14:40:00 +0000 (09:40 -0500)]
SampleProfile: Don't use anonymous values in test
These interfered with converting the test to opaque pointers.
Matt Arsenault [Sun, 27 Nov 2022 14:23:21 +0000 (09:23 -0500)]
IndirectCallPromotion: Fix illegal promotion with opaque pointers
This was doing a type check on the argument types and skipping all
other safety checks if they matched.
Ayke van Laethem [Wed, 23 Nov 2022 17:18:07 +0000 (18:18 +0100)]
[AVR] Remove unused register scavenger
The LPMW/ELPMW instruction can be modified to use an earlyclobber, which
prevents it from using the Z register as an output register.
Also see: https://reviews.llvm.org/D131844
Differential Revision: https://reviews.llvm.org/D117957
Ayke van Laethem [Wed, 23 Nov 2022 01:10:22 +0000 (02:10 +0100)]
[AVR] Add $ separator string (like avr-gcc)
avr-gcc uses the $ symbol as an assembly separator instead of the more
common %% syntax. We need it in LLVM too to be compatible.
Differential Revision: https://reviews.llvm.org/D138535
Ayke van Laethem [Thu, 24 Nov 2022 19:24:36 +0000 (20:24 +0100)]
[AVR] Fix broken bitcast for aliases in non-zero address space
This was triggered by some code in picolibc. The minimal version looks
like this:
double infinity(void) {
return 5;
}
extern long double infinityl() __attribute__((__alias__("infinity")));
These two declarations have a different type (not because of the 'long
double', which is also 'double' in IR, but because infinityl has
variadic parameters). This led to a crash in the bitcast which assumed
address space 0.
Differential Revision: https://reviews.llvm.org/D138681
David Green [Sun, 27 Nov 2022 12:53:10 +0000 (12:53 +0000)]
[AArch64] Add GPR rr instructions to isAssociativeAndCommutative
This adds some more scalar instructions that are both associative and
commutative to isAssociativeAndCommutative, allowing the machine
combiner to reassociate them to reduce critical path length.
Differential Revision: https://reviews.llvm.org/D134260
Stefan Gränitz [Sun, 27 Nov 2022 12:29:05 +0000 (13:29 +0100)]
[Orc][examples] Temporarily re-enable tests for the C API and keep an eye on sanitizer bots
This reverts commit
9c63e5b415d1d62116fec160c6ac1f3c00933ed9
Stefan Gränitz [Sun, 27 Nov 2022 12:24:03 +0000 (13:24 +0100)]
[Orc][examples] Emit artifacts in test-specific output folder (NFC)
Stefan Gränitz [Sat, 26 Nov 2022 23:05:06 +0000 (00:05 +0100)]
[lldb][JITLoaderGDB] Resolve __jit_debug_register_code as eSymbolTypeCode
Fix failling jit-loader tests with BUILD_SHARED_LIBS as discussed in https://github.com/llvm/llvm-project/issues/56085
Reviewed By: mgorny
Differential Revision: https://reviews.llvm.org/D138750
Fangrui Song [Sun, 27 Nov 2022 05:12:30 +0000 (21:12 -0800)]
[ELF] Simplify ObjFile<ELFT>::parseLazy. NFC
Kazu Hirata [Sun, 27 Nov 2022 05:03:34 +0000 (21:03 -0800)]
[lld] Use std::optional in lld.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 05:02:09 +0000 (21:02 -0800)]
[MachO] Use std::optional in InputFiles.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 04:59:04 +0000 (20:59 -0800)]
[MachO] Use std::optional in ExportTrie.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 04:56:52 +0000 (20:56 -0800)]
[COFF] Use std::optional in PDB.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 04:54:36 +0000 (20:54 -0800)]
[COFF] Use std::optional in InputFiles.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 04:53:26 +0000 (20:53 -0800)]
[COFF] Use std::optional in Driver.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
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