platform/upstream/llvm.git
19 months ago[LoongArch] Use std::nullopt instead of None (NFC)
Kazu Hirata [Sat, 10 Dec 2022 22:49:03 +0000 (14:49 -0800)]
[LoongArch] Use std::nullopt instead of None (NFC)

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

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

19 months ago[InstCombine] Fold nested selects
Roman Lebedev [Sat, 10 Dec 2022 21:51:03 +0000 (00:51 +0300)]
[InstCombine] Fold nested selects

https://alive2.llvm.org/ce/z/GjCXkB
https://alive2.llvm.org/ce/z/Guz2tt

Fixes https://github.com/llvm/llvm-project/issues/59393

19 months ago[NFC][InstCombine] Add tests for nested select folding
Roman Lebedev [Sat, 10 Dec 2022 21:49:43 +0000 (00:49 +0300)]
[NFC][InstCombine] Add tests for nested select folding

https://github.com/llvm/llvm-project/issues/59393

19 months ago[StaticAnalyzer] Don't use Optional<T>::create (NFC)
Kazu Hirata [Sat, 10 Dec 2022 20:35:02 +0000 (12:35 -0800)]
[StaticAnalyzer] Don't use Optional<T>::create (NFC)

std::optional<T> does not have an equivalent method.

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

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

19 months ago[APInt] Convert GetMostSignificantDifferentBit to std::optional
Krzysztof Parzyszek [Sat, 10 Dec 2022 16:34:54 +0000 (10:34 -0600)]
[APInt] Convert GetMostSignificantDifferentBit to std::optional

19 months ago[gold] Fix build
Fangrui Song [Sat, 10 Dec 2022 19:49:44 +0000 (19:49 +0000)]
[gold] Fix build

19 months ago[ObjCopy] llvm::Optional => std::optional
Fangrui Song [Sat, 10 Dec 2022 19:46:02 +0000 (19:46 +0000)]
[ObjCopy] llvm::Optional => std::optional

19 months ago[CodeExtractor] Only rewrite scope of non-inlined variables
Felipe de Azevedo Piovezan [Thu, 8 Dec 2022 18:52:56 +0000 (13:52 -0500)]
[CodeExtractor] Only rewrite scope of non-inlined variables

When a dbg.value instruction for a variable V is extracted into a new
function, the scope of the underlying variable should be set to the new
function iff V was in the scope of the old function (i.e. it hadn't been
inlined). Prior to this patch, the code extractor would always update
the scope of V.

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

19 months agoDon't include None.h (NFC)
Kazu Hirata [Sat, 10 Dec 2022 19:24:26 +0000 (11:24 -0800)]
Don't include None.h (NFC)

I've converted all known uses of None to std::nullopt, so we no longer
need to include None.h.

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

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

19 months ago[Transforms] Use std::optional in AsyncToAsyncRuntime.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:55:02 +0000 (10:55 -0800)]
[Transforms] Use std::optional in AsyncToAsyncRuntime.cpp (NFC)

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

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

19 months ago[Transforms] Use std::optional in LoopFusion.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:49:53 +0000 (10:49 -0800)]
[Transforms] Use std::optional in LoopFusion.cpp (NFC)

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

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

19 months ago[Analysis] Use std::optional in LoopAnalysis.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:46:08 +0000 (10:46 -0800)]
[Analysis] Use std::optional in LoopAnalysis.cpp (NFC)

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

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

19 months ago[Analysis] Use std::optional in AffineStructures.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:44:51 +0000 (10:44 -0800)]
[Analysis] Use std::optional in AffineStructures.cpp (NFC)

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

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

19 months ago[VectorToLLVM] Use std::optional in ConvertVectorToLLVM.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:43:39 +0000 (10:43 -0800)]
[VectorToLLVM] Use std::optional in ConvertVectorToLLVM.cpp (NFC)

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

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

19 months ago[MemRefToLLVM] Use std::optional in MemRefToLLVM.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:41:43 +0000 (10:41 -0800)]
[MemRefToLLVM] Use std::optional in MemRefToLLVM.cpp (NFC)

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

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

19 months ago[ComplexToLibm] Use std::optional in ComplexToLibm.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:40:35 +0000 (10:40 -0800)]
[ComplexToLibm] Use std::optional in ComplexToLibm.cpp (NFC)

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

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

