platform/upstream/llvm.git
20 months agollvm-reduce: Fix producing invalid reductions on ifunc
Matt Arsenault [Tue, 22 Nov 2022 21:31:43 +0000 (16:31 -0500)]
llvm-reduce: Fix producing invalid reductions on ifunc

20 months agoJumpThreading: Modernize some test checking
Matt Arsenault [Sun, 27 Nov 2022 16:42:45 +0000 (11:42 -0500)]
JumpThreading: Modernize some test checking

Stop using tests with grep, or no output checks at all. Just use
FileCheck and generate checks. Also remove unnecessary requires
asserts.

20 months ago[X86] Remove unnecessary VBLENDWYrr overrides
Simon Pilgrim [Sun, 27 Nov 2022 16:54:39 +0000 (16:54 +0000)]
[X86] Remove unnecessary VBLENDWYrr overrides

The znver2 override already matched the WriteBlendY class exactly, and the znver1 override wasn't accounting for ymm double-pumping.

Found with the help of D138359

20 months ago[Docs] Mention to add RUN line before running script to generate assertion
Shivam Gupta [Sun, 27 Nov 2022 15:43:03 +0000 (21:13 +0530)]
[Docs] Mention to add RUN line before running script to generate assertion

20 months ago[X86] Add test coverage for Issue #59217
Simon Pilgrim [Sun, 27 Nov 2022 16:37:17 +0000 (16:37 +0000)]
[X86] Add test coverage for Issue #59217

20 months agoJumpThreading: Convert tests to -passes
Matt Arsenault [Sun, 27 Nov 2022 16:18:35 +0000 (11:18 -0500)]
JumpThreading: Convert tests to -passes

20 months agoJumpThreading: Convert tests to opaque pointers
Matt Arsenault [Sun, 27 Nov 2022 16:12:33 +0000 (11:12 -0500)]
JumpThreading: Convert tests to opaque pointers

phi-known.ll:test2 required deleting one manual check for a bitcast

Also strip trailing whitespace while we're touching everything.

20 months ago[X86] Fix uops counts for SLM extract/extract-store instructions
Simon Pilgrim [Sun, 27 Nov 2022 16:16:36 +0000 (16:16 +0000)]
[X86] Fix uops counts for SLM extract/extract-store instructions

Matches Intel AoM + Agner

20 months agoScalarizer: Fix fragile test of constant pointer
Matt Arsenault [Sun, 27 Nov 2022 15:48:25 +0000 (10:48 -0500)]
Scalarizer: Fix fragile test of constant pointer

It was using a bitcast instruction of a global to test a constant
pointer. After the opaquify script, the test would fold away to
nothing. Add some return uses, and try to test constant base pointers
more meaningfully.

20 months agoCodeGenPrepare: Don't use anonymous values some in tests
Matt Arsenault [Sun, 27 Nov 2022 15:30:37 +0000 (10:30 -0500)]
CodeGenPrepare: Don't use anonymous values some in tests

These are always an obstacle to test updates, and often break after
running opaquify scripts on them.

20 months agoX86: Make test check more precise
Matt Arsenault [Sun, 27 Nov 2022 15:17:38 +0000 (10:17 -0500)]
X86: Make test check more precise

This is really checking an i8*, not an i8.

20 months agoCodeGenPrepare: Don't use undef base pointers in addressing mode test
Matt Arsenault [Sun, 27 Nov 2022 15:15:31 +0000 (10:15 -0500)]
CodeGenPrepare: Don't use undef base pointers in addressing mode test

This broke after the opaquify script.

20 months agoSeparateConstOffsetFromGEP: Switch tests to use -passes
Matt Arsenault [Sun, 27 Nov 2022 14:55:40 +0000 (09:55 -0500)]
SeparateConstOffsetFromGEP: Switch tests to use -passes

20 months agoUtils: Fix assume builder test using old name of null_pointer_is_valid
Matt Arsenault [Sat, 26 Nov 2022 20:56:26 +0000 (15:56 -0500)]
Utils: Fix assume builder test using old name of null_pointer_is_valid

Presumably this hasn't been testing the right thing since the
attribute was moved from a string attribute.

