Roman Lebedev
3c4d2a0396
[SROA] `isVectorPromotionViable()`: memory intrinsics operate on vectors of bytes (take 2)
...
This is a recommit of cf624b23bc
,
which was reverted in 5cfc22cafe
,
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 .
2022-11-26 23:19:15 +03:00
Kazu Hirata
a677afd3c1
[TableGen] Use std::size (NFC)
...
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
2022-11-26 10:47:22 -08:00
Manuel Klimek
49aca00d63
[NFC] Remove peekNextToken(int).
...
Arbitrary lookahead restricts the implementation of our TokenSource,
specifically getting in the way of changes to handle macros better.
Instead, use getNextToken to parse lookahead linearly, and
getPosition/setPosition to unwind our lookahead.
2022-11-26 18:23:42 +00:00
Matthias Springer
13593dc9dc
[mlir][tensor][bufferize] Fix tensor.insert_slice regression
...
This reverts D132662 (apart from overall cleanups), which introduced a too aggressive optimization for tensor.insert_slice bufferization. Instead, bufferizesToMemoryRead is improved to handle some of these cases. The remaining cases can still bufferize efficiently when running the canonicalizer before the bufferization.
Differential Revision: https://reviews.llvm.org/D138745
2022-11-26 19:14:33 +01:00
Kazu Hirata
a737146c92
[ObjectYAML] Use std::size (NFC)
...
std::size, introduced in C++17, allows us to directly obtain the
number of elements of an array.
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-26 09:53:22 -08:00
Roman Lebedev
453f27bc9e
[AArch64] `LowerBUILD_VECTOR()`: `NormalizeBuildVector()` might return non-BUILD_VECTOR
...
As apparent in the newly-added test, provided in:
cf624b23bc (commitcomment-90836329)
,
we should be more careful with handling wider vectors,
or we will assert later on.
2022-11-26 18:46:36 +03:00
Alexandre Ganea
4c1079c551
[CodeGen] Add missing copy assignment operator
...
When building on Windows with clang-cl ToT, before this patch I was seeing:
```
[2690/5505] Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMISelLowering.cpp.obj
In file included from D:/git/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp:14:
In file included from D:/git/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.h:23:
D:/git/llvm-project/llvm/include\llvm/CodeGen/SelectionDAGNodes.h(760,5): warning: definition of implicit copy assignment operator for 'use_iterator' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
use_iterator(const use_iterator &I) = default;
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xutility(1015,13): note: in implicit copy assignment operator for 'llvm::SDNode::use_iterator' first required here
_It = _STD forward<_UIter>(_UIt);
^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\xutility(5604,5): note: in instantiation of function template specialization 'std::_Seek_wrapped<llvm::SDNode::use_iterator, llvm::SDNode::use_iterator &>' requested here
_Seek_wrapped(_First, _UFirst);
^
D:/git/llvm-project/llvm/include\llvm/ADT/STLExtras.h(1737,15): note: in instantiation of function template specialization 'std::find_if<llvm::SDNode::use_iterator, (lambda at D:/git/llvm-project/llvm/lib/Target/ARM/ARMISelLowering.cpp:15310:39)>' requested here
return std::find_if(adl_begin(Range), adl_end(Range), P);
^
1 warning generated.
```
Differential Revision: https://reviews.llvm.org/D138715
2022-11-26 10:41:08 -05:00
Krzysztof Parzyszek
502c246519
[LLDB] Change getValue to value in NativeRegisterContextFreeBSD_x86_64.cpp
...
Optional::getValue has been removed.
2022-11-26 08:38:54 -06:00
Alexandre Ganea
f1aa7348d3
[Support] Apply clang-format on .inc files. NFC.
...
Apply clang-format on llvm/lib/Support/Windows/ and llvm/lib/Support/Unix/ since .inc files in these folders aren't picked up by default. Eventually we need to add this extension in the monorepo .clang-format file.
Differential Revision: https://reviews.llvm.org/D138714
2022-11-26 09:36:43 -05:00
chenglin.bi
b400dde473
[InstSimplify] Use dominate condtion to simplify instructions
...
Fix #56795
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D138542
2022-11-26 21:41:41 +08:00
wanglei
5c1e14885f
[JITLink] Fix typo in comment. NFC
2022-11-26 20:55:49 +08:00
Kazu Hirata
bba55813fc
[Scalar] Use std::optional in LoopFlatten.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-26 00:02:40 -08:00
Kazu Hirata
7fc772bbdc
[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
2022-11-25 23:59:45 -08:00
Kazu Hirata
b54cd3f09c
[Scalar] Use std::optional in GVN.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:55:44 -08:00
Kazu Hirata
edace862f6
[Scalar] Use std::optional in CorrelatedValuePropagation.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:52:49 -08:00
Kazu Hirata
3da96e0361
[InstCombine] Use std::optional in InstructionCombining.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:49:50 -08:00
Kazu Hirata
881076cde2
[InstCombine] Use std::optional in InstCombinePHI.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:46:38 -08:00
Kazu Hirata
c7fa15c0f2
[IPO] Use std::optional in IROutliner.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:44:08 -08:00
Kazu Hirata
a5f8a36d02
[IPO] Use std::optional in GlobalOpt.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:38:32 -08:00
Kazu Hirata
ffba7ee778
[IPO] Use std::optional in Attributor.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:35:05 -08:00
Kazu Hirata
629819cb66
[IPO] Use std::optional in AttributorAttributes.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:23:40 -08:00
Kazu Hirata
8dd2416e44
[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
2022-11-25 23:18:17 -08:00
Kazu Hirata
d7fdb5d87b
[Coroutines] Use std::optional in CoroElide.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:15:51 -08:00
Kazu Hirata
3583f4ff4b
[X86] Use std::optional in X86SpeculativeLoadHardening.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:13:23 -08:00
Kazu Hirata
1493130901
[RISCV] Use std::optional in RISCVMergeBaseOffset.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:08:26 -08:00
Kazu Hirata
2f61c6c639
[RISCV] Use std::optional in RISCVISelLowering.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:04:58 -08:00
Kazu Hirata
362ca6cbef
[RISCV] Use std::optional in RISCVISelDAGToDAG.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 23:02:26 -08:00
Kazu Hirata
7e00820686
[RISCV] Use std::optional in RISCVGatherScatterLowering.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:59:57 -08:00
Kazu Hirata
c672bb674c
[PowerPC] Use std::optional in PPCMacroFusion.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:57:25 -08:00
Kazu Hirata
da4dd0aaf3
[NVPTX] Use std::optional in NVPTXTargetTransformInfo.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:54:42 -08:00
Kazu Hirata
704b4f3533
[AsmParser] Use std::optional in LanaiAsmParser.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:52:18 -08:00
Kazu Hirata
9d7faffa10
[Hexagon] Use std::optional in HexagonFrameLowering.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:49:13 -08:00
Kazu Hirata
ac7af9a0b8
[ARM] Use std::optional in ARMISelDAGToDAG.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:45:26 -08:00
Kazu Hirata
aad2d272bf
[Utils] Use std::optional in AMDGPUBaseInfo.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:43:00 -08:00
Kazu Hirata
09e0aeaaaa
[AMDGPU] Use std::optional in SIPeepholeSDWA.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:40:00 -08:00
Kazu Hirata
96cb34ab5a
[AsmParser] Use std::optional in AMDGPUAsmParser.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:36:37 -08:00
Kazu Hirata
ebe3281793
[AMDGPU] Use std::optional in AMDGPUReleaseVGPRs.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:30:26 -08:00
Kazu Hirata
959c9cc7ac
[AMDGPU] Use std::optional in AMDGPUInstructionSelector.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:23:09 -08:00
Kazu Hirata
f0105ee968
[GISel] Use std::optional in AArch64PostLegalizerLowering.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:20:07 -08:00
Kazu Hirata
5c99c2e16b
[GISel] Use std::optional in AArch64InstructionSelector.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:17:26 -08:00
Kazu Hirata
fc07a54ef6
[AsmParser] Use std::optional in AArch64AsmParser.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:14:44 -08:00
Kazu Hirata
185f647bb6
[AArch64] Use std::optional in AArch64LowerHomogeneousPrologEpilog.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:11:32 -08:00
Kazu Hirata
298cb551fb
[AArch64] Use std::optional in AArch64LoadStoreOptimizer.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:08:30 -08:00
Kazu Hirata
23ca55231a
[AArch64] Use std::optional in AArch64ISelLowering.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 22:06:01 -08:00
Kazu Hirata
4f7e5930ab
[AArch64] Use std::optional in AArch64FrameLowering.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 21:57:21 -08:00
Kazu Hirata
0af53df883
[Support] Use std::optional in VirtualFileSystem.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 21:53:00 -08:00
Kazu Hirata
7c421b53d1
[Support] Use std::optional in RISCVISAInfo.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 21:48:18 -08:00
Kazu Hirata
7aab8054e5
[Support] Use std::optional in JSON.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 21:45:47 -08:00
Kazu Hirata
1a20dade4d
[Support] Use std::optional in FormatVariadic.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 21:25:27 -08:00
Kazu Hirata
11b75f952c
[Support] Use std::optional in ARMAttributeParser.cpp (NFC)
...
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25 21:22:19 -08:00