19 months ago[Reader] Use std::optional in BytecodeReader.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:31:26 +0000 (10:31 -0800)]
[Reader] Use std::optional in BytecodeReader.cpp (NFC)

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

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

19 months ago[AsmParser] Use std::optional in Parser.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:28:55 +0000 (10:28 -0800)]
[AsmParser] Use std::optional in Parser.cpp (NFC)

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

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

19 months ago[AsmParser] Use std::optional in AttributeParser.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:27:45 +0000 (10:27 -0800)]
[AsmParser] Use std::optional in AttributeParser.cpp (NFC)

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

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

19 months ago[Presburger] Use std::optional in Simplex.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:24:52 +0000 (10:24 -0800)]
[Presburger] Use std::optional in Simplex.cpp (NFC)

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

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

19 months ago[Presburger] Use std::optional in PresburgerRelation.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:22:11 +0000 (10:22 -0800)]
[Presburger] Use std::optional in PresburgerRelation.cpp (NFC)

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

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

19 months ago[AliasAnalysis] Use std::optional in LocalAliasAnalysis.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 18:20:47 +0000 (10:20 -0800)]
[AliasAnalysis] Use std::optional in LocalAliasAnalysis.cpp (NFC)

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

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

19 months ago[SROA] Rewrite store-into-selected-address into predicated stores
Roman Lebedev [Sat, 10 Dec 2022 17:01:44 +0000 (20:01 +0300)]
[SROA] Rewrite store-into-selected-address into predicated stores

Same basic idea as with unfolding loads into predicated loads,
but we obviously can't have speculative stores.

19 months ago[NFC][SROA] Add tests with store-into-select-of-addrs
Roman Lebedev [Sat, 10 Dec 2022 17:23:00 +0000 (20:23 +0300)]
[NFC][SROA] Add tests with store-into-select-of-addrs

19 months agoRevert "[FileCheck] Use std::optional in FileCheck.cpp (NFC)"
Kazu Hirata [Sat, 10 Dec 2022 17:28:07 +0000 (09:28 -0800)]
Revert "[FileCheck] Use std::optional in FileCheck.cpp (NFC)"

This reverts commit f555ec57cc01181ce09c802194b6f572f7a3f78a.

One build failure has been reported:

https://lab.llvm.org/buildbot/#/builders/67/builds/9785/steps/6/logs/stdio

19 months ago[llvm-gsymutil] Use std::optional in llvm-gsymutil.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:31:15 +0000 (08:31 -0800)]
[llvm-gsymutil] Use std::optional in llvm-gsymutil.cpp (NFC)

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

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

19 months ago[Scalar] Use std::optional in InductiveRangeCheckElimination.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:29:35 +0000 (08:29 -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

19 months ago[Coroutines] Use std::optional in CoroFrame.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:27:36 +0000 (08:27 -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

19 months ago[ProfileData] Use std::optional in InstrProfCorrelator.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:25:50 +0000 (08:25 -0800)]
[ProfileData] Use std::optional in InstrProfCorrelator.cpp (NFC)

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

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

19 months ago[FileCheck] Use std::optional in FileCheck.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:24:18 +0000 (08:24 -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

19 months ago[MachO] Use std::optional in MachOConfig.h (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:22:37 +0000 (08:22 -0800)]
[MachO] Use std::optional in MachOConfig.h (NFC)

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

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

19 months ago[OpenMP] Use std::optional in OMPIRBuilder.h (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:21:04 +0000 (08:21 -0800)]
[OpenMP] Use std::optional in OMPIRBuilder.h (NFC)

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

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

19 months ago[DWARFLinker] Use std::optional in DWARFLinkerCompileUnit.h (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:19:36 +0000 (08:19 -0800)]
[DWARFLinker] Use std::optional in DWARFLinkerCompileUnit.h (NFC)

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

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

19 months ago[BinaryFormat] Use std::optional in Wasm.h (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:18:04 +0000 (08:18 -0800)]
[BinaryFormat] Use std::optional in Wasm.h (NFC)

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

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

19 months ago[Checkers] Use std::optional in UnixAPIChecker.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:10:24 +0000 (08:10 -0800)]
[Checkers] Use std::optional in UnixAPIChecker.cpp (NFC)

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

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

19 months ago[Checkers] Use std::optional in StdLibraryFunctionsChecker.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:09:00 +0000 (08:09 -0800)]
[Checkers] Use std::optional in StdLibraryFunctionsChecker.cpp (NFC)

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

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