20 months ago[lld/mac] Covert start-lib.s test to use qualified paths instead of `cd %t`
Nico Weber [Sun, 27 Nov 2022 15:00:30 +0000 (10:00 -0500)]
[lld/mac] Covert start-lib.s test to use qualified paths instead of `cd %t`

Makes it easier to paste failing RUN lines to run them manually.
No behavior change.

20 months agoUtils: Don't use anonymous values in test
Matt Arsenault [Sat, 26 Nov 2022 20:49:50 +0000 (15:49 -0500)]
Utils: Don't use anonymous values in test

These interefered with opaque pointer conversion

20 months agoHotColdSplit: Don't use anonymous values in test
Matt Arsenault [Sat, 26 Nov 2022 22:45:32 +0000 (17:45 -0500)]
HotColdSplit: Don't use anonymous values in test

These were interfering with the conversion to opaque pointers

20 months agoSampleProfile: Don't use anonymous values in test
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.

20 months agoIndirectCallPromotion: Fix illegal promotion with 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.

20 months ago[AVR] Remove unused register scavenger
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

20 months ago[AVR] Add $ separator string (like avr-gcc)
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

20 months ago[AVR] Fix broken bitcast for aliases in non-zero address space
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

20 months ago[AArch64] Add GPR rr instructions to isAssociativeAndCommutative
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

20 months ago[Orc][examples] Temporarily re-enable tests for the C API and keep an eye on sanitize...
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

20 months ago[Orc][examples] Emit artifacts in test-specific output folder (NFC)
Stefan Gränitz [Sun, 27 Nov 2022 12:24:03 +0000 (13:24 +0100)]
[Orc][examples] Emit artifacts in test-specific output folder (NFC)

20 months ago[lldb][JITLoaderGDB] Resolve __jit_debug_register_code as eSymbolTypeCode
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

20 months ago[ELF] Simplify ObjFile<ELFT>::parseLazy. NFC
Fangrui Song [Sun, 27 Nov 2022 05:12:30 +0000 (21:12 -0800)]
[ELF] Simplify ObjFile<ELFT>::parseLazy. NFC

