platform/upstream/llvm.git
22 months ago[test][NFC] Guard one test case against LLVM checkouts at interesting paths
WANG Xuerui [Sun, 11 Dec 2022 13:31:11 +0000 (16:31 +0300)]
[test][NFC] Guard one test case against LLVM checkouts at interesting paths

Previously only the "store" string was being checked for not appearing
twice, but unfortunately the check also looked at the ModuleID and
source_filename lines, so the test case would fail if the LLVM
checkout's absolute path contained the substring "store".

Fix this spurious test failure by tweaking the invocation so the full
path no longer shows up in the output.

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

22 months ago[X86] RDRAND is a Goldmont feature, not Silvermont
Simon Pilgrim [Sun, 11 Dec 2022 12:28:22 +0000 (12:28 +0000)]
[X86] RDRAND is a Goldmont feature, not Silvermont

22 months ago[X86] Fix missing HasPRFCHW predicate
Simon Pilgrim [Sun, 11 Dec 2022 11:06:10 +0000 (11:06 +0000)]
[X86] Fix missing HasPRFCHW predicate

This was declared in FeaturePRFCHW but never defined.

Noticed while preparing to add Unsupported features handling to X86 scheduler models.

22 months ago[X86] Fix missing HasX86_64 predicate
Simon Pilgrim [Sun, 11 Dec 2022 10:27:03 +0000 (10:27 +0000)]
[X86] Fix missing HasX86_64 predicate

This was declared in FeatureX86_64 but never defined (we use the *64BitMode predicates for instruction defs - but now we need it for scheduler model defs).

Noticed while preparing to add Unsupported features handling to X86 scheduler models.

22 months ago[X86] Fix missing HasLAHFSAHF64 predicate
Simon Pilgrim [Sat, 10 Dec 2022 21:28:15 +0000 (21:28 +0000)]
[X86] Fix missing HasLAHFSAHF64 predicate

This was declared in FeatureLAHFSAHF64 but never defined.

Noticed while preparing to add Unsupported features handling to X86 scheduler models.

22 months ago[X86] Fix missing HasPKU predicate
Simon Pilgrim [Sat, 10 Dec 2022 20:31:29 +0000 (20:31 +0000)]
[X86] Fix missing HasPKU predicate

This was declared in FeaturePKU but defined just as PKU.

Noticed while preparing to add Unsupported features handling to X86 scheduler models.

22 months ago[X86] Add missing HasNOPL predicate
Simon Pilgrim [Sat, 10 Dec 2022 20:25:26 +0000 (20:25 +0000)]
[X86] Add missing HasNOPL predicate

This was declared in FeatureNOPL but never defined.

Noticed while preparing to add Unsupported features handling to X86 scheduler models.

22 months ago[Analysis] Use std::optional in MemoryBuiltins.cpp (NFC)
Kazu Hirata [Sun, 11 Dec 2022 09:32:26 +0000 (01:32 -0800)]
[Analysis] Use std::optional in MemoryBuiltins.cpp (NFC)

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

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

22 months ago[Analysis] Use std::optional in LazyValueInfo.cpp (NFC)
Kazu Hirata [Sun, 11 Dec 2022 09:18:36 +0000 (01:18 -0800)]
[Analysis] Use std::optional in LazyValueInfo.cpp (NFC)

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

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

22 months ago[Docs] Update opaque pointers docs (NFC)
Nikita Popov [Sun, 11 Dec 2022 08:47:01 +0000 (09:47 +0100)]
[Docs] Update opaque pointers docs (NFC)

22 months ago[gn build] Port ee4c8119a6d3
LLVM GN Syncbot [Sun, 11 Dec 2022 08:37:29 +0000 (08:37 +0000)]
[gn build] Port ee4c8119a6d3

22 months ago[RISCV] Use a helper function to reduce duplicated code in RISCVSExtWRemoval. NFC
Craig Topper [Sun, 11 Dec 2022 08:07:54 +0000 (00:07 -0800)]
[RISCV] Use a helper function to reduce duplicated code in RISCVSExtWRemoval. NFC

We were checking for virtual register and calling getVReg in
multiple places before adding to the worklist.

22 months ago[ADT] Move MoveOnly to a header file (NFC)
Kazu Hirata [Sun, 11 Dec 2022 08:31:46 +0000 (00:31 -0800)]
[ADT] Move MoveOnly to a header file (NFC)

This patch moves MoveOnly to a header file so that I can use it from
another .cpp file.

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

22 months ago[StaticAnalyzer] Use std::optional in RetainCountDiagnostics.cpp (NFC)
Kazu Hirata [Sun, 11 Dec 2022 05:15:44 +0000 (21:15 -0800)]
[StaticAnalyzer] 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

22 months ago[StaticAnalyzer] Use std::optional in MallocChecker.cpp (NFC)
Kazu Hirata [Sun, 11 Dec 2022 05:15:42 +0000 (21:15 -0800)]
[StaticAnalyzer] 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

22 months ago[StaticAnalyzer] Use std::optional in BugReporterVisitors.cpp (NFC)
Kazu Hirata [Sun, 11 Dec 2022 05:11:31 +0000 (21:11 -0800)]
[StaticAnalyzer] Use std::optional in BugReporterVisitors.cpp (NFC)

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

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

22 months ago[StaticAnalyzer] Use std::optional in BugReporter.cpp (NFC)
Kazu Hirata [Sun, 11 Dec 2022 05:11:29 +0000 (21:11 -0800)]
[StaticAnalyzer] Use std::optional in BugReporter.cpp (NFC)

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

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