19 months ago[RetainCountChecker] Use std::optional in RetainCountDiagnostics.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:07:12 +0000 (08:07 -0800)]
[RetainCountChecker] Use std::optional in RetainCountDiagnostics.cpp (NFC)

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

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

19 months ago[Checkers] Use std::optional in MallocChecker.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:04:28 +0000 (08:04 -0800)]
[Checkers] Use std::optional in MallocChecker.cpp (NFC)

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

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

19 months ago[Checkers] Use std::optional in GenericTaintChecker.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 16:00:24 +0000 (08:00 -0800)]
[Checkers] Use std::optional in GenericTaintChecker.cpp (NFC)

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

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

19 months ago[Checkers] Use std::optional in BasicObjCFoundationChecks.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 15:58:36 +0000 (07:58 -0800)]
[Checkers] Use std::optional in BasicObjCFoundationChecks.cpp (NFC)

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

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

19 months ago[InstCombine] reorder FP select folds
Sanjay Patel [Sat, 10 Dec 2022 14:41:41 +0000 (09:41 -0500)]
[InstCombine] reorder FP select folds

There was a code comment about detecting min/max, and we were already
doing that later.

The real motivation is hinted at by the new TODO comment. I'm hoping
to untangle some FMF ambiguity in follow-on patches. See discussion
in issue #59279.

There are enough unknowns in FMF handling that I can't say with
certainty that this change is NFC, but it doesn't cause any existing
regression tests to change.

19 months ago[InstCombine] add tests for fabs folds with more FMF; NFC
Sanjay Patel [Fri, 9 Dec 2022 19:36:22 +0000 (14:36 -0500)]
[InstCombine] add tests for fabs folds with more FMF; NFC

The existing variants have "nsz", but that's not enough
to get fabs/fneg semantics right with a NAN input, so
I duplicated those with "nnan" tacked on. See discussion
in issue #59279.

19 months ago[FuncSpec] Make the Function Specializer part of the IPSCCP pass.
Alexandros Lamprineas [Fri, 9 Dec 2022 17:41:05 +0000 (17:41 +0000)]
[FuncSpec] Make the Function Specializer part of the IPSCCP pass.

Reland 877a9f9abec61f06e39f1cd872e37b828139c2d1 since D138654 (parent)
has been fixed with 9ebaf4fef4aac89d4eff08e48185d61bc893f14e and with
8f1e11c5a7d70f96943a72649daa69f152d73e90.

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

19 months ago[libc++][doc] Fixes a formating issue.
Mark de Wever [Sat, 10 Dec 2022 14:28:15 +0000 (15:28 +0100)]
[libc++][doc] Fixes a formating issue.

19 months agoRevert "[clang-format] Link the braces of a block in UnwrappedLineParser"
Owen Pan [Sat, 10 Dec 2022 01:16:47 +0000 (17:16 -0800)]
Revert "[clang-format] Link the braces of a block in UnwrappedLineParser"

This reverts commit e33243c950ac40d027ad8facbf7ccf0624604a16 but
keeps the added test case and also adds another test case.

Fixes #59417.

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

19 months ago[Driver] -fstack-size-section: pass -stack-size-section to backend for LTO
Fangrui Song [Sat, 10 Dec 2022 10:15:29 +0000 (10:15 +0000)]
[Driver] -fstack-size-section: pass -stack-size-section to backend for LTO

The option does not change IR but affect object file generation. Without a
backend option the option is a no-op for in-process ThinLTO.

The problem is known and there are many options similar to -fstack-size-section.
That said, -fstack-size-section has relatively wider adoption, so it probably
makes sense to have custom code for it.

Close https://github.com/llvm/llvm-project/issues/59424

19 months agoUse if constexpr to simplify some SFINAE in mlir::OpState (NFC)
Mehdi Amini [Sat, 10 Dec 2022 08:35:59 +0000 (08:35 +0000)]
Use if constexpr to simplify some SFINAE in mlir::OpState (NFC)

Reviewed By: rriddle

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

19 months agoImprove class documentation for mlir::Operation
Mehdi Amini [Sat, 10 Dec 2022 08:35:36 +0000 (08:35 +0000)]
Improve class documentation for mlir::Operation

As a cornerstone of MLIR, this deserves more than the
current few lines.

Reviewed By: rriddle

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