20 months ago[lld] Use std::optional in lld.cpp (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

20 months ago[MachO] Use std::optional in InputFiles.cpp (NFC)
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

20 months ago[MachO] Use std::optional in ExportTrie.cpp (NFC)
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

20 months ago[COFF] Use std::optional in PDB.cpp (NFC)
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

20 months ago[COFF] Use std::optional in InputFiles.cpp (NFC)
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

20 months ago[COFF] Use std::optional in Driver.cpp (NFC)
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

20 months ago[SPARC] Add tail call support for 64-bit target
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

20 months ago[ELF] Change most llvm::Optional to std::optional
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

20 months ago[yaml2obj] Use std::optional in yaml2obj.cpp (NFC)
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

20 months ago[obj2yaml] Use std::optional in elf2yaml.cpp (NFC)
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

20 months ago[llvm-readobj] Use std::optional in ELFDumper.cpp (NFC)
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

20 months ago[llvm-profgen] Use std::optional in ProfiledBinary.cpp (NFC)
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

20 months ago[llvm-profdata] Use std::optional in llvm-profdata.cpp (NFC)
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

20 months ago[llvm-objdump] Use std::optional in llvm-objdump.cpp (NFC)
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

20 months ago[llvm-lipo] Use std::optional in llvm-lipo.cpp (NFC)
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

20 months ago[llvm-ifs] Use std::optional in llvm-ifs.cpp (NFC)
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

20 months ago[llvm-dwp] Use std::optional in llvm-dwp.cpp (NFC)
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

20 months ago[llvm-cov] Use std::optional in SourceCoverageViewText.cpp (NFC)
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

20 months ago[llvm-cov] Use std::optional in SourceCoverageViewHTML.cpp (NFC)
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

20 months ago[llvm-cov] Use std::optional in CodeCoverage.cpp (NFC)
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

20 months ago[lli] Use std::optional in lli.cpp (NFC)
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

20 months ago[dsymutil] Use std::optional in DwarfLinkerForBinary.cpp (NFC)
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

20 months ago[Vectorize] Use std::optional in VPlanSLP.cpp (NFC)
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

20 months ago[Vectorize] Use std::optional in SLPVectorizer.cpp (NFC)
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

20 months ago[Utils] Use std::optional in SimplifyCFG.cpp (NFC)
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

20 months ago[Utils] Use std::optional in LoopPeel.cpp (NFC)
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

20 months ago[Utils] Use std::optional in Local.cpp (NFC)
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

20 months ago[Utils] Use std::optional in CloneFunction.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in SimpleLoopUnswitch.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in ScalarizeMaskedMemIntrin.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in PartiallyInlineLibCalls.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in LowerConstantIntrinsics.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in LoopUnrollPass.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in LoopStrengthReduce.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in LoopSimplifyCFG.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in LoopRotation.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in LoopPredication.cpp (NFC)
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

20 months ago[Scalar] Use std::optional in LoopInstSimplify.cpp (NFC)
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

20 months agoRevert "[FileCheck] Use std::optional in FileCheck.cpp (NFC)"
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

20 months ago[LV] Move trunc codegen to buildScalarSteps (NFCI).
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.

20 months ago[LTO] Use std::optional in LTO.cpp (NFC)
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

20 months ago[FileCheck] Use std::optional in FileCheck.cpp (NFC)
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

20 months ago[Orc] Use std::optional in ObjectFileInterface.cpp (NFC)
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

20 months ago[Orc] Use std::optional in MachOPlatform.cpp (NFC)
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

20 months ago[Orc] Use std::optional in ELFNixPlatform.cpp (NFC)
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

20 months ago[Orc] Use std::optional in Core.cpp (NFC)
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

20 months ago[JITLink] Use std::optional in MachOLinkGraphBuilder.cpp (NFC)
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

20 months ago[CodeGen] Use std::optional in TargetPassConfig.cpp (NFC)
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

20 months ago[CodeGen] Use std::optional in ShadowStackGCLowering.cpp (NFC)
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

20 months ago[SelectionDAG] Use std::optional in SelectionDAGISel.cpp (NFC)
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

20 months ago[SelectionDAG] Use std::optional in SelectionDAGBuilder.cpp (NFC)
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

20 months ago[SelectionDAG] Use std::optional in FastISel.cpp (NFC)
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

20 months ago[SelectionDAG] Use std::optional in DAGCombiner.cpp (NFC)
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

20 months ago[CodeGen] Use std::optional in SafeStack.cpp (NFC)
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

20 months ago[CodeGen] Use std::optional in MachineOperand.cpp (NFC)
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

20 months ago[LiveDebugValues] Use std::optional in InstrRefBasedImpl.cpp (NFC)
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

20 months ago[CodeGen] Use std::optional in IndirectBrExpandPass.cpp (NFC)
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

20 months ago[GlobalISel] Use std::optional in Utils.cpp (NFC)
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

20 months ago[VPlan] Move cast codegen to emitTransformedIndex (NFCI).
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.

20 months ago[GlobalISel] Use std::optional in LegalizerHelper.cpp (NFC)
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

20 months ago[GlobalISel] Use std::optional in CombinerHelper.cpp (NFC)
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

20 months ago[CodeGen] Use std::optional in ExpandMemCmp.cpp (NFC)
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

20 months ago[CodeGen] Use std::optional in CodeGenPrepare.cpp (NFC)
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

20 months ago[CodeGen] Use std::optional in BasicBlockSections.cpp (NFC)
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

20 months ago[AsmPrinter] Use std::optional::value_or (NFC)
Kazu Hirata [Sat, 26 Nov 2022 22:21:32 +0000 (14:21 -0800)]
[AsmPrinter] Use std::optional::value_or (NFC)

20 months ago[AsmPrinter] Use std::optional in DwarfCompileUnit.cpp (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

20 months ago[AsmPrinter] Use std::optional in DbgEntityHistoryCalculator.cpp (NFC)
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

20 months ago[AsmPrinter] Use std::optional in AsmPrinter.cpp (NFC)
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

20 months ago[clang] Use std::size (NFC)
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.

20 months ago[llvm] Use std::size (NFC)
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.

20 months agoRevert "[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors...
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.

20 months ago[mlir][sparse][vectorization] optimize reduction chains
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

20 months ago[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors of bytes...
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.