Guillaume Chatelet [Sun, 23 Oct 2022 10:08:44 +0000 (12:08 +0200)]
[libc] Add missing is_unsigned in type_traits.h
John McIver [Sun, 23 Oct 2022 09:53:17 +0000 (09:53 +0000)]
[clang][unittest] Resolve ClangSupportTest link time errors
Resolves undefined references to vtable for clang::ASTConsumer,
PCHContainerOperations::PCHContainerOperations(), and
CodeGenOptions::CodeGenOptions().
Reviewed By: Izaron
Differential Revision: https://reviews.llvm.org/D136546
Simon Pilgrim [Sat, 22 Oct 2022 21:00:29 +0000 (22:00 +0100)]
[X86] Add test coverage for sign_extend_vector_inreg/zero_extend_vector_inreg with freeze
Simon Pilgrim [Sat, 22 Oct 2022 20:33:37 +0000 (21:33 +0100)]
[X86] Add freeze(pshufd/permilps(x,imm)) -> pshufd/permilps(freeze(x),imm) folding
Add X86 isGuaranteedNotToBeUndefOrPoisonForTargetNode / canCreateUndefOrPoisonForTargetNode overrides and add X86ISD::PSHUFD/VPERMILPI handling.
Simon Pilgrim [Sat, 22 Oct 2022 20:21:51 +0000 (21:21 +0100)]
[X86] Add test coverage for permilps with freeze
Its going to be easier to add some basic target shuffle handling than generic ISD::SHUFFLE_VECTOR nodes which is going to need special handling for unused/undef operands.
Both freeze_pshufd and freeze_permilps tests lower to vpermilps, but only in domain switching later on.
Kazu Hirata [Sun, 23 Oct 2022 08:03:56 +0000 (01:03 -0700)]
[mlir] Fix a warning
This patch fixes:
mlir/include/mlir/Tools/mlir-translate/Translation.h:93:35: warning:
extra ‘;’ [-Wpedantic]
Mike Hommey [Sun, 23 Oct 2022 07:49:16 +0000 (09:49 +0200)]
[InstCombine] Bail out of casting calls when a conversion from/to byval is involved.
Fixes #58307
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D135738
Kazu Hirata [Sun, 23 Oct 2022 07:43:17 +0000 (00:43 -0700)]
[ADT] Remove redundant typename (NFC)
Craig Topper [Sun, 23 Oct 2022 05:01:03 +0000 (22:01 -0700)]
[TargetLowering][RISCV][X86] Support even divisors in expandDIVREMByConstant.
If the divisor is even, we can first shift the dividend and divisor
right by the number of trailing zeros. Now the divisor is odd and we
can do the original algorithm to calculate a remainder. Then we shift
that remainder left by the number of trailing zeros and add the bits
that were shifted out of the dividend.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D135541
Craig Topper [Sun, 23 Oct 2022 05:50:43 +0000 (22:50 -0700)]
Revert "[DAGCombiner] Fold (mul (sra X, BW-1), Y) -> (neg (and (sra X, BW-1), Y))"
This reverts commit
e8b3ffa532b8ebac5dcdf17bb91b47817382c14d.
The AMDGPU/mad_64_32.ll seems to fail on some of the build bots but
passes locally. I'm really confused.
Craig Topper [Sun, 23 Oct 2022 05:28:57 +0000 (22:28 -0700)]
[RISCV] Fix unused variable warning. NFC
Craig Topper [Sun, 23 Oct 2022 04:35:38 +0000 (21:35 -0700)]
[DAGCombiner] Fold (mul (sra X, BW-1), Y) -> (neg (and (sra X, BW-1), Y))
(sra X, BW-1) is either 0 or -1. So the multiply is a conditional
negate of Y.
This pattern shows up when type legalizing wide multiplies involving
a sign extended value.
Fixes PR57549.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D133399
Yuanfang Chen [Sun, 23 Oct 2022 03:17:06 +0000 (20:17 -0700)]
[Clang] fold expression is considered atomic during constraints normalization
`|| fold` is not disjunction; `&& fold` is not conjunction. Both are atomic per
current wording. See http://cplusplus.github.io/concepts-ts/ts-active.html#28.
D128750 accidentally tried to partially addresss this which is not desirable.
This patch reverts that part and associated test cases.
Craig Topper [Sun, 23 Oct 2022 01:54:48 +0000 (18:54 -0700)]
[DAGCombiner][RISCV] Make foldBinOpIntoSelect work correctly with opaque constants.
The CanFoldNonConst doesn't work correctly with opaque constants
because getNode won't constant fold constants if one is opaque. Even
if the operation is AND/OR. This can lead to infinite loops.
This patch does the folding manually in the DAGCombine. Alternatively,
we could improve getNode but that seemed likely to have bigger impact
and possibly increase compile time for the additional checks. We wouldn't
want to directly constant fold because we need to preserve the opaque flag.
Fixes PR58511.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D136472
Craig Topper [Sun, 23 Oct 2022 01:38:13 +0000 (18:38 -0700)]
[SelectionDAG] Update stale comment on isOneOrOneSplat. NFC
Nirvedh Meshram [Fri, 21 Oct 2022 00:32:17 +0000 (17:32 -0700)]
[mlir][spirv] Add conversion from GPU WMMA ops to SPIRV Cooperative matrix
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D136521
Krzysztof Parzyszek [Wed, 12 Oct 2022 15:09:25 +0000 (08:09 -0700)]
[Hexagon] Improve handling of 32-bit mulh/mul_lohi on HVX
Handle MULH[US] by normalizing them into newly invented nodes
HexagonISD::(S|U|US)MUL_LOHI. On HVX v60, if only the high part of
SMUL_LOHI is used, use the original MULHS expansion. In all other
cases, expand the full product.
On HVX v62, always expand the full product.
Introduce Hexagon-specific LLVM IR intrinsics for 32x32 multiplication
returning low/high parts.
Krzysztof Parzyszek [Sat, 22 Oct 2022 22:05:38 +0000 (15:05 -0700)]
[Hexagon] Use helper function introduced in prior commit, NFC
Craig Topper [Sat, 22 Oct 2022 21:25:17 +0000 (14:25 -0700)]
[RISCV] Make sure we always call tryShrinkShlLogicImm for ISD:AND during isel.
There was an early out that prevented us from calling this for
(and (sext_inreg (shl X, C1), i32), C2).
Tomás Longeri [Sat, 22 Oct 2022 21:17:49 +0000 (14:17 -0700)]
Fix #58322: Handlers for debug actions with equal parameter types must not override each other
Also clean up redundant public access specifiers.
Reviewed By: mehdi_amini, rriddle
Differential Revision: https://reviews.llvm.org/D135924
Guillaume Chatelet [Wed, 19 Oct 2022 21:40:40 +0000 (21:40 +0000)]
[libc] Add cpp::byte
This provides the equivalent of std::byte.
std::byte is a distinct type that implements the concept of byte as specified in the C++ language definition.
https://en.cppreference.com/w/cpp/types/byte
Differential Revision: https://reviews.llvm.org/D136294
Christopher Bate [Sun, 16 Oct 2022 19:57:18 +0000 (13:57 -0600)]
[mlir][tensor] ExtractSliceFromReshape: handle collapsing of unit dim edge cases
Prior to this change, the "ExtractSliceFromReshape" pattern would transform
```
%collapsed = tensor.collapse_shape %input [[0, 1], [2]]
: tensor<1x11x100xf32> into tensor<11x100xf32>
%slice = tensor.extract_slice %collapsed [%offt, 0] [%size, 100] [1, 1]
: tensor<11x100xf32> to tensor<?x100xf32>
```
into a loop that iterated over the range `%size - %offt`, that pieces
together multiple sub-slices of `%input` along the first dimension. This
is correct but obviously inefficient. The technical condition is that
collapsing at-most-one non-unit dimension of `%src` will not result in a
subsequent slice along the corresponding dimension of `%collapsed`
mapping across discontinuities in the index space of `%src`. Thus, the
definition of a "linearized dimension" (from the perspective of
`tensor.collapse_shape`) is updated to reflect this condition.
The transform will now generate
```
%slice = tensor.extract_slice %input [0, %offt, 0][1, %size, 100] [1, 1]
: tensor<1x11x100xf32> to tensor<1x?x100xf32>
%result = tensor.collapse_shape [[0, 1], [2]]
: tensor<1x?x100xf32> to tensor<?x100xf32>
```
which can be further canonicalized.
Additional tests are added to check this family of edge cases.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D135726
Simon Pilgrim [Sat, 22 Oct 2022 19:14:56 +0000 (20:14 +0100)]
[DAG] visitFREEZE - pull out Operands array. NFCI.
Initial tidyup and it will make it easier to adjust additional Operands in a future patch.
Simon Pilgrim [Sat, 22 Oct 2022 19:12:32 +0000 (20:12 +0100)]
[X86] Add test coverage for shuffle with freeze
Ivan Butygin [Sat, 22 Oct 2022 17:39:18 +0000 (19:39 +0200)]
[mlir][nfc] Fully spell mlir typename in generated code.
Differential Revision: https://reviews.llvm.org/D136534
Simon Pilgrim [Sat, 22 Oct 2022 17:39:52 +0000 (18:39 +0100)]
[DAG] canCreateUndefOrPoison - add freeze(fsh(x,y,z)) -> fsh(freeze(x),freeze(y),freeze(z)) support
The funnel-shift amount is always modulo, so won't introduce poison/undef
Simon Pilgrim [Sat, 22 Oct 2022 17:09:22 +0000 (18:09 +0100)]
[X86] Add test coverage for fshl/fshr with freeze
Unlike most other freeze tests in the file, this is showing a missing SimplifyDemandedBits simplification instead of a merge of the ops
Kazu Hirata [Sat, 22 Oct 2022 16:29:40 +0000 (09:29 -0700)]
Ensure newlines at the end of files (NFC)
Peter Klausler [Sat, 22 Oct 2022 16:28:15 +0000 (09:28 -0700)]
[flang] Disable test until it can be properly configured
Simon Pilgrim [Sat, 22 Oct 2022 16:11:53 +0000 (17:11 +0100)]
[DAG] canCreateUndefOrPoison - add freeze(rot(x,y)) -> rot(freeze(x),freeze(y)) support
The rotation amount is always modulo, so won't introduce poison/undef
Kazu Hirata [Sat, 22 Oct 2022 15:57:37 +0000 (08:57 -0700)]
[llvm] Use llvm::is_contained (NFC)
Simon Pilgrim [Sat, 22 Oct 2022 15:44:41 +0000 (16:44 +0100)]
[X86] Add test coverage for rotl/rotr with freeze
Peixin Qiao [Sat, 22 Oct 2022 15:19:02 +0000 (23:19 +0800)]
Revert "[flang] Fix one Unexpectedly Passed test on X86"
This reverts commit
c1bf4c3c5d8bac68e738d93c7dc28d9326410728.
Qiongsi Wu [Sat, 22 Oct 2022 15:01:42 +0000 (11:01 -0400)]
[clang][LTO][NFC] Adding More Tests for AIX Options
This patch adds more tests for AIX. It follows https://reviews.llvm.org/D134820 which added a minimal set of tests for the newly added AIX options. These new tests were originally created by https://reviews.llvm.org/D119109. Since we do not plan to land https://reviews.llvm.org/D119109 in its current shape to add the AIX specific options, we incorporate the relevant tests developed.
Reviewed By: w2yehia
Differential Revision: https://reviews.llvm.org/D135885
Phoebe Wang [Sat, 22 Oct 2022 15:05:15 +0000 (23:05 +0800)]
[X86] Fix a missing `-` from AMX-FP16 feature string
Fixes #58545
Sanjay Patel [Sat, 22 Oct 2022 14:12:34 +0000 (10:12 -0400)]
[InstCombine] use freeze to enable poison-safe logic->select fold
Without a freeze, this transform can leak poison to the output:
https://alive2.llvm.org/ce/z/GJuF9i
This makes the transform as uniform as possible, and it can help
reduce patterns like issue #58313 (although that particular
example probably still needs another transform).
Differential Revision: https://reviews.llvm.org/D136527
Sanjay Patel [Sat, 22 Oct 2022 13:07:21 +0000 (09:07 -0400)]
[InstCombine] add test for logical-ands to select; NFC
Jez Ng [Sat, 22 Oct 2022 14:41:10 +0000 (10:41 -0400)]
[lld-macho][nfc] Use llvm::enumerate + destructuring in more places
I love C++17!
chromium_framework_less_dwarf on my 16-core Mac Pro shows no stat sig change in wall time but a slight decrease in user time:
```
base diff difference (95% CI)
sys_time 1.759 ± 0.037 1.761 ± 0.033 [ -0.9% .. +1.1%]
user_time 4.920 ± 0.043 4.886 ± 0.051 [ -1.2% .. -0.2%]
wall_time 5.950 ± 0.117 5.900 ± 0.116 [ -1.8% .. +0.2%]
samples 26 37
```
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D136518
Paweł Bylica [Sat, 22 Oct 2022 13:53:34 +0000 (13:53 +0000)]
[InstCombine][test] Add tests for mul combinations
Tests taken from https://reviews.llvm.org/D56214 and ported to
InstCombine for https://reviews.llvm.org/D136015.
DianQK [Sat, 22 Oct 2022 12:39:21 +0000 (20:39 +0800)]
[DebugInfo] Fix potential CU mismatch for attachRangesOrLowHighPC
When a CU attaches some ranges for a subprogram or an inlined code, the CU should be that of the subprogram/inlined code that was emitted.
If not, then these emitted ranges will use the incorrect base of the CU in `emitRangeList`.
A reproducible example is:
When linking these two LLVM IRs, dsymutil will report no mapping for range or inconsistent range data warnings.
`foo.swift`
```swift
import AppKit.NSLayoutConstraint
public class Foo {
public var c: Int {
get {
Int(NSLayoutConstraint().constant)
}
set {
}
}
}
```
`main.swift`
```swift
// no mapping for range
let f: Foo! = nil
// inconsistent range data
//let l: Foo = Foo()
```
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D136039
Thomas Symalla [Sat, 22 Oct 2022 13:13:56 +0000 (15:13 +0200)]
[NFC] Fixed several misspellings of "Splitter" in Scalarizer
Spliiter => Splitter
Sanjay Patel [Sat, 22 Oct 2022 11:55:19 +0000 (07:55 -0400)]
[InstCombine] allow more matches for logical-ands --> select
This allows patterns with real 'and' instructions because
those are safe to transform:
https://alive2.llvm.org/ce/z/7-U_Ak
Jay Foad [Sat, 22 Oct 2022 11:17:09 +0000 (12:17 +0100)]
Revert "[MachineVerifier] Try harder to verify LiveVariables"
This reverts commit
d4650d0938e290ca9d6544d6b07da2fb7156762d.
Reverted because it causes several X86 CodeGen test failures in a build
with LLVM_ENABLE_EXPENSIVE_CHECKS=ON.
Michael Buch [Sat, 22 Oct 2022 11:14:28 +0000 (12:14 +0100)]
[lldb][Test] Add C-array test-cases to CPlusPlusNameParser unit-tests
Make sure we test the code path where we parse
function templates instantiated with C-arrays.
Peixin Qiao [Sat, 22 Oct 2022 10:57:05 +0000 (18:57 +0800)]
[flang] Fix one Unexpectedly Passed test on X86
The test case, kinds04_q10.f90, should run only for X86. Now it is
unexpected passed since
8686ff1d0d47ba8c980f5ea6bb53f77786478e23.
Add "-triple x86_64-unknown-linux-gnu" so that the test is for
testing the target X86 linux.
Simon Pilgrim [Sat, 22 Oct 2022 10:35:37 +0000 (11:35 +0100)]
[X86] Add v2i64/v8i16/v16i8 + AVX2 coverage to saturated shift tests
To help better test the effects of D136478
Timm Bäder [Thu, 13 Oct 2022 15:17:44 +0000 (17:17 +0200)]
[clang][Interp][NFC] Unify Call() implementations
The type parameter we used to pass to call() was unused. Use the same
implementation for void and value-returning function calls.
Timm Bäder [Fri, 7 Oct 2022 13:49:37 +0000 (15:49 +0200)]
[clang][Interp] Check instance pointers before calling functions on them
Remove the double Call() implementation to reduce code duplication. Then
fix Function::getSource() so we can diagnose instance pointers being
null.
Differential Revision: https://reviews.llvm.org/D135513
Timm Bäder [Tue, 11 Oct 2022 07:06:04 +0000 (09:06 +0200)]
[clang][Interp][NFC] Simplify creating parameter descriptors
... using value_or instead of the if-else statement.
Timm Bäder [Tue, 11 Oct 2022 05:02:05 +0000 (07:02 +0200)]
[clang][Interp][NFC] Add another failing test case
Function parameters need to be checked before the function is called.
Timm Bäder [Mon, 10 Oct 2022 14:04:24 +0000 (16:04 +0200)]
[clang][Interp][NFC] Trim InterpFrame includes
Timm Bäder [Sat, 22 Oct 2022 08:31:11 +0000 (10:31 +0200)]
[clang][Interp] Add a missing static_assert message
This broke a builder:
https://lab.llvm.org/buildbot/#builders/139/builds/29923
Timm Bäder [Mon, 10 Oct 2022 11:18:12 +0000 (13:18 +0200)]
[clang][Interp][NFC] Add assertions to VM entry points
Assert that the previous call left the stack empty, as well as that
successful interpretations leave an empty stack.
Timm Bäder [Fri, 7 Oct 2022 12:00:00 +0000 (14:00 +0200)]
[clang][Interp][NFC] Add two more array tests
Timm Bäder [Fri, 7 Oct 2022 08:38:33 +0000 (10:38 +0200)]
[clang][Interp][NFC] Unify Div/Rem operation checks
Christian Kandeler [Sat, 22 Oct 2022 08:15:40 +0000 (10:15 +0200)]
[clangd] Make file limit for textDocument/rename configurable
Without this, clients are unable to rename often-used symbols in larger
projects.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D136454
serge-sans-paille [Fri, 21 Oct 2022 18:49:52 +0000 (20:49 +0200)]
Avoid repeated checks and context lookup in llvm::Instruction::getAAMetadata
Repeated call to Instruction::hasMetadata() and lookup in
getContext().pImpl->ValueMetadata are not needed when we always work on
the same instruction, avoid them.
This simple change leads to interesting and consistent speedups in
compile time, around -0.5% according to http://llvm-compile-time-tracker.com, see
http://llvm-compile-time-tracker.com/compare.php?from=
9708d88017d0c9adaea65a4f5a5b589b67f292e2&to=
88482b9addd5917e9c5226847efeb5451c5f78c0&stat=instructions
Differential Revision: https://reviews.llvm.org/D136503
Lang Hames [Sat, 22 Oct 2022 04:31:32 +0000 (04:31 +0000)]
[ORC] Add more information to duplicate section error message.
Now includes the name of the graph and duplicate section.
Siva Chandra Reddy [Fri, 21 Oct 2022 06:46:31 +0000 (06:46 +0000)]
[libc] Add implementation of fgetc.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D136421
Siva Chandra Reddy [Thu, 20 Oct 2022 23:44:13 +0000 (23:44 +0000)]
[libc] Add stdin definition.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D136398
Siva Chandra Reddy [Wed, 19 Oct 2022 23:55:15 +0000 (23:55 +0000)]
[libc] Add select.h and the implementation of the select function for Linux.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D136375
Aart Bik [Sat, 22 Oct 2022 02:50:22 +0000 (19:50 -0700)]
bazel fix for TranslateLib
Reviewed By: cota
Differential Revision: https://reviews.llvm.org/D136519
Jez Ng [Sat, 22 Oct 2022 02:48:25 +0000 (22:48 -0400)]
[lld-macho] Map file should map symbols to their original bitcode file
... instead of mapping them to the intermediate object file.
This matches ld64.
Reviewed By: #lld-macho, Roger
Differential Revision: https://reviews.llvm.org/D136380
Jez Ng [Sat, 22 Oct 2022 02:39:57 +0000 (22:39 -0400)]
[lld-macho][nfc] Update map file sample output in comment
Include symbol sizes (present after {D135883}) as well as an example of
a dead-stripped symbol.
Weining Lu [Sat, 22 Oct 2022 01:50:25 +0000 (09:50 +0800)]
[NFC][LoongArch] Polish the test for fixup diagnostics
Mircea Trofin [Sat, 22 Oct 2022 01:49:29 +0000 (18:49 -0700)]
[mlgo] Make regalloc extra features logging test more robust
One of the first few instructions being probed has an opcode that's more
likely to change with work on X86 target, so just regexp-ing it.
Peixin Qiao [Sat, 22 Oct 2022 01:15:02 +0000 (09:15 +0800)]
[flang] Fix the interface for numerical/logical scalar with VALUE attribute
Programmers may use procedure without BIND(C) attribute to interoperate
with C code. For numerical/logical scalar with VALUE attribute, pass the
argument by value so that the behavior is consistent with gfortran or
nvfortran. The argument with the OPTIONAL attribute cannot be passed by
value since the actual argument may be absent.
For the derived type, pass-by-value is not supported yet, so pass the
argument by reference for now.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D136260
Alexander Shaposhnikov [Sat, 22 Oct 2022 00:42:50 +0000 (00:42 +0000)]
[clang-tidy] Avoid adding unnecessary semicolon in modernize-use-equals-default
Adjust the automatic fixit to avoid adding superfluous semicolon.
Test plan: ninja check-all
Differential revision: https://reviews.llvm.org/D136399
LLVM GN Syncbot [Sat, 22 Oct 2022 00:22:59 +0000 (00:22 +0000)]
[gn build] Port
661881d43633
Nico Weber [Sat, 22 Oct 2022 00:22:38 +0000 (20:22 -0400)]
[gn build] port
27d8eedd5a3c (ClangSupportTests)
Peter Klausler [Fri, 21 Oct 2022 23:55:00 +0000 (16:55 -0700)]
[flang] Disable test due to unexpected warnings
Now that Fortran warnings are tested, one test is failing unexpectedly on
aarch64 even though it should run only for x86. Disabling it for now
with "XFAIL: *" to get build bot back up until the test's configuration
can be properly corrected.
Xiang1 Zhang [Fri, 21 Oct 2022 22:24:47 +0000 (06:24 +0800)]
[X86] Add AMX-FP16 instructions.
Differential Revision: https://reviews.llvm.org/D135941
bixia1 [Fri, 21 Oct 2022 23:58:30 +0000 (16:58 -0700)]
Add missing dependency to fix build.bazel.
Reviewed By: Peiming, aartbik
Differential Revision: https://reviews.llvm.org/D136516
Hanhan Wang [Fri, 21 Oct 2022 23:51:11 +0000 (16:51 -0700)]
[mlir] Delete dup code and use unified methods.
The foldMemRefCast method is defined in memref namespace; the
foldTensorCast method is defined in tensor namespace. This revision
deletes the dup code and use the unified methods.
Reviewed By: dcaballe
Differential Revision: https://reviews.llvm.org/D136379
Evgeny Shulgin [Sat, 15 Oct 2022 17:11:40 +0000 (17:11 +0000)]
[clang] Add time profile for constant evaluation
Add time profiler for various constexpr evaluation events
so that slow event could be visible on the visualized flame chart.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D136022
Aart Bik [Wed, 19 Oct 2022 19:44:53 +0000 (12:44 -0700)]
[mlir][sparse] use straightline and loop to insert into tensor
This exposed a missing type conversion for codegen
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D136286
bixia1 [Fri, 21 Oct 2022 19:23:46 +0000 (12:23 -0700)]
Fix build.bazel files for adding Index dialect and LLVMTypes.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D136481
Peter Klausler [Fri, 21 Oct 2022 22:42:28 +0000 (15:42 -0700)]
[flang] Mark test UNSUPPORTED on Windows
A recent upgrade to test_errors.py enabled verification of
warning messages. One test had warning messages that depend
on *not* being run in Windows, and it now fails. Add an
!UNSUPPORTED: system-windows line to it.
River Riddle [Fri, 21 Oct 2022 00:26:55 +0000 (17:26 -0700)]
[mlir:LLVM][NFC] Cleanup attribute/enum definitions
Enum definitions are currently spread throughout the op definitions
file, making it difficult to reason about both where they are, and
where to add new ones when necessary. The attribute definitions are
in a similarish case, where while they have a dedicated .td file, there
definitions/declarations are generated in the main LLVMDialect source
files. This makes it difficult to reason about how to cleanly add new
attributes/enums.
This commit adds a dedicated LLVMEnums.td file for enum definitions,
cleans up the AttrDefs.td file, and adds a new LLVMAttrs.cpp/.h file to
home enum/attr definitions moving forward. This makes it much cleaner to
add new attributes/enums to the LLVM dialect.
Differential Revision: https://reviews.llvm.org/D136409
River Riddle [Thu, 20 Oct 2022 23:39:25 +0000 (16:39 -0700)]
[mlir] Implement the SubElement interfaces for the builtin locations
This enables find/replace of nested components for location attributes.
Differential Revision: https://reviews.llvm.org/D136408
River Riddle [Thu, 20 Oct 2022 23:31:01 +0000 (16:31 -0700)]
[mlir] Generate parser/printers for enums
This greatly simplifies composing enums in attribute/type printers,
which currently reimplement these functions as needed.
Differential Revision: https://reviews.llvm.org/D136407
Chia-hung Duan [Fri, 21 Oct 2022 22:03:40 +0000 (22:03 +0000)]
Revert "Revert "[scudo] Support partial page releasing""
This reverts commit
1cf1b36112b3d475d443909881b02799b548e6b8.
Reviewed By: cferris
Differential Revision: https://reviews.llvm.org/D136027
wren romano [Fri, 21 Oct 2022 21:43:27 +0000 (14:43 -0700)]
[mlir][sparse] Refining the IR/CMakeLists.txt (followup to D136477)
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D136506
Jeff Niu [Fri, 21 Oct 2022 22:00:20 +0000 (15:00 -0700)]
[mlir][llvm] Allow literal structs to replaceImmediateSubElements
SubElementInterfaces forbids all mutable types and attributes from
implementing `replaceImmediateSubElements`. However, this prohibits
literal structs, which are immutable, from implementing that function.
This patch defers the decision on whether to support
`replaceImmediateSubElements` to the individual types/attributes.
Depends on D136505
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136507
Jeff Niu [Fri, 21 Oct 2022 21:54:57 +0000 (14:54 -0700)]
[mlir][llvm] More LLVMFixed/ScalableVectorType to TypeDef
This keeps the current parser, however, since the mnemonic `vec` is
overloaded for both of these types.
Depends on D136499
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136505
Jeff Niu [Fri, 21 Oct 2022 21:08:10 +0000 (14:08 -0700)]
[mlir][llvm] Fix replaceImmediateSubElements on LLVMPointerType
This method was assearting on opaque pointers because the element is
null.
Depends on D136498
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136499
Jeff Niu [Fri, 21 Oct 2022 20:16:25 +0000 (13:16 -0700)]
[mlir][llvm] Move LLVMPointerType to TypeDef
Depends on D136485
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136498
Jeff Niu [Fri, 21 Oct 2022 18:08:41 +0000 (11:08 -0700)]
[mlir][llvm] Move LLVMFunctionType to a TypeDef
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136485
Murali Vijayaraghavan [Fri, 21 Oct 2022 21:09:13 +0000 (21:09 +0000)]
Fixed CMakeLists.txt to export mlir/include/mlir/Dialenct/SparseTensor/IR/Enums.h correctly for installing MLIRSparseTensorEnums as a library in other projects using MLIR
Differential Revision: https://reviews.llvm.org/D136477
Peiming Liu [Thu, 20 Oct 2022 03:48:55 +0000 (03:48 +0000)]
[mlir][scf] support 1:N type conversion for scf.for.
scf.for used to only support 1:1 type conversion, this patch add support for 1:N type conversion.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D136314
Arthur Eubanks [Sun, 2 Oct 2022 20:20:21 +0000 (13:20 -0700)]
[ObjCARC] Remove legacy PM versions of optimization passes
This doesn't touch objc-arc-contract because that's in the codegen pipeline.
However, this does move its corresponding initialize function into initializeCodegen().
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D135041
Jeff Niu [Fri, 21 Oct 2022 20:13:07 +0000 (13:13 -0700)]
[mlir][sparse] Fix build warning (NFC)
Chia-hung Duan [Mon, 17 Oct 2022 20:38:37 +0000 (20:38 +0000)]
Reland "[scudo] Manage free blocks in BatchGroup."
This is not a pure revert of
c929bcb7d85700494217f3a2148549f8757e0eed.
It also includes a bug fix.
Differential Revision: https://reviews.llvm.org/D136029
Jeff Niu [Fri, 21 Oct 2022 17:56:43 +0000 (10:56 -0700)]
[mlir][llvm] Move LLVMArrayType to a TypeDef
This moves the `LLVMArrayType` to a `TypeDef`. The main side-effect of
this change is that the syntax `array<4xi32>` is no longer allowed. It
was previously parsed and then printed as `array<4 x i32>`. Now the
syntax must be the latter.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136473
rkayaith [Wed, 28 Sep 2022 01:31:16 +0000 (21:31 -0400)]
[mlir-translate] Support parsing operations other than 'builtin.module' as top-level
This adds a '--no-implicit-module' option, which disables the insertion
of a top-level 'builtin.module' during parsing.
The translation APIs are also updated to take/return 'Operation*'
instead of 'ModuleOp', to allow other operation types to be used. To
simplify translations which are restricted to specific operation types,
'TranslateFromMLIRRegistration' has an overload which performs the
necessary cast and error checking.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D134237
rkayaith [Fri, 21 Oct 2022 18:37:42 +0000 (14:37 -0400)]
[mlir] Add conversion function from OwningOpRef<T> to OwningOpRef<Operation *>
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D136480
Petr Hosek [Fri, 21 Oct 2022 19:49:19 +0000 (19:49 +0000)]
Revert "[CMake] Drop libLTO and switch to PIE for Fuchsia toolchain"
This reverts commit
8d89dbceeb576171efd12a5657c038a2ec2e54a5 since
this broke the compiler-rt build.
Peter Klausler [Fri, 21 Oct 2022 18:22:49 +0000 (11:22 -0700)]
[flang] Extend test_errors.py to test warnings and explanatory messages
flang/test/Semantics/test_errors,py only compares actual error messages
with expected error messages. Many tests have expected warning messages
in them, but they are not checked.
A forthcoming change adds several new warning and explanatory messages
to the compiler, and these messages must be testable.
So (re-?) enable non-error message checking in test_errors.py and adjust some
existing tests to get them to pass.
Warning messages related to host-specific folding conditions will not
be emitted on all platforms, so they will continue to be ignored.
Differential Revision: https://reviews.llvm.org/D136479
Siva Chandra Reddy [Fri, 21 Oct 2022 19:42:24 +0000 (19:42 +0000)]
[bazel][obvious] Add few missing deps in the libc overlay.
bixia1 [Fri, 21 Oct 2022 16:10:35 +0000 (09:10 -0700)]
[mlir][sparse] Add rewrite rule for the sparse_tensor.out operator.
Also fix the rewrite rule for sparse_tensor.new to reflect the recent change of
the runtime C interface and to use utilities for memref.alloca.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D135891