Peter Klausler [Fri, 18 Feb 2022 22:08:57 +0000 (14:08 -0800)]
[flang] Accommodate arrays with a zero-extent dimension in location folding
The index incrementation code used for FINDLOC, MAXLOC, and MINLOC folding
would crash if the array had a zero extent on the dimension selected with
a DIM= argument since the subscript passed to IncrementSubscripts would
have a value less than the lower bound. Fix, and add tests.
Differential Revision: https://reviews.llvm.org/D121125
Nico Weber [Mon, 7 Mar 2022 18:43:29 +0000 (13:43 -0500)]
Revert "[gn build] (manually) port
0c2b43ab8cb1 (X86MCTests)"
This reverts commit
336e3677eac3f0ab7af212505723ef5041bacb6c.
0c2b43ab8cb1 was reverted in
cf9b3ef941d4b4.
Maksim Panchenko [Mon, 7 Mar 2022 18:40:48 +0000 (10:40 -0800)]
Revert "[X86] Fix MCSymbolizer interface for X86Disassembler"
This reverts commit
0c2b43ab8cb1067dd1c7899094b824890803a7d2.
Nico Weber [Mon, 7 Mar 2022 18:36:44 +0000 (13:36 -0500)]
[gn build] (manually) port
0c2b43ab8cb1 (X86MCTests)
Arthur O'Dwyer [Wed, 2 Mar 2022 22:22:55 +0000 (17:22 -0500)]
[libc++] [ranges] Fix `decltype(auto) ranges::iter_move`.
See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92894#c3
https://reviews.llvm.org/D119589#inline-1151299
Differential Revision: https://reviews.llvm.org/D120417
Nico Weber [Mon, 7 Mar 2022 14:42:35 +0000 (09:42 -0500)]
[clang-format] Fix namespace end comments in ObjC++ files too
See also
d96ae867351ec.
Differential Revision: https://reviews.llvm.org/D121112
Arthur O'Dwyer [Fri, 4 Mar 2022 23:24:18 +0000 (18:24 -0500)]
[libc++] Overhaul std::quoted; fix its relationship to character traits.
Move `__quoted_output_proxy` into the one file that uses it.
A `const char*` has no associated traits class, so `std::quoted("literal")`
should be printable into any basic_ostream regardless of traits.
Use hidden-friend `operator<<` and `operator>>`, since we're permitted to.
(The exact signature is unspecified because the class itself is unspecified.)
We shouldn't support `std::quoted("literal")` in C++03 or C++11 mode.
(We do need `std::__quoted(s)` and `std::__quoted(cs)` in C++11 mode,
because they're used by `std::__fs::filesystem::path`.)
Differential Revision: https://reviews.llvm.org/D120135
Maksim Panchenko [Mon, 7 Mar 2022 18:27:28 +0000 (10:27 -0800)]
[X86] Fix MCSymbolizer interface for X86Disassembler
Fix a number of issues with MCSymbolizer::tryAddingSymbolicOperand()
in X86Disassembler:
* Pass instruction size instead of immediate size.
* Correctly adjust the value of PC-relative operands.
* Set operand offset to zero when the operand is specified
implicitly.
Reviewed By: Amir, skan
Differential Revision: https://reviews.llvm.org/D121065
David Blaikie [Mon, 7 Mar 2022 17:56:51 +0000 (17:56 +0000)]
Simplify OpenMP Lambda use
* Use default ref capture for non-escaping lambdas (this makes
maintenance easier by allowing new uses, removing uses, having
conditional uses (such as in assertions) not require updates to an
explicit capture list)
* Simplify addPrivate API not to take a lambda, since it calls it
unconditionally/immediately anyway - most callers are simply passing
in a named value or short expression anyway and the lambda syntax just
adds noise/overhead
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D121077
Yuanfang Chen [Mon, 7 Mar 2022 18:15:37 +0000 (10:15 -0800)]
[clang][debug] port clang-cl /JMC flag to ELF
The motivation is to enable the MSVC-style JMC instrumentation usable by a ELF-based
debugger. Since there is no prior experience implementing JMC feature for ELF-based
debugger, it might be better to just reuse existing MSVC-style JMC instrumentation.
For debuggers that support both ELF&COFF (like lldb), the JMC implementation might
be shared between ELF&COFF. If this is found to inadequate, it is pretty low-cost
switching to alternatives.
Implementation:
- The '-fjmc' is already a driver and cc1 flag. Wire it up for ELF in the driver.
- Refactor the JMC instrumentation pass a little bit.
- The ELF handling is different from MSVC in two places:
* the flag section name is ".just.my.code" instead of ".msvcjmc"
* the way default function is provided: MSVC uses /alternatename; ELF uses weak function.
Based on D118428.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D119910
Bixia Zheng [Fri, 4 Mar 2022 21:25:10 +0000 (13:25 -0800)]
[mlir][sparse][taco] Add more unit tests.
These unit tests resides in an internal repository. Porting the tests to the
public repository.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D121021
Yi Kong [Mon, 7 Mar 2022 18:01:15 +0000 (02:01 +0800)]
Revert "Add CMake option not to build BOLT tests"
This reverts commit
d8f4d54664171bac46e6c8446df04850b40cc4f7.
Merged by accident.
Yi Kong [Mon, 7 Mar 2022 17:59:06 +0000 (01:59 +0800)]
Fix the comment for EnableNoundefAttrs, NFC
Yi Kong [Wed, 2 Mar 2022 16:43:24 +0000 (00:43 +0800)]
Add CMake option not to build BOLT tests
Diego Caballero [Mon, 7 Mar 2022 17:40:21 +0000 (17:40 +0000)]
[mlir][Vector] Improve default lowering of vector transpose operations
The default lowering of vector transpose operations generates a large sequence of
scalar extract/insert operations, one pair for each scalar element in the input tensor.
In other words, the vector transpose is scalarized. However, there are transpose
patterns where one or more adjacent high-order dimensions are not transposed (for
example, in the transpose pattern [1, 0, 2, 3], dimensions 2 and 3 are not transposed).
This patch improves the lowering of those cases by not scalarizing them and extracting/
inserting a full n-D vector, where 'n' is the number of adjacent high-order dimensions
not being transposed. By doing so, we prevent the scalarization of the code and generate a
more performant vector version.
Paradoxically, this patch shouldn't improve the performance of transpose operations if
we are using LLVM. The LLVM pipeline is able to optimize away some of the extract/insert
operations and the SLP vectorizer is converting the scalar operations back to its vector
form. However, scalarizing a vector version of the code in MLIR and relying on the SLP
vectorizer to reconstruct the vector code again is highly undesirable for several reasons.
Reviewed By: nicolasvasilache, ThomasRaoux
Differential Revision: https://reviews.llvm.org/D120601
Stanislav Gatev [Fri, 4 Mar 2022 11:03:29 +0000 (11:03 +0000)]
[clang][dataflow] Extend flow conditions from block terminators
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.
Reviewed-by: ymandel, xazax.hun
Differential Revision: https://reviews.llvm.org/D120984
Jez Ng [Mon, 7 Mar 2022 17:35:49 +0000 (12:35 -0500)]
[lld-macho][nfc] Reduce size of icfEqClass hash
... from a `uint64_t` to a `uint32_t`. (LLD-ELF uses a `uint32_t` too.)
About a 1.7% reduction in peak RSS when linking chromium_framework on my
3.2 GHz 16-Core Intel Xeon W Mac Pro, and no stat sig change in wall
time.
</Users/jezng/test2.sh ["before"]> </Users/jezng/test2.sh ["after"]> difference (95% CI)
RSS
1003036672.000 ± 9891065.259
985539505.231 ±
10272748.749 [ -2.3% .. -1.2%]
samples 27 26
base diff difference (95% CI)
sys_time 1.277 ± 0.023 1.277 ± 0.024 [ -0.9% .. +0.9%]
user_time 6.682 ± 0.046 6.598 ± 0.043 [ -1.6% .. -0.9%]
wall_time 5.904 ± 0.062 5.895 ± 0.063 [ -0.7% .. +0.4%]
samples 46 28
No appreciable change (~0.01%) in number of `equals` comparisons either:
Before:
ld64.lld: ICF needed 8 iterations
ld64.lld: equalsConstant() called 701643 times
ld64.lld: equalsVariable() called 3438526 times
After:
ld64.lld: ICF needed 8 iterations
ld64.lld: equalsConstant() called 701729 times
ld64.lld: equalsVariable() called 3438526 times
Reviewed By: #lld-macho, MaskRay, thakis
Differential Revision: https://reviews.llvm.org/D121052
Jez Ng [Mon, 7 Mar 2022 08:02:40 +0000 (03:02 -0500)]
[lld-macho][nfc] Don't use `stubsHelperIndex` in ICF hash
The existing hashing of stubsHelperIndex has mostly been a no-op* for
some time now (ever since we made ICF run before dylib symbols get their
stubs indices assigned). I guess we could consider hashing the name +
filename of the DylibSymbol instead, but I'm not sure the overhead's
worth it... moreover, LLD/ELF only hashes their Defined symbols as well.
*: Technically it does change the hash value since stubsHelperIndex is
initialized to `UINT32_MAX` by default. But since all stubsHelperIndex
values are the same at when ICF runs, they don't add any useful
information to the hash.
Jez Ng [Mon, 7 Mar 2022 04:27:35 +0000 (23:27 -0500)]
[lld-macho][nfc] Rename isec -> referentIsec to avoid shadowing
I found the shadowing a bit confusing
Jez Ng [Mon, 7 Mar 2022 17:35:15 +0000 (12:35 -0500)]
[lld-macho][nfc] Track # of ICF calls to `equals*` methods
This is debug code that is disabled by default. It'll provide a easy way
to figure out the impact (if any) of tweaking ICF's hashing algorithm
(since a poor quality hash will result in many more `equals*` calls).
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D121051
Jez Ng [Sat, 5 Mar 2022 01:22:40 +0000 (20:22 -0500)]
[lld-macho][nfc] Use llvm::function_ref instead of std::function
Jez Ng [Mon, 7 Mar 2022 17:35:12 +0000 (12:35 -0500)]
[lld-macho][nfc] Remove file statics from ICF.cpp
This gets us closer to the [LLD-as-a-library goal][1].
[1]: https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D121050
Roman Lebedev [Mon, 7 Mar 2022 17:25:09 +0000 (20:25 +0300)]
UpdateTestChecks: fix handling of UTC with spaces
We can't just split by space, that's not going to give us the same
argv we'd have gotten from the shell, it could be in a string,
we must actually parse that as argv.
zhongyunde [Mon, 7 Mar 2022 16:31:07 +0000 (00:31 +0800)]
[AArch64] Perform first active true vector combine
Materialize : i1 = extract_vector_elt t37, Constant:i64<0>
... into: "ptrue p, all" + PTEST
Test bit of lane 0 can use P register directly, and the instruction “pture all”
is loop invariant, which will beneficial to SVE after hoisting out the loop.
Reviewed By: david-arm, paulwalker-arm
Differential Revision: https://reviews.llvm.org/D120891
Florian Hahn [Mon, 7 Mar 2022 17:01:21 +0000 (17:01 +0000)]
[LV] Add test from PR54227.
Test from https://github.com/llvm/llvm-project/issues/54227.
The underlying issue has already been fixed in de8ac48 with a separate
test.
Benjamin Kramer [Mon, 7 Mar 2022 16:58:32 +0000 (17:58 +0100)]
[mlir] Add missing override keyword. NFC.
Jonas Devlieghere [Mon, 7 Mar 2022 16:37:42 +0000 (08:37 -0800)]
[lldb] Add a setting to change the autosuggestion ANSI escape codes
I'm a big fan of the autosuggestion feature but my terminal/color scheme
doesn't display faint any differently than regular lldb output, which
makes the feature a little confusing. This patch add a setting to change
the autosuggestion ANSI escape codes.
For example, to display the autosuggestion in italic, you can add this
to your ~/.lldbinit
settings set show-autosuggestion-ansi-prefix ${ansi.italic}
setting set show-autosuggestion-ansi-suffix ${ansi.normal}
Differential revision: https://reviews.llvm.org/D121064
Richard Howell [Thu, 3 Mar 2022 19:23:44 +0000 (11:23 -0800)]
[llvm] remove empty __LLVM segment in llvm-bitcode-strip
When running llvm-bitcode-strip we want to remove the __LLVM
segment as well as the __bundle section when there are no other
sections in the segment.
Differential Revision: https://reviews.llvm.org/D120927
Arthur O'Dwyer [Sun, 27 Feb 2022 17:41:22 +0000 (12:41 -0500)]
[libc++] Better handling for zero-sized types.
Zero-sized types are a GCC extension, also supported by Clang.
In theory it's already invalid to `delete` a void pointer or a
pointer-to-incomplete, so we shouldn't need any special code
to catch those cases; but in practice Clang accepts both
constructs with just a warning, and GCC even accepts `sizeof(void)`
with just a warning! So we must keep the static_asserts.
The hard errors are tested in `unique_ptr_dltr_dflt/*.compile.fail.cpp`.
In ranges::begin/end, check `sizeof >= 0` instead of `sizeof != 0`,
so as to permit zero-sized types while still disallowing incomplete
types.
Fixes #54100.
Differential Revision: https://reviews.llvm.org/D120633
LLVM GN Syncbot [Mon, 7 Mar 2022 16:44:43 +0000 (16:44 +0000)]
[gn build] Port
54d6b5b67fb3
Sergei Grechanik [Mon, 7 Mar 2022 15:49:46 +0000 (07:49 -0800)]
[mlir] Fix dumping invalid ops
This patch fixes the crash when printing some ops (like affine.for and
scf.for) when they are dumped in invalid state, e.g. during pattern
application. Now the AsmState constructor verifies the operation
first and switches to generic operation printing when the verification
fails. Also operations are now printed in generic form when emitting
diagnostics and the severity level is Error.
Reviewed By: rriddle, mehdi_amini
Differential Revision: https://reviews.llvm.org/D117834
Sam McCall [Mon, 7 Mar 2022 16:40:30 +0000 (17:40 +0100)]
[pseudo] Rename {Preprocess,PPStructure} -> DirectiveMap. NFC
More precisely describes what this file does.
Per comments on https://reviews.llvm.org/D121092
Simon Moll [Mon, 7 Mar 2022 16:24:08 +0000 (17:24 +0100)]
[VE] Split v512.32 load store into interleaved v256.32 ops
Without passthru for now. Support for packed passthru requires
evl-into-mask folding.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D120818
phyBrackets [Sat, 5 Mar 2022 11:54:24 +0000 (17:24 +0530)]
[analyzer][NFC] Merge similar conditional paths
Reviewed By: aaron.ballman, steakhal
Differential Revision: https://reviews.llvm.org/D121045
Roman Lebedev [Mon, 7 Mar 2022 12:13:10 +0000 (15:13 +0300)]
[NFC][LV] Use different braces in debug output
The analysis passes output function name encapsulated in `'` braces,
but LV uses `"`. Harmonizing this may help in creating an update script
for the LV costmodel test checks.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D121105
Venkata Ramanaiah Nalamothu [Thu, 3 Mar 2022 18:33:36 +0000 (00:03 +0530)]
[AMDGPU] Ensure return address is save/restored if clobbered or when function has calls
This test is to make sure the return address registers, if clobbered in the
function or when the function has calls, are save/restored irrespective of
whether the IPRA is enabled/disabled.
This test is found to be not save/restore the return address registers, when
clobbered in the function, with the corresponding downstream changes of D114652.
The test could not be reduced further as the register allocator needs enough
register pressure so that it allocates the return address registers as well.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D120922
Austin Kerbow [Fri, 25 Feb 2022 07:26:51 +0000 (23:26 -0800)]
[AMDGPU] Omit unnecessary waitcnt before barriers
It is not necessary to wait for all outstanding memory operations before
barriers on hardware that can back off of the barrier in the event of an
exception when traps are enabled. Add a new subtarget feature which
tracks which HW has this ability.
Reviewed By: #amdgpu, rampitec
Differential Revision: https://reviews.llvm.org/D120544
LLVM GN Syncbot [Mon, 7 Mar 2022 16:17:21 +0000 (16:17 +0000)]
[gn build] Port
205557c908ff
Nikolas Klauser [Mon, 7 Mar 2022 16:01:52 +0000 (17:01 +0100)]
[libc++][ranges] Implement ranges::max_element
Implement ranges::max_element
Reviewed By: Quuxplusone, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D117523
Simon Tatham [Mon, 7 Mar 2022 15:55:06 +0000 (15:55 +0000)]
[AArch64] Move FeatureSpecRestrict into core 8.0-R architecture.
It was included in HasV8_0rOps when D88660 first introduced that
architecture definition. In D118045 I moved it out of there and into
ProcessorFeatures.R82, so that -mcpu=cortex-r82 would continue to
behave the same as before but -march=armv8-r would include only the
mandatory parts of the architecture.
In fact, that was a mistake. Firstly, Cortex-R82 _doesn't_ implement
that feature, so it makes no sense to deliberately enable it for that
CPU in particular. But also, it's an extension that only adds system
registers, and we're generally more relaxed about where we enable
those (because kernel developers find it useful to write sysreg-access
instructions after runtime checking, and because sysreg accesses
aren't manufactured during code generation so the risk is small).
So, in line with that usual AArch64 policy, FeatureSpecRestrict ought
to be considered part of 8.0-R for LLVM purposes. So I'm moving it
back into HasV8_0rOps, where it started out.
Reviewed By: lenary
Differential Revision: https://reviews.llvm.org/D120830
Marek Kurdej [Thu, 3 Mar 2022 14:37:43 +0000 (15:37 +0100)]
[clang-format] Fix assertion failure/crash with `AllowShortFunctionsOnASingleLine: Inline/InlineOnly`.
Fixes https://github.com/llvm/llvm-project/issues/54147.
When handling `AllowShortFunctionsOnASingleLine`, we were searching for the last line with a smaller level than the current line. The search was incorrect when the first line had the same level as the current one. This led to an unsatisfied assumption about the existence of a brace (non-comment token).
Reviewed By: HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D120902
Louis Dionne [Mon, 7 Mar 2022 15:26:33 +0000 (10:26 -0500)]
[libc++][NFC] Improve release note formatting
Roman Lebedev [Mon, 7 Mar 2022 13:54:57 +0000 (16:54 +0300)]
update_analyze_test_checks.py: fix UTC_ARGS handling
They should be both used if provided in the input test
and manifested in the updated test.
Kadir Cetinkaya [Mon, 7 Mar 2022 11:51:13 +0000 (12:51 +0100)]
[clang] Adjust LookupTest for UsingTypeLocs
We no longer traverse the underlying RecordTypeLoc directly, but rather
visit the UsingTypeLoc.
Differential Revision: https://reviews.llvm.org/D121103
Richard [Fri, 4 Mar 2022 00:18:08 +0000 (17:18 -0700)]
[clang-tools-extra] Document clang tidy unit tests target
Differential Revision: https://reviews.llvm.org/D121019
Sam McCall [Mon, 7 Mar 2022 12:45:44 +0000 (13:45 +0100)]
[pseudo] Add readme
Differential Revision: https://reviews.llvm.org/D121108
Louis Dionne [Mon, 7 Mar 2022 14:00:17 +0000 (09:00 -0500)]
[libc++][NFC] Add missing whitespace in release notes
Endre Fülöp [Mon, 7 Mar 2022 13:53:26 +0000 (14:53 +0100)]
[analyzer] Fix buildbot failure for D120369
Fix test case for GenericTaintChecker.
Redefinition of types is a C11 feature, and it broke a buildbot.
Commit amended:
4fd6c6e65ab59f82284d8272aa3bec8d5084511e.
LLVM GN Syncbot [Mon, 7 Mar 2022 13:49:22 +0000 (13:49 +0000)]
[gn build] Port
311ff3917827
Louis Dionne [Thu, 3 Feb 2022 20:42:40 +0000 (15:42 -0500)]
[libc++] Add missing header <cuchar>
Fixes llvm-project#44216
Differential Revision: https://reviews.llvm.org/D97870
Florian Hahn [Mon, 7 Mar 2022 13:33:50 +0000 (13:33 +0000)]
[ConstraintElimination] Use ZExtValue for unsigned decomposition.
When decomposing constraints for unsigned conditions, we can use
negative values by zero-extending them, as long as they are less than
the maximum constraint value.
Fixes https://github.com/llvm/llvm-project/issues/54224
Florian Hahn [Mon, 7 Mar 2022 13:33:08 +0000 (13:33 +0000)]
[ConstraintElimination] Add tests inspired by PR54224.
Uday Bondhugula [Sat, 5 Mar 2022 18:04:57 +0000 (23:34 +0530)]
Update normalizeAffineFor to canonicalize maps/operands before using them
Update normalizeAffineFor utility to canonicalize maps and operands
before using them.
Differential Revision: https://reviews.llvm.org/D121086
Diana Picus [Mon, 7 Mar 2022 12:53:49 +0000 (12:53 +0000)]
[flang] Update tco after
0dc66b76fe4c
Minor fix to appease the buildbots.
Matthias Springer [Mon, 7 Mar 2022 12:27:53 +0000 (21:27 +0900)]
[mlir][shape] Migrate bufferization to BufferizableOpInterface
Differential Revision: https://reviews.llvm.org/D121043
Roman Lebedev [Mon, 7 Mar 2022 12:37:06 +0000 (15:37 +0300)]
update_analyze_test_checks.py: fix --filter handling
In particular, after filtering the check lines can't necessarily
use `-NEXT`, they may not be one directly after another.
Adrian Kuegel [Mon, 7 Mar 2022 12:25:36 +0000 (13:25 +0100)]
[mlir][Bazel] Remove unused dependencies (NFC)
Differential Revision: https://reviews.llvm.org/D121106
Christian Sigg [Mon, 7 Mar 2022 12:04:05 +0000 (13:04 +0100)]
[MLIR] Fix bazel BUILD file after Parser.h moved.
See D121024, D121025, D121026.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D121094
Endre Fülöp [Tue, 1 Mar 2022 08:40:49 +0000 (09:40 +0100)]
[analyzer] Add more propagations to Taint analysis
Add more functions as taint propators to GenericTaintChecker.
Reviewed By: steakhal
Differential Revision: https://reviews.llvm.org/D120369
Florian Hahn [Mon, 7 Mar 2022 12:01:15 +0000 (12:01 +0000)]
[ConstraintElimination] Only add cond from assume to succs if valid.
Add missing CanAdd check before adding a condition from an assume
to the successor blocks. When adding information from assume to
successor blocks we need to perform the same CanAdd as we do for adding
a condition from a branch.
Fixes https://github.com/llvm/llvm-project/issues/54217
Florian Hahn [Mon, 7 Mar 2022 12:01:09 +0000 (12:01 +0000)]
[ConstraintElimination] Add test case for PR54217.
Adds test case for https://github.com/llvm/llvm-project/issues/54217.
Mehdi Amini [Mon, 7 Mar 2022 11:18:20 +0000 (11:18 +0000)]
Partially revert
03e6d10cac86: it broke the build
Mehdi Amini [Mon, 7 Mar 2022 11:11:09 +0000 (11:11 +0000)]
Revert "Apply clang-tidy fixes for bugprone-macro-parentheses to MLIR (NFC)"
This reverts commit
393c6db7a173836b4ee350ad5598ed67b8fb14b9.
This broke the build.
Heiko Thiel [Mon, 7 Mar 2022 11:07:11 +0000 (12:07 +0100)]
[README] Add hint, how to use automatically the optimal number of CPU cores
Nikita Popov [Thu, 3 Mar 2022 15:10:09 +0000 (16:10 +0100)]
[Attributor] Remove restriction on simplifying function pointers
Dropping this restriction seems to work fine (there are no assertion
failures), so it appears that either the updater got smarter or the
problematic cases are restricted elsewhere.
If doing this still causes issues, then the place to address it
would probably be https://github.com/llvm/llvm-project/blob/
8f5bdaf481c3f4e6876a5ae0e4d7c6ed2042e6a6/llvm/lib/Transforms/IPO/Attributor.cpp#L1856-L1859,
which already prevents replacement outside the SCC, so I'm not
quite sure what this check is intended to avoid.
Differential Revision: https://reviews.llvm.org/D120987
Alex Bradbury [Mon, 7 Mar 2022 10:53:29 +0000 (10:53 +0000)]
[CODE_OWNERS/CREDITS] Update my email address
Mehdi Amini [Mon, 7 Mar 2022 10:12:48 +0000 (10:12 +0000)]
Apply clang-tidy fixes for readability-simplify-boolean-expr to MLIR (NFC)
Mehdi Amini [Mon, 7 Mar 2022 10:12:47 +0000 (10:12 +0000)]
Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC)
Mehdi Amini [Mon, 7 Mar 2022 10:12:46 +0000 (10:12 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)
Mehdi Amini [Mon, 7 Mar 2022 10:12:44 +0000 (10:12 +0000)]
Apply clang-tidy fixes for modernize-use-emplace to MLIR (NFC)
Mehdi Amini [Mon, 7 Mar 2022 10:12:43 +0000 (10:12 +0000)]
Apply clang-tidy fixes for modernize-use-default-member-init to MLIR (NFC)
Mehdi Amini [Mon, 7 Mar 2022 10:12:39 +0000 (10:12 +0000)]
Apply clang-tidy fixes for modernize-loop-convert to MLIR (NFC)
Mehdi Amini [Mon, 7 Mar 2022 10:12:38 +0000 (10:12 +0000)]
Apply clang-tidy fixes for llvm-qualified-auto to MLIR (NFC)
Mehdi Amini [Mon, 7 Mar 2022 10:12:37 +0000 (10:12 +0000)]
Apply clang-tidy fixes for bugprone-macro-parentheses to MLIR (NFC)
Nikita Popov [Fri, 4 Mar 2022 12:07:58 +0000 (13:07 +0100)]
[CoroElide] Remove fallback for frame layout determination
Only determine the frame layout based on dereferenceable and align
attributes, and remove the type-based fallback, which is incompatible
with opaque pointers. The dereferenceable attribute is required,
while the align attribute uses default alignment of 1 (commonly,
align 1 attributes do not get placed, relying on default alignment).
The CoroSplit pass producing the resume function adds the necessary
attributes in https://github.com/llvm/llvm-project/blob/
7daed359111f6d151fef447f520f85ef1dabedf6/llvm/lib/Transforms/Coroutines/CoroSplit.cpp#L840,
and their presence is checked in coro-debug.ll at least.
Differential Revision: https://reviews.llvm.org/D120988
Jan Svoboda [Mon, 7 Mar 2022 10:21:06 +0000 (11:21 +0100)]
[clang][modules] Fix failing test
This test started failing on Windows after
b45888e959ad2d6562b8d321166e6387facdd412 due to path separators not matching up.
Simon Atanasyan [Mon, 7 Mar 2022 10:08:12 +0000 (13:08 +0300)]
Remove Simon Atanasyan from the code owners list. MIPS Backend.
Nikita Popov [Fri, 4 Mar 2022 14:09:57 +0000 (15:09 +0100)]
[Coroutines] Allow FramePtr to be an Argument
With opaque pointers, after splitRetconCoroutine() the FramePtr
may be an Argument rather than an Instruction. With typed pointers,
this currently doesn't happen because the FramePtr would be a
bitcast instruction.
Fix this by making FramePtr a Value and adding a helper for the
"after FramePtr" insertion point, which would be the start of the
function in the Argument case.
Differential Revision: https://reviews.llvm.org/D120994
Jan Svoboda [Mon, 7 Mar 2022 09:22:06 +0000 (10:22 +0100)]
[clang][modules] Report module maps affecting `no_undeclared_includes` modules
Since D106876, PCM files don't report module maps as input files unless they contributed to the compilation.
Reporting only module maps of (transitively) imported modules is not enough, though. For modules marked with `[no_undeclared_includes]`, other module maps affect the compilation by introducing anti-dependencies.
This patch makes sure such module maps are being reported as input files.
Depends on D120463.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D120464
Jan Svoboda [Mon, 7 Mar 2022 09:21:30 +0000 (10:21 +0100)]
[clang][modules] NFC: Simplify and clarify test
This patch simplifies a test that checks only used module map files are reported as input files in PCM files.
Instead of using opaque `diff`, this patch uses `clang -module-file-info` and `FileCheck` to verify this.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D120463
David Green [Mon, 7 Mar 2022 09:42:54 +0000 (09:42 +0000)]
[AArch64] Turn truncating buildvectors into truncates
When lowering large v16f32->v16i8 fp_to_si_sat, the fp_to_si_sat node is
split several times, creating an illegal v4i8 concat that gets expanded
into a BUILD_VECTOR. After some combining and other legalisation, it
ends up the a buildvector that extracts from 4 vectors, looking like
BUILDVECTOR(a0,a1,a2,a3,b0,b1,b2,b3,c0,c1,c2,c3,d0,d1,d2,d3). That is
really an v16i32->v16i8 truncate in disguise.
This adds a ReconstructTruncateFromBuildVector method to detect the
pattern, converting it back into the legal "concat(trunc(concat(trunc(a),
trunc(b))), trunc(concat(trunc(c), trunc(d))))" tree. The extracted
nodes could also be v4i16, in which case the truncates are not needed.
All those truncates and concats then become uzip1's, which is much
better than expanding by moving vector lanes around.
Differential Revision: https://reviews.llvm.org/D119469
Siva Chandra Reddy [Mon, 7 Mar 2022 05:56:04 +0000 (05:56 +0000)]
[libc] Fix alignment logic in TLS image size calculation.
LLVM GN Syncbot [Mon, 7 Mar 2022 09:08:13 +0000 (09:08 +0000)]
[gn build] Port
5f62156762d4
River Riddle [Sat, 5 Mar 2022 20:27:00 +0000 (12:27 -0800)]
[mlir][NFC] Move Translation.h to a Tools/mlir-translate directory
Translation.h is currently awkwardly shoved into the top-level mlir, even though it is
specific to the mlir-translate tool. This commit moves it to a new Tools/mlir-translate
directory, which is intended for libraries used to implement tools. It also splits the
translate registry from the main entry point, to more closely mirror what mlir-opt
does.
Differential Revision: https://reviews.llvm.org/D121026
River Riddle [Fri, 4 Mar 2022 21:49:30 +0000 (13:49 -0800)]
[mlir][NFC] Move MlirOptMain to the Tools/ directory
MlirOptMain is currently awkwardly shoved into mlir/Support. This commit
moves it to the Tools/ directory, which is intended for libraries used to
implement tools.
Differential Revision: https://reviews.llvm.org/D121025
River Riddle [Fri, 4 Mar 2022 20:53:22 +0000 (12:53 -0800)]
[mlir][NFC] Move Parser.h to Parser/
There is no reason for this file to be at the top-level, and
its current placement predates the Parser/ folder's existence.
Differential Revision: https://reviews.llvm.org/D121024
Florian Hahn [Mon, 7 Mar 2022 09:03:48 +0000 (09:03 +0000)]
[ConstraintElimination] Remove dead variables when dropping constraints.
This patch extends ConstraintElimination to also remove dead variables
when removing a constraint. When a constraint is removed because it is
out of scope, all new variables added for this constraint can also be
removed.
This keeps the total size of the systems much smaller, because it
reduces the number of variables drastically.
It also fixes a bug where variables where removed incorrectly.
Fixes https://github.com/llvm/llvm-project/issues/54228
Florian Hahn [Mon, 7 Mar 2022 09:03:42 +0000 (09:03 +0000)]
[ConstraintElimination] Add test from PR54228.
Test for https://github.com/llvm/llvm-project/issues/54228
Luo, Yuanke [Mon, 7 Mar 2022 08:51:42 +0000 (16:51 +0800)]
[X86] Update some of the AVX512 intrinsic tests to avoid adds.
As noticed in D119654, by adding the masked intrinsics results together
we can end up with the selects being canonicalized away from the
intrinsic - this isn't what we want to test here so replace with a
insertvalue chain into a aggregate instead to retain all the results.
Simon Moll [Mon, 7 Mar 2022 09:01:31 +0000 (10:01 +0100)]
[VP] Introducing VectorBuilder, the VP intrinsic builder
VectorBuilder wraps around an IRBuilder and
VectorBuilder::createVectorInstructions emits VP intrinsics as if they
were regular instructions.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D105283
Nikita Popov [Thu, 3 Mar 2022 14:41:06 +0000 (15:41 +0100)]
[Attributor] Remove function pointer restriction for AAAlign
This check is not compatible with opaque pointers. We can avoid
it by adjusting the getPointerAlignment() implementation to avoid
creating unnecessary ptrtoint expressions for bitcasted pointers.
The code already uses OnlyIfReduced to not create an expression
if it does not simplify, and this makes sure that folding a
bitcast and ptrtoint into a ptrtoint doesn't count as a
simplification.
Differential Revision: https://reviews.llvm.org/D120904
David Green [Mon, 7 Mar 2022 08:57:50 +0000 (08:57 +0000)]
[AArch64] Use NPM for cost model tests. NFC
As per the other tests, this switches the run lines back to using the
NPM via
-passes='print<cost-model>' -cost-kind=throughput 2>&1 -disable-output
Nikita Popov [Mon, 28 Feb 2022 10:18:18 +0000 (11:18 +0100)]
[SCEV] Enable verification under EXPENSIVE_CHECKS
SCEV verification should no longer affect results of subsequent
queries, and our lit tests as well as llvm-test-suite pass with
SCEV verification enabled, so I think we can enable it by default
under EXPENSIVE_CHECKS now.
Differential Revision: https://reviews.llvm.org/D120708
Weining Lu [Mon, 7 Mar 2022 08:38:30 +0000 (16:38 +0800)]
[LoongArch] Add EncoderMethods for transformed immediate operands
This is a split patch of D120476 and thanks to myhsu.
'Transformed' means the encoding of an immediate is not the same as
its binary representation. For example, the `bl` instruction
requires a signed 28-bits integer as its operand and the low 2 bits
must be 0. So only the upper 26 bits are needed to get encoded into
the instruction.
Based on the above reason this kind of immediate needs a customed
`EncoderMethod` to get the real value getting encoded into the
instruction.
Currently these immediate includes:
```
uimm2_plus1
simm14_lsl2
simm16_lsl2
simm21_lsl2
simm26_lsl2
```
This patch adds those `EncoderMethod`s and revises related .mir test
in previous patch.
Reviewed By: xen0n, MaskRay
Differential Revision: https://reviews.llvm.org/D120545
Nikita Popov [Fri, 25 Feb 2022 10:30:01 +0000 (11:30 +0100)]
[SCEV] Enable verification in LoopPM
Currently, we hardly ever actually run SCEV verification, even in
tests with -verify-scev. This is because the NewPM LPM does not
verify SCEV. The reason for this is that SCEV verification can
actually change the result of subsequent SCEV queries, which means
that you see different transformations depending on whether
verification is enabled or not.
To allow verification in the LPM, this limits verification to
BECounts that have actually been cached. It will not calculate
new BECounts.
BackedgeTakenInfo::getExact() is still not entirely readonly,
it still calls getUMinFromMismatchedTypes(). But I hope that this
is not problematic in the same way. (This could be avoided by
performing the umin in the other SCEV instance, but this would
require duplicating some of the code.)
Differential Revision: https://reviews.llvm.org/D120551
Adrian Kuegel [Mon, 7 Mar 2022 08:40:49 +0000 (09:40 +0100)]
[mlir] Use empty() instead of checking size() == 0 (NFC)
Nikita Popov [Thu, 17 Feb 2022 09:03:58 +0000 (10:03 +0100)]
[SCEV] Fully invalidate SCEVUnknown on RAUW
When a SCEVUnknown gets RAUWd, we currently drop it from the folding
set, but don't forget memoized values. I believe we should be
treating RAUW the same way as deletion here and invalidate all
caches and dependent expressions.
I don't have any specific cases where this causes issues right now,
but it does address the FIXME in https://reviews.llvm.org/D119488.
Differential Revision: https://reviews.llvm.org/D120033
Timm Bäder [Thu, 3 Mar 2022 11:13:48 +0000 (12:13 +0100)]
[clang][parser] Stop dragging an EndLoc around when parsing attributes
It's almost always entirely unused and if it is used, the end of the
attribute range can be used instead.
Differential Revision: https://reviews.llvm.org/D120888
Christian Sigg [Sun, 6 Mar 2022 19:55:59 +0000 (20:55 +0100)]
[MLIR] Change call sites from deprecated `parseSourceFile()` to `parseSourceFile<ModuleOp>()`.
Mark `parseSourceFile()` deprecated. The functions will be removed two weeks after landing this change.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D121075
Johannes Doerfert [Sun, 6 Mar 2022 23:37:47 +0000 (17:37 -0600)]
[Attributor] Determine potentially loaded values through memory
We already look through memory to determine where a value that is stored
might pop up again (potential copies). This patch introduces the other
direction with similar logic. If a value is loaded, we can follow all
the accesses to the pointer (or better object) and try to determine what
value might have been stored.