19 months ago[Frontend] Use std::optional in TextDiagnostic.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:22:41 +0000 (23:22 -0800)]
[Frontend] Use std::optional in TextDiagnostic.cpp (NFC)

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

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

19 months ago[Rewrite] Use std::optional in InclusionRewriter.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:21:35 +0000 (23:21 -0800)]
[Rewrite] Use std::optional in InclusionRewriter.cpp (NFC)

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

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

19 months ago[Frontend] Use std::optional in CompilerInvocation.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:19:23 +0000 (23:19 -0800)]
[Frontend] Use std::optional in CompilerInvocation.cpp (NFC)

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

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

19 months ago[Frontend] Use std::optional in CompilerInstance.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:16:32 +0000 (23:16 -0800)]
[Frontend] Use std::optional in CompilerInstance.cpp (NFC)

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

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

19 months ago[Frontend] Use std::optional in ASTUnit.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:12:19 +0000 (23:12 -0800)]
[Frontend] Use std::optional in ASTUnit.cpp (NFC)

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

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

19 months ago[Format] Use std::optional in QualifierAlignmentFixer.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:09:06 +0000 (23:09 -0800)]
[Format] Use std::optional in QualifierAlignmentFixer.cpp (NFC)

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

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

19 months ago[Format] Use std::optional in Format.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:07:58 +0000 (23:07 -0800)]
[Format] Use std::optional in Format.cpp (NFC)

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

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

19 months ago[Format] Use std::optional in ContinuationIndenter.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:06:32 +0000 (23:06 -0800)]
[Format] Use std::optional in ContinuationIndenter.cpp (NFC)

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

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

19 months ago[ExtractAPI] Use std::optional in ExtractAPIConsumer.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 07:03:10 +0000 (23:03 -0800)]
[ExtractAPI] Use std::optional in ExtractAPIConsumer.cpp (NFC)

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

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

19 months ago[linux] Use std::optional in DirectoryWatcher-linux.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 06:55:06 +0000 (22:55 -0800)]
[linux] Use std::optional in DirectoryWatcher-linux.cpp (NFC)

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

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

19 months ago[Targets] Use std::optional in RISCV.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 06:52:29 +0000 (22:52 -0800)]
[Targets] Use std::optional in RISCV.cpp (NFC)

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

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

19 months ago[Basic] Use std::optional in TargetID.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 06:51:10 +0000 (22:51 -0800)]
[Basic] Use std::optional in TargetID.cpp (NFC)

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

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

19 months ago[Basic] Use std::optional in FileManager.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 06:49:47 +0000 (22:49 -0800)]
[Basic] Use std::optional in FileManager.cpp (NFC)

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

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

19 months ago[Basic] Use std::optional in DarwinSDKInfo.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 06:48:14 +0000 (22:48 -0800)]
[Basic] Use std::optional in DarwinSDKInfo.cpp (NFC)

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

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

19 months ago[AST] Use std::optional in OSLog.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 06:21:54 +0000 (22:21 -0800)]
[AST] Use std::optional in OSLog.cpp (NFC)

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

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

19 months ago[AST] Use std::optional in ExprConstant.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 06:19:46 +0000 (22:19 -0800)]
[AST] Use std::optional in ExprConstant.cpp (NFC)

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

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

19 months ago[AST] Use std::optional in ASTImporter.cpp (NFC)
Kazu Hirata [Sat, 10 Dec 2022 06:17:46 +0000 (22:17 -0800)]
[AST] Use std::optional in ASTImporter.cpp (NFC)

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

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

19 months ago[Clang][LoongArch] Add intrinsic for iocsrrd and iocsrwr
gonglingqin [Sat, 10 Dec 2022 03:45:18 +0000 (11:45 +0800)]
[Clang][LoongArch] Add intrinsic for iocsrrd and iocsrwr

These intrinsics are required by Linux [1].

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/loongarch/include/asm/loongarch.h#n240

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

19 months ago[llvm][perf] fix a compiler warning when compile LLVM with LLVM_USE_PERF.
Peiming Liu [Sat, 10 Dec 2022 00:57:00 +0000 (00:57 +0000)]
[llvm][perf] fix a compiler warning when compile LLVM with LLVM_USE_PERF.

To fix "PerfJITEventListener.cpp:208:32: warning: missing field 'Version' initializer [-Wmissing-field-initializers]"

Reviewed By: ezhulenev

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