22 months ago[StaticAnalyzer] Use std::optional in BugReporter.cpp (NFC)
Kazu Hirata [Sun, 11 Dec 2022 04:54:38 +0000 (20:54 -0800)]
[StaticAnalyzer] Use std::optional in BugReporter.cpp (NFC)

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

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

22 months agoRemove using llvm::None
Fangrui Song [Sun, 11 Dec 2022 02:47:18 +0000 (02:47 +0000)]
Remove using llvm::None

22 months ago[LoongArch] Fix -Wmacro-redefined after D139612
Fangrui Song [Sun, 11 Dec 2022 02:27:29 +0000 (02:27 +0000)]
[LoongArch] Fix -Wmacro-redefined after D139612

22 months ago[llvm-exegesis] `ExegesisX86Target::setRegTo()`: support mask (K) regs
Roman Lebedev [Sun, 11 Dec 2022 01:49:18 +0000 (04:49 +0300)]
[llvm-exegesis] `ExegesisX86Target::setRegTo()`: support mask (K) regs

This only supports the obvious case, where the requested width
is supported by the available ISA sed, and there is
an appropriate, or wider, `KMOV?` instruction.

This doesn't deal with the 32/64 bit mask without BW instruction set.

This was the missing functionality that was
causing crashes in fd52305fdc7572534867247c8fb66093faf52e5c.

22 months ago[cross-project-tests] Use std::nullopt instead of llvm::None (NFC)
Kazu Hirata [Sun, 11 Dec 2022 01:37:55 +0000 (17:37 -0800)]
[cross-project-tests] 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

22 months ago[mlir] Use std::optional instead of None in comments (NFC)
Kazu Hirata [Sun, 11 Dec 2022 01:11:23 +0000 (17:11 -0800)]
[mlir] Use std::optional 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

22 months ago[llvm] Use std::optional instead of None in comments (NFC)
Kazu Hirata [Sun, 11 Dec 2022 01:09:01 +0000 (17:09 -0800)]
[llvm] Use std::optional 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

22 months ago[lldb] Use std::optional instead of None in comments (NFC)
Kazu Hirata [Sun, 11 Dec 2022 01:06:43 +0000 (17:06 -0800)]
[lldb] Use std::optional 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

22 months ago[lld] Use std::optional instead of None in comments (NFC)
Kazu Hirata [Sun, 11 Dec 2022 01:04:56 +0000 (17:04 -0800)]
[lld] Use std::optional 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

22 months ago[libc] Use std::optional instead of None in comments (NFC)
Kazu Hirata [Sun, 11 Dec 2022 01:01:55 +0000 (17:01 -0800)]
[libc] Use std::optional 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

22 months ago[flang] Use std::optional instead of None in comments (NFC)
Kazu Hirata [Sun, 11 Dec 2022 01:00:21 +0000 (17:00 -0800)]
[flang] Use std::optional 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

22 months ago[clang-tools-extra] Use std::optional instead of None in comments (NFC)
Kazu Hirata [Sun, 11 Dec 2022 00:59:22 +0000 (16:59 -0800)]
[clang-tools-extra] Use std::optional 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

22 months ago[BOLT] Use std::optional instead of None in comments (NFC)
Kazu Hirata [Sun, 11 Dec 2022 00:57:33 +0000 (16:57 -0800)]
[BOLT] Use std::optional 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

22 months ago[libc][Obvious] Fix memory function benchmarks after removal of None.
Siva Chandra Reddy [Sun, 11 Dec 2022 00:20:33 +0000 (00:20 +0000)]
[libc][Obvious] Fix memory function benchmarks after removal of None.

22 months ago[libc] Add custom operator new to handle allocation failures gracefully.
Siva Chandra Reddy [Wed, 7 Dec 2022 21:35:38 +0000 (21:35 +0000)]
[libc] Add custom operator new to handle allocation failures gracefully.

This patch adds the implementation of the custom operator new functions.
The implementation of the internal strdup has been updated to use
operator new for allocation.

We will make it a policy and document that all allocations have to go
through the libc's own operator new. A future change will also add
operator delete replacements and make it a policy that deallocations in
libc internal code have to go through those replacements.

Reviewed By: lntue

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

22 months ago[ADT] Deperecate llvm::None
Kazu Hirata [Sat, 10 Dec 2022 23:49:58 +0000 (15:49 -0800)]
[ADT] Deperecate llvm::None

I've converted all known uses of None to std::nullopt.

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

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

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

22 months ago[mlir] FunctionOpInterface: turn required attributes into interface methods (Reland)
Jeff Niu [Tue, 6 Dec 2022 19:28:47 +0000 (11:28 -0800)]
[mlir] FunctionOpInterface: turn required attributes into interface methods (Reland)

Reland D139447, D139471 With flang actually working

- FunctionOpInterface: make get/setFunctionType interface methods

This patch removes the concept of a `function_type`-named type attribute
as a requirement for implementors of FunctionOpInterface. Instead, this
type should be provided through two interface methods, `getFunctionType`
and `setFunctionTypeAttr` (*Attr because functions may use different
concrete function types), which should be automatically implemented by
ODS for ops that define a `$function_type` attribute.

This also allows FunctionOpInterface to materialize function types if
they don't carry them in an attribute, for example.

Importantly, all the function "helper" still accept an attribute name to
use in parsing and printing functions, for example.

- FunctionOpInterface: arg and result attrs dispatch to interface

This patch removes the `arg_attrs` and `res_attrs` named attributes as a
requirement for FunctionOpInterface and replaces them with interface
methods for the getters, setters, and removers of the relevent
attributes. This allows operations to use their own storage for the
argument and result attributes.

Reviewed By: jpienaar

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

22 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

22 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

22 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

22 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

22 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

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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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.

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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.

22 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.

22 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

22 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.

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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

22 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