19 months agoRevert "[compiler-rt][hwasan] Let CheckAddressSized eventually call HandleTagMismatch...
Gulfem Savrun Yeniceri [Sat, 10 Dec 2022 04:44:26 +0000 (04:44 +0000)]
Revert "[compiler-rt][hwasan] Let CheckAddressSized eventually call HandleTagMismatch on Fuchsia"

This reverts commit bcc4470bade15dbafa879973828a03c7e5194399.

19 months agoRevert "[compiler-rt][hwasan] Add unused attribute to GetRegisters"
Gulfem Savrun Yeniceri [Sat, 10 Dec 2022 04:44:10 +0000 (04:44 +0000)]
Revert "[compiler-rt][hwasan] Add unused attribute to GetRegisters"

This reverts commit 3e3ae76de451496d6fb8b4713f847a59d6bc19f5.

19 months ago[sanitizer] Fix the internal_clone implementation on loongarch
Youling Tang [Sat, 10 Dec 2022 03:50:35 +0000 (11:50 +0800)]
[sanitizer] Fix the internal_clone implementation on loongarch

Fix syscall clone argument passing order, also `call fn(arg)` should
return, change `jr $a5`(jirl $zero, $a5, 0) to `jirl $ra, $a5, 0`.

Reviewed By: SixWeining

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

19 months ago[safestack] Enable loongarch64
Youling Tang [Sat, 10 Dec 2022 03:48:12 +0000 (11:48 +0800)]
[safestack] Enable loongarch64

Enable safestack on loongarch64.

Some test cases will fail on loongarch, it will be fixed in glibc,
Links: https://sourceware.org/pipermail/libc-alpha/2022-November/143641.html

Reviewed By: #sanitizers, SixWeining, vitalybuka

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

19 months ago[libc] Use std::nullopt instead of None (NFC)
Kazu Hirata [Sat, 10 Dec 2022 03:47:16 +0000 (19:47 -0800)]
[libc] Use std::nullopt instead of None (NFC)

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

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

19 months ago[LoongArch] Add testcases for privileged intrinsic macros
gonglingqin [Sat, 10 Dec 2022 02:26:06 +0000 (10:26 +0800)]
[LoongArch] Add testcases for privileged intrinsic macros

Add testcases calling macros to the implemented privileged intrinsics
as discussed in D139288. The intrinsics involved include ibar, dbar,
break, syscall, and CRC check intrinsics.

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

19 months ago[libc++][ranges][NFC] Update Ranges status.
Konstantin Varlamov [Sat, 10 Dec 2022 03:32:18 +0000 (19:32 -0800)]
[libc++][ranges][NFC] Update Ranges status.

Add a link to an in-progress patch.

19 months ago[libc] Use std::nullopt instead of None (NFC)
Kazu Hirata [Sat, 10 Dec 2022 03:14:05 +0000 (19:14 -0800)]
[libc] Use std::nullopt instead of None (NFC)

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

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

19 months ago[AMDGPU] Update MFMASmallGemmOpt with better performing stategy
Austin Kerbow [Fri, 2 Dec 2022 20:32:02 +0000 (12:32 -0800)]
[AMDGPU] Update MFMASmallGemmOpt with better performing stategy

Based on experiments this does better with target small GEMM kernels.

Reviewed By: jrbyrnes

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

19 months ago[clang] Use std::nullopt instead of None in comments (NFC)
Kazu Hirata [Sat, 10 Dec 2022 02:39:01 +0000 (18:39 -0800)]
[clang] Use std::nullopt instead of None in comments (NFC)

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

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

19 months ago[flang] Use std::nullopt instead of llvm::None (NFC)
Kazu Hirata [Sat, 10 Dec 2022 02:32:33 +0000 (18:32 -0800)]
[flang] Use std::nullopt instead of llvm::None (NFC)

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

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

19 months ago[llvm] Use std::nullopt instead of None (NFC)
Kazu Hirata [Sat, 10 Dec 2022 02:32:31 +0000 (18:32 -0800)]
[llvm] Use std::nullopt instead of None (NFC)

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

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

19 months ago[mlir][arith] Define mulsi_extended op
Jakub Kuderski [Sat, 10 Dec 2022 01:25:31 +0000 (20:25 -0500)]
[mlir][arith] Define mulsi_extended op

Extend D139688 with the signed version of the extended multiplication
op. Add conversion to the SPIR-V and LLVM dialects.

This was originally proposed in:
https://discourse.llvm.org/t/rfc-arith-add-extended-multiplication-ops/66869.

Reviewed By: antiagainst

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

19 months ago[scudo] Enable more warnings for standalone build
Dominic Chen [Sat, 10 Dec 2022 01:15:47 +0000 (17:15 -0800)]
[scudo] Enable more warnings for standalone build

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

19 months ago[RISCV] clang-format lowerReductionSeq. NFC
Craig Topper [Sat, 10 Dec 2022 01:00:29 +0000 (17:00 -0800)]
[RISCV] clang-format lowerReductionSeq. NFC

Wraps a long line to 80 columns.

19 months ago[LangRef] Fix typo. NFC.
Yeting Kuo [Sat, 10 Dec 2022 01:01:47 +0000 (09:01 +0800)]
[LangRef] Fix typo. NFC.

bswap is an unary operation.

Reviewed By: craig.topper

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

19 months ago[RISCV] Simplify RISCVSubtarget. NFC
Craig Topper [Sat, 10 Dec 2022 00:21:33 +0000 (16:21 -0800)]
[RISCV] Simplify RISCVSubtarget. NFC

The flags, initialization of the flags, and the getter methods for
features defined in RISCV.td can be generated by TableGen.

Reviewed By: reames

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

19 months ago[mlir][sparse] avoid sorting when unnecessary when convert sparse tensors.
Peiming Liu [Fri, 9 Dec 2022 23:21:09 +0000 (23:21 +0000)]
[mlir][sparse] avoid sorting when unnecessary when convert sparse tensors.

Reviewed By: aartbik

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

19 months ago[gn build] Port ec3f8feddf81
LLVM GN Syncbot [Fri, 9 Dec 2022 23:21:59 +0000 (23:21 +0000)]
[gn build] Port ec3f8feddf81

19 months ago[Clang-Tidy] Empty Check
Abraham Corea Diaz [Fri, 9 Dec 2022 22:38:34 +0000 (22:38 +0000)]
[Clang-Tidy] Empty Check

Adds a clang-tidy check for the incorrect use of `empty()` on a
container when the result of the call is ignored.

Authored-by: Abraham Corea Diaz <abrahamcd@google.com>
Co-authored-by: Denis Nikitin <denik@google.com>
Reviewed By: cjdb

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

19 months ago[Headers][ARM] Allow `struct _Unwind_Exception` in unwind.h
Ryan Prichard [Fri, 9 Dec 2022 23:15:22 +0000 (15:15 -0800)]
[Headers][ARM] Allow `struct _Unwind_Exception` in unwind.h

Use the same approach as used in libunwind/include/unwind_arm_ehabi.h
(D89570) and GCC's unwind-arm-common.h, so that _Unwind_Exception can be
used both with and without the struct tag.

Fixes a build failure in libcxxabi/test/forced_unwind1.pass.cpp.

Reviewed By: danielkiss

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

19 months ago[libc++][Android] Disable pbump2gig for Android
Ryan Prichard [Fri, 9 Dec 2022 23:15:16 +0000 (15:15 -0800)]
[libc++][Android] Disable pbump2gig for Android

Android devices frequently don't have enough memory to run this test.

e.g. On the API 33 x86-64 emulator with 2GiB RAM, the test triggers the
OOM Killer, the device reboots, and then `adb shell` exits with status
0 and no output.

Reviewed By: danalbert, #libc, Mordante

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

19 months ago[libc++][Android] Android/Bionic headers don't work with modules yet
Ryan Prichard [Fri, 9 Dec 2022 23:14:42 +0000 (15:14 -0800)]
[libc++][Android] Android/Bionic headers don't work with modules yet

The current Android headers don't appear to work with modules. We may
want to fix them eventually.

Reviewed By: #libc, Mordante

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

19 months ago[libc++][Android] Include cstdlib to define __BIONIC__
Ryan Prichard [Fri, 9 Dec 2022 23:14:04 +0000 (15:14 -0800)]
[libc++][Android] Include cstdlib to define __BIONIC__

__ANDROID__ is a built-in compiler macro, but __BIONIC__ is defined by
the libc header.

Reviewed By: #libc_abi, compnerd

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

19 months ago[NFC][Assignment Tracking Analysis] Stop failing test from running on PPC.
Stefan Pintilie [Fri, 9 Dec 2022 23:00:42 +0000 (17:00 -0600)]
[NFC][Assignment Tracking Analysis] Stop failing test from running on PPC.

The test remove-undef-fragment.ll fails on the PPC bots. I've disabled the test
everywhere except X86 to allow for the investigation of the issue.

19 months ago[mlir] Remove double 'the' in comment (NFC)
SaeHie Park [Fri, 9 Dec 2022 22:51:36 +0000 (14:51 -0800)]
[mlir] Remove double 'the' in comment (NFC)

Remove the double 'the' in the comment for 'getInsertionBlock()'.

Reviewed By: jpienaar, rriddle

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

19 months ago[mlir][arith] Define mului_extended op
Jakub Kuderski [Fri, 9 Dec 2022 22:37:05 +0000 (17:37 -0500)]
[mlir][arith] Define mului_extended op

Add conversion to the SPIR-V and LLVM dialects.

This was originally proposed in:
https://discourse.llvm.org/t/rfc-arith-add-extended-multiplication-ops/66869.

Reviewed By: antiagainst

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

19 months ago[libc] add result class to strtointeger
Michael Jones [Thu, 1 Sep 2022 22:19:35 +0000 (15:19 -0700)]
[libc] add result class to strtointeger

This is a class intended to improve errno handling for internal
functions by allowing functions to return their result and error status
instead of setting errno. This specific class will be used for
strtointeger and (in a followup patch) strtofloat.

Reviewed By: sivachandra

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

19 months ago[OpenMP][FIX] Do not use reachability reasoning in parallel contexts
Johannes Doerfert [Fri, 9 Dec 2022 22:13:52 +0000 (14:13 -0800)]
[OpenMP][FIX] Do not use reachability reasoning in parallel contexts

Similar to dominance reasoning, we cannot use CFG reachability if the
instructions might be executed by different threads. A follow up will
improve our sensitivity for situations when it is OK to use graph
reasoning.

19 months agoRevert "Implement CWG2631"
Arthur Eubanks [Fri, 9 Dec 2022 22:17:37 +0000 (14:17 -0800)]
Revert "Implement CWG2631"

This reverts commit c9a6713b4788f10b81202b70993068e475b392f7.

Causes crashes, see D136554.

19 months ago[SCEV] Cache ZExt SCEV expressions.
Florian Hahn [Fri, 9 Dec 2022 22:14:03 +0000 (22:14 +0000)]
[SCEV] Cache ZExt SCEV expressions.

When creating SCEV expressions for ZExt, there's quite a bit of
reasoning done and in many places the reasoning in turn will try to
create new SCEVs for other ZExts.

This can have a huge compile-time impact. The attached test from #58402
takes an excessive amount of compile time; without the patch, the test
doesn't complete in 1500+ seconds, but with the patch it completes in 1
second.

To speed up this case, cache created ZExt expressions for given (SCEV, Ty) pairs.
Caching just ZExts is relatively straight-forward, but it might make
sense to extend it to other expressions in the future.

This has a slight positive impact on CTMark:
* O3: -0.03%
* ReleaseThinLTO: -0.03%
* ReleaseLTO-g: 0.00%

https://llvm-compile-time-tracker.com/compare.php?from=bf9de7464946c65f488fe86ea61bfdecb8c654c1&to=5ac0108553992fb3d58bc27b1518e8cf06658a32&stat=instructions:u

The patch also improves compile-time for some internal real-world workloads
where time spent in SCEV goes from ~300 seconds to ~3 seconds.

There are a few cases where computing & caching the result earlier may
return more pessimistic results, but the compile-time savings seem to
outweigh that.

Fixes #58402.

Reviewed By: mkazantsev

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

19 months ago[SystemZ][NFC] Simplify SystemZSubtarget
Kai Nacke [Fri, 9 Dec 2022 20:26:17 +0000 (15:26 -0500)]
[SystemZ][NFC] Simplify SystemZSubtarget

The flags, initialization of the flags, and the getter methods for
features defined in SystemZFeatures.td can be generated by TableGen.

Reviewed By: uweigand

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

19 months ago[flang] Skip fast_math linker test on powerpc
Tom Eccles [Fri, 9 Dec 2022 21:20:42 +0000 (21:20 +0000)]
[flang] Skip fast_math linker test on powerpc

Related to https://reviews.llvm.org/D138675