Phoebe Wang [Sun, 9 Oct 2022 00:50:16 +0000 (08:50 +0800)]
Add myself to CREDITS.TXT + CODE_OWNERS.TXT
See https://discourse.llvm.org/t/proposed-change-to-x86-code-ownership/65620
Tatsuyuki Ishi [Sun, 9 Oct 2022 00:58:07 +0000 (00:58 +0000)]
[Support] Add fast path for StringRef::find with needle of length 2.
InclusionRewriter on Windows (CRLF line endings) will exercise this in a
hot path. Calling memcmp repeatedly would be highly suboptimal for that
use case, so give it a specialized path.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D133660
Anton Bikineev [Thu, 22 Sep 2022 14:56:03 +0000 (16:56 +0200)]
[PGO] Consider parent context when weighing branches with likelyhood.
Generally, with PGO enabled the C++20 likelyhood attributes shall be
dropped assuming the profile has a good coverage. However, currently
this is not the case for the following code:
if (always_false()) [[likely]] {
...
}
The patch fixes this and drops the attribute, if the parent context was
executed in the profile. The patch still preserves the attribute, if the
parent context was not executed, e.g. to support the cases when the
profile has insufficient coverage.
Differential Revision: https://reviews.llvm.org/D134456
Simon Pilgrim [Sat, 8 Oct 2022 21:19:50 +0000 (22:19 +0100)]
Add myself to CREDITS.TXT + CODE_OWNERS.TXT
Phoebe Wang and I are replacing Craig Topper as X86 Code Owners: https://discourse.llvm.org/t/proposed-change-to-x86-code-ownership/65620
Florian Hahn [Sat, 8 Oct 2022 18:39:36 +0000 (19:39 +0100)]
[ConstraintElimination] Add tests for chained GEPs without inbounds.
Mehdi Amini [Thu, 6 Oct 2022 18:41:58 +0000 (18:41 +0000)]
Apply clang-tidy fixes for llvm-else-after-return in TosaToLinalg.cpp (NFC)
Mehdi Amini [Thu, 6 Oct 2022 18:21:47 +0000 (18:21 +0000)]
Apply clang-tidy fixes for performance-unnecessary-value-param in IRCore.cpp (NFC)
Fangrui Song [Sat, 8 Oct 2022 18:09:42 +0000 (11:09 -0700)]
[LTO] Make local linkage GlobalValue in non-prevailing COMDAT available_externally
See the updated linkonce_resolution_comdat.ll. For a local linkage GV in a
non-prevailing COMDAT, it remains defined while its leader has been made
available_externally. This violates the COMDAT rule that its members must be
retained or discarded as a unit.
To fix this, update the regular LTO change D34803 to track local linkage
GlobalValues, and port the code to ThinLTO (GlobalAliases are not handled.)
Fix https://github.com/llvm/llvm-project/issues/58215:
as a size optimization, we place private `__profd_` in a COMDAT with a
`__profc_` key. When FuncImport.cpp makes `__profc_` available_externally due to
a non-prevailing COMDAT, `__profd_` incorrectly remains private. This change
makes the `__profd_` available_externally.
```
cat > c.h <<'eof'
extern void bar();
inline __attribute__((noinline)) void foo() {}
eof
cat > m1.cc <<'eof'
#include "c.h"
int main() {
bar();
foo();
}
eof
cat > m2.cc <<'eof'
#include "c.h"
__attribute__((noinline)) void bar() {
foo();
}
eof
clang -O2 -fprofile-generate=./t m1.cc m2.cc -flto -fuse-ld=lld -o t_gen
rm -fr t && ./t_gen && llvm-profdata show -function=foo t/default_*.profraw
# one _Z3foov
clang -O2 -fprofile-generate=./t m1.cc m2.cc -flto=thin -fuse-ld=lld -o t_gen
rm -fr t && ./t_gen && llvm-profdata show -function=foo t/default_*.profraw
# one _Z3foov
```
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D135427
Craig Topper [Sat, 8 Oct 2022 17:49:52 +0000 (10:49 -0700)]
[RISCV] Add signext attribute to i32 arguments in some tests. NFC
Sam McCall [Sat, 8 Oct 2022 02:32:15 +0000 (04:32 +0200)]
[clangd] FindTarget: UsingEnumDecl is not an alias
Unlike UsingDecl it doesn't name the UsingShadowDecls it emits, so it doesn't
make sense to consider them the same thing. Don't consider the UsingEnumDecl
a target when the UsingShadowDecl is referenced.
Differential Revision: https://reviews.llvm.org/D135506
Florian Hahn [Sat, 8 Oct 2022 15:59:27 +0000 (16:59 +0100)]
[ConstraintElimination] Support chained GEPs with constant offsets.
Handle the (gep (gep ....), C) case by incrementing the constant
coefficient of the inner GEP, if C is a constant.
Florian Hahn [Sat, 8 Oct 2022 15:26:08 +0000 (16:26 +0100)]
[LV] Replace check with assert for reduction resume values (NFC).
At this point, we need to have resume values for all inductions. If not,
this would result in silent mis-compiles.
Florian Hahn [Sat, 8 Oct 2022 15:05:55 +0000 (16:05 +0100)]
[ConstraintElimination] Remove unused function (NFC).
Sanjay Patel [Sat, 8 Oct 2022 14:09:44 +0000 (10:09 -0400)]
[InstCombine] fold exact sdiv to ashr (2nd try)
The 1st attempt failed to updated the test checks as expected.
Original commit message:
sdiv exact X, (1<<ShAmt) --> ashr exact X, ShAmt (if shl is non-negative)
https://alive2.llvm.org/ce/z/kB6VF7
It would probably be better to use ValueTracking to replace this
and the existing transform above it, but the analysis does not
account for the no-wrap properly, and it's not immediately clear
to me how to fix it.
Sanjay Patel [Sat, 8 Oct 2022 14:06:44 +0000 (10:06 -0400)]
[InstCombine] add test for sdiv with shl; NFC
Sanjay Patel [Sat, 8 Oct 2022 14:02:03 +0000 (10:02 -0400)]
Revert "[InstCombine] fold exact sdiv to ashr"
This reverts commit
fe15290e0cf5d2bcdefca2e81ef6ff8155a2f7a8.
The test checks were not updated as expected.
Sanjay Patel [Sat, 8 Oct 2022 13:19:21 +0000 (09:19 -0400)]
[InstCombine] fold exact sdiv to ashr
sdiv exact X, (1<<ShAmt) --> ashr exact X, ShAmt (if shl is non-negative)
https://alive2.llvm.org/ce/z/kB6VF7
It would probably be better to use ValueTracking to replace this
and the existing transform above it, but the analysis does not
account for the no-wrap properly, and it's not immediately clear
to me how to fix it.
Mark de Wever [Fri, 2 Sep 2022 16:46:59 +0000 (18:46 +0200)]
[libc++] Make charconv require C++17 or later.
Implementing the paper
P2291R3 Add Constexpr Modifiers to Functions to_chars and from_chars for
Integral Types in <charconv> Header
Gives issues in language versions prior to C++17. As suggested in
D131855 disable the code prior to C++17. This removes libc++'s
extension.
Reviewed By: ldionne, #libc_vendors, #libc, philnik
Differential Revision: https://reviews.llvm.org/D133216
Evgeny Shulgin [Wed, 14 Sep 2022 20:03:14 +0000 (20:03 +0000)]
[clang-tidy] Ignore concepts in `misc-redundant-expression`
The checker should ignore requirement expressions inside concept
definitions, because redundant expressions still make sense here
Fixes https://github.com/llvm/llvm-project/issues/54114
Reviewed By: njames93, aaron.ballman
Differential Revision: https://reviews.llvm.org/D122078
Florian Hahn [Sat, 8 Oct 2022 10:03:44 +0000 (11:03 +0100)]
[ConstraintElimination] Use logic from
3771310eed for queries only.
The logic added in
3771310eed was placed sub-optimally. Applying the
transform in ::getConstraint meant that it would also impact conditions
that are added to the system by the signed <-> unsigned transfer logic.
This meant we failed to add some signed facts to the signed system. To
make sure we still add as many useful facts to the signed/unsigned
systems, move the logic to the point where we query the system.
Chuanqi Xu [Sat, 8 Oct 2022 09:05:44 +0000 (17:05 +0800)]
[C++20] [Modules] Only allow redeclarations in partitions if they are in the same module
Closes https://github.com/llvm/llvm-project/issues/58196.
The root cause for the problem is an oversight in
https://reviews.llvm.org/D127624, which allows the redeclarations in
partitions. However, we took a mistake there that we should only allow
it if the redeclarations in the one same module instead of return
directly if either the redeclaration lives in a partition. The original
implementation makes no sense and I believe it was an oversight.
Chuanqi Xu [Sat, 8 Oct 2022 08:38:19 +0000 (16:38 +0800)]
[C++20] [Modules] Remove assertion of current module when acting on import
Closes https://github.com/llvm/llvm-project/issues/58199
Previously, when we act on a import statement, we'll assume there is a
module declaration in the current TU if the command line tells us we're
compiling a module unit. This makes since on valid codes. However, for
invalid codes, it is possible. See
https://github.com/llvm/llvm-project/issues/58199 for example.
This patch removes the assertion. And the assertion is a noop and it
should be safe to remove it.
Freddy Ye [Sat, 8 Oct 2022 06:27:06 +0000 (14:27 +0800)]
[X86] Remove AVX512VP2INTERSECT from Sapphire Rapids.
For more details, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D135509
gonglingqin [Sat, 8 Oct 2022 06:33:04 +0000 (14:33 +0800)]
[LoongArch] Do not assert value type in isFPImmLegal
This patch fixes the failure of llvm/test/CodeGen/Generic/vector.ll and
CodeGen/PowerPC/2007-11-19-VectorSplitting.ll for a LoongArch native build.
Differential Revision: https://reviews.llvm.org/D134798
chenglin.bi [Sat, 8 Oct 2022 06:47:50 +0000 (14:47 +0800)]
[ARM64EC][clang-cl] Add arm64EC test; NFC
Sam McCall [Thu, 15 Sep 2022 19:54:01 +0000 (21:54 +0200)]
[clangd] Enable standard library index by default.
Differential Revision: https://reviews.llvm.org/D133968
Manoj Gupta [Thu, 22 Sep 2022 20:53:46 +0000 (13:53 -0700)]
BareMetal: detect usr/include/c++/v1 path in sysroot
Currently baremetal driver adds <sysroot>/include/c++/v1
for libc++ headers. However on ChromeOS, all include files
are inside <sysroot>/usr/include. So add
<sysroot>/usr/include/c++/v1 if it exists in baremetal driver.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D134478
wanglei [Thu, 6 Oct 2022 12:39:59 +0000 (20:39 +0800)]
[LoongArch] Set correct encodings for DWARF exception handling
This patch sets correct encodings for DWARF exception handling for
LoongArch.
Differential Revision: https://reviews.llvm.org/D134710
Jessica Paquette [Fri, 7 Oct 2022 19:19:33 +0000 (12:19 -0700)]
[GlobalISel] Add commutative matchers for compares.
This adds:
* `m_c_GICmp`
* `m_c_GFCmp`
These work the same way as the standard matchers, but will also try to commute
the LHS and RHS of a compare to get a match.
E.g.
```
m_c_GICmp(m_Pred(...), m_GAdd(...), m_GSub(...))
```
Can match either of
```
icmp cc (add x, y), (sub a, b)
icmp swapped_cc (sub a, b), (add x, y)
```
Differential Revision: https://reviews.llvm.org/D135415
Enna1 [Sat, 8 Oct 2022 01:55:40 +0000 (09:55 +0800)]
[memprof] dump memprof profile when receive deadly signals
Currently memprof profile is dumped when program exits (call `FinishAndWrite()` in ~Allocator) or `__memprof_profile_dump` is manually called.
For programs that never exit (e.g. server-side application), it will be useful to dump memprof profile when specific signal is received.
This patch installs a signal handler for deadly signals(SIGSEGV, SIGBUS, SIGABRT, SIGILL, SIGTRAP, SIGFPE) like we do in other sanitizers. In the signal handler `__memprof_profile_dump` is called to dump memprof profile.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D134795
Lei Zhang [Sat, 8 Oct 2022 00:43:27 +0000 (00:43 +0000)]
[mlir][vector] Merge accumulator/result transpose into contract
This commit adds a pattern to merge accumulator and result
`vector.transpose` ops into `vector.contract`. This kind of
pattern can be generated for NCHW convolution vectorization,
where we use transposes to convert the 1-D NCW convolution
into NWC during vectorization. Merging the transpose would
mean we can avoid materialize vector extract/insert for
transposes and it makes further vector level transformations
easier.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D135496
Craig Topper [Sat, 8 Oct 2022 00:16:38 +0000 (17:16 -0700)]
[RISCV] Fix incorrect parenthese placement in comment. NFC
Craig Topper [Fri, 7 Oct 2022 17:26:22 +0000 (10:26 -0700)]
[VP][RISCV] Add vp.smax/smin/umax/umin intrinsics
Differential Revision: https://reviews.llvm.org/D135418
Jeff Bailey [Sat, 8 Oct 2022 00:03:47 +0000 (00:03 +0000)]
[libc] Document which date funcs are needed/done
Reviewed By: rtenneti
Differential Revision: https://reviews.llvm.org/D135501
Kostya Serebryany [Wed, 5 Oct 2022 20:22:13 +0000 (13:22 -0700)]
[libFuzzer] update the libFuzzer docs to reflect the current state.
[libFuzzer] update the libFuzzer docs to reflect the current state.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D135312
Arthur Eubanks [Fri, 7 Oct 2022 21:37:23 +0000 (14:37 -0700)]
[llvm-reduce] Fail verifier less when removing debug metadata
Without this patch, we hit the following a lot:
"llvm.dbg.declare intrinsic requires a !dbg attachment"
"DICompileUnit not listed in llvm.dbg.cu"
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D135492
Michael Jones [Fri, 7 Oct 2022 23:16:15 +0000 (16:16 -0700)]
[libc][nfc] fix comment in clock_gettime
The first line got split because it was too long. Now it's fixed.
Differential Revision: https://reviews.llvm.org/D135498
Krzysztof Parzyszek [Fri, 7 Oct 2022 22:40:27 +0000 (15:40 -0700)]
[Hexagon] Implement helper to get intrinsic for instruction opcode
There are intrinsics for most scalar instructions and almost all HVX
instructions. What's somewhat painful is that there are two intrinsics
for each HVX instruction: one for 64- and one for 128-byte mode.
Instead of checking the current codegen settings every time, this
function would simply return the right intrinsic.
Amaury Séchet [Fri, 7 Oct 2022 22:35:25 +0000 (00:35 +0200)]
[DAGCombine] Deduplicate addcarry node using commutativity.
The first two parameters of addcarry are commutative. We may face a situation where both variant are present in the DAG, in which case we benefit from using just one.
Depends on D57302 and D33587
Reviewed By: RKSimon, chfast
Differential Revision: https://reviews.llvm.org/D57317
Jessica Paquette [Fri, 7 Oct 2022 21:33:51 +0000 (14:33 -0700)]
[GlobalISel] Mark mi_match as nodiscard
Typically when you match something, you want to check the result.
Fix a couple warnings in the AMDGPUPostLegalizerCombiner which appear as a
result of this.
Differential Revision: https://reviews.llvm.org/D135491
Lang Hames [Fri, 7 Oct 2022 21:56:04 +0000 (14:56 -0700)]
[JITLink][aarch64] Fix typo in error message.
Arthur Eubanks [Fri, 7 Oct 2022 20:12:59 +0000 (13:12 -0700)]
[opt] Don't translate legacy -analysis flag to require<analysis>
Tests relying on this should explicitly use -passes='require<analysis>,foo'.
Maksim Panchenko [Fri, 7 Oct 2022 18:55:30 +0000 (11:55 -0700)]
[BOLT][TEST] Fix section order test
.bss section emitted by llvm-bolt (e.g. with instrumentation) is not a
real BSS section, i.e. it takes space in the output file. Hence the
order with respect to .data is not defined. Remove .bss from the test
and fix the buildbot failure.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D135475
Evgeny Shulgin [Fri, 7 Oct 2022 20:54:39 +0000 (20:54 +0000)]
[Clang] Use C++17 in constant-builtins-fmax.cpp test
Add `-std=c++17` to the test so that buildbot won't fail
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D135486
Pavel Chupin [Fri, 7 Oct 2022 21:01:20 +0000 (14:01 -0700)]
Fix warnings in build done by clang-based compiler
Differential Revision: https://reviews.llvm.org/D135230
Artem Belevich [Wed, 10 Aug 2022 00:28:30 +0000 (17:28 -0700)]
Add support for CUDA-11.8 and sm_{87,89,90} GPUs.
Differential Revision: https://reviews.llvm.org/D135306
Artem Belevich [Wed, 5 Oct 2022 22:20:17 +0000 (15:20 -0700)]
Refactored CUDA version housekeeping to use less boilerplate.
Differential Revision: https://reviews.llvm.org/D135328
Arthur Eubanks [Fri, 7 Oct 2022 20:49:25 +0000 (13:49 -0700)]
[opt] Remove legacy -print-dom-info pass
This was specific to `opt` for some reason.
There's already a new pass manager pass `print<domtree>` which does the same.
Florian Hahn [Fri, 7 Oct 2022 20:35:42 +0000 (21:35 +0100)]
[LoopSimplifyCFG] Invalidate SCEV dispositions.
Clear all dispositions if there are any dead blocks (which will get
removed later) and also clear dispositions for removed instructions.
Clearing all dispositions in case there are dead blocks happens first,
which should avoid traversing SCEV use-lists for invalidating
dispositions for individual values.
Fixes #58179.
Evgeny Shulgin [Wed, 21 Sep 2022 15:52:18 +0000 (15:52 +0000)]
[Clang] Support constexpr builtin fmax
Support constexpr version of __builtin_fmax and its variations.
Reviewed By: jcranmer-intel
Differential Revision: https://reviews.llvm.org/D134369
Matt Arsenault [Thu, 15 Sep 2022 19:42:17 +0000 (15:42 -0400)]
AMDGPU: Update SlotIndexes independently of LiveIntervals
Apparently StackColoring depends on SlotIndexes, but not
LiveIntervals. If regalloc fast were manually requested, LiveIntervals
would be dropped before SILowerSGPRSpills but not SlotIndexes.
SILowerSGPRSpills preserved SlotIndexes, but only through
LiveIntervals. As a result, SILowerSGPRSpills was incorrectly
reporting it preserved SlotIndexes. Start updating these directly,
instead of depending on LiveIntervals also being available.
Matt Arsenault [Thu, 6 Oct 2022 22:04:25 +0000 (15:04 -0700)]
llvm-reduce: Fix another invalid reduction with repeated input phis
ReduceOperandsSkip had the same issue as ReduceOperands when handling
phis with repeated predecessors.
Matt Arsenault [Thu, 6 Oct 2022 18:06:02 +0000 (11:06 -0700)]
llvm-reduce: Fix invalid reduction for phis with repeat inputs
Phis have a quirk where the same predecessor block may appear multiple times
if the same block branches to it multiple ways. All the values need to match,
but this was replacing each operand independently. If an operand can be simplified,
make sure to replace every instance of the incoming block's value.
Matt Arsenault [Tue, 4 Oct 2022 01:34:51 +0000 (18:34 -0700)]
llvm-reduce: Use -abort-on-invalid-reduction in a test
Also stop using cat
Matt Arsenault [Wed, 5 Oct 2022 04:09:45 +0000 (21:09 -0700)]
llvm-reduce: Fix missing C++ mode comments
Lei Zhang [Fri, 7 Oct 2022 19:42:08 +0000 (19:42 +0000)]
[mlir][arith] Expose dedicated API for expanding ceil/floor division
This allows more precise control over which patterns to pick to
expand arithmetic ops. Previously ceil/floor division epxansion
is only available together with various min/max op expansion.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D135479
Florian Hahn [Fri, 7 Oct 2022 19:42:15 +0000 (20:42 +0100)]
[ConstraintElimination] Add test for regression after
3771310eede.
Florian Hahn [Fri, 7 Oct 2022 19:15:44 +0000 (20:15 +0100)]
Recommit "[SCEV] Support clearing Block/LoopDispositions for a single value."
This reverts commit
92f698f01fa0bb8967233a6391ada2d51849fa68.
The updated version of the patch includes handling for non-SCEVable
types. A test case has been added in
ec86e9a99bca802.
Matthew Voss [Fri, 7 Oct 2022 19:00:22 +0000 (12:00 -0700)]
[llvm-reduce] Fix di-metadata pass test failures
We're seeing intermittent failures in upstream bots. See:
https://lab.llvm.org/buildbot/#/builders/139/builds/29185
https://lab.llvm.org/buildbot/#/builders/238/builds/295
This appears to be due to the unstable iteration order of DenseSet.
Since we're trying to reduce a tree, it makes sense to attempt
reductions from the top down.
This also addresses post-review comments from @MatzeB.
Differential Revision: https://reviews.llvm.org/D135473
Florian Hahn [Fri, 7 Oct 2022 19:02:57 +0000 (20:02 +0100)]
[LoopUnroll] Add test for crash exposed by
9e931439.
Arthur Eubanks [Fri, 7 Oct 2022 18:55:36 +0000 (11:55 -0700)]
[opt] Remove -passes=asan-pipeline
It was obsoleted when the asan pass was changed to just be one module pass.
Philip Reames [Thu, 6 Oct 2022 15:40:09 +0000 (08:40 -0700)]
Remove PlaceSafepoints pass
This patch was added way back in the beginning of the work which became the statepoint infrastructure. The idea was that safepoints could be inserted late in the optimization pipeline. This is true if the only concern is garbage collection, but this approach turned out to be incompatible with the requirement to also support deoptimization at safepoints.
In theory, this pass would still be quite useful for an AOT compiled language which wants to support garbage collection, but we have no known users, and haven't for over 5 years. Time to remove unused code. If someone wants to use this, restoring it would not be hard. The immediate motivation for removal is that this is one of the last passes remaining which hasn't been ported to the new pass manager and the (straight forward) work to do so is not justified for unused code.
Differential Revision: https://reviews.llvm.org/D135371
Arthur Eubanks [Fri, 7 Oct 2022 18:49:10 +0000 (11:49 -0700)]
[opt] Stop treating alias analysis specially when translating legacy opt syntax
I've attempted to keep AA tests as close to their original intent as possible.
Ellis Hoag [Fri, 7 Oct 2022 17:29:59 +0000 (10:29 -0700)]
[llvm-profdata] Rename show flag to --show-format
In https://reviews.llvm.org/D135127 we created the show flag
`--output-format` which was confusing because it behaved differently
than the same flag in the merge command. So, rename the flag to
`--show-format`. This also allows us to add the `text` option to mean
"normal text output" rather than "text-encoded profiles" like it does
for the merge command.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D135467
Rafael Auler [Fri, 7 Oct 2022 18:26:51 +0000 (11:26 -0700)]
[BOLT] Testcase to repro dyn reloc bug
Add a new testcase that shows a bug in BOLT when writing out
dynamic relocations. This is currently marked as XFAIL as we work on
solving it. This bug happens when the current strategy fails to
recognize that the original dynamic relocation in the input should
reference the original .bolt.org.rodata section instead of the new one
.rodata created by BOLT after moving jump tables. This bug started
happening after
729d29e167a5.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D125941
Michael Jones [Tue, 12 Jul 2022 23:35:09 +0000 (16:35 -0700)]
[libc] add printf decimal float conversion
This patch adds support for converting doubles to string in the %f/F
format specifier. It does not yet support long doubles outside of the
double range. This implementation is based on the work of Ulf Adams,
specifically the Ryu Printf algorithm.
See:
Ulf Adams. 2019. Ryū revisited: printf floating point conversion.
Proc. ACM Program. Lang. 3, OOPSLA, Article 169 (October 2019), 23 pages.
https://doi.org/10.1145/3360595
Differential Revision: https://reviews.llvm.org/D131023
Maksim Panchenko [Wed, 5 Oct 2022 00:12:02 +0000 (17:12 -0700)]
[BOLT] Change order of new sections
While the order of new sections in the output binary was deterministic
in the past (i.e. there was no run-to-run variation), it wasn't always
rational as we used size to define the precedence of allocatable
sections within "code" or "data" groups (probably unintentionally).
Fix that by defining stricter section-ordering rules.
Other than the order of sections, this should be NFC.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D135235
Maksim Panchenko [Tue, 4 Oct 2022 01:50:18 +0000 (18:50 -0700)]
[BOLT] Fix writing out unmarked .eh_frame section
When BOLT updates .eh_frame section, it concatenates newly-generated
contents (from CFI directives) with the original .eh_frame that has
relocations applied to it. However, if no new content is generated,
the original .eh_frame has to be left intact. In that case, BOLT was
still writing out the relocatable copy of the original .eh_frame section
to the new segment, even though this copy was never used and was not
even marked in the section header table.
Detect the scenario above and skip allocating extra space for .eh_frame.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D135223
Maksim Panchenko [Mon, 3 Oct 2022 23:01:01 +0000 (16:01 -0700)]
[BOLT] Properly set _end symbol
To properly set the "_end" symbol, we need to track the last allocatable
address. Simply emitting "_end" at the end of some section is not
sufficient since the order of section allocation is unknown during the
emission step.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D135121
Maksim Panchenko [Mon, 3 Oct 2022 23:53:34 +0000 (16:53 -0700)]
[BOLT][NFC] Remove text section assertion
We can emit a binary without a new text section. Hence, the text section
assertion is not needed.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D135120
Michael Jones [Wed, 5 Oct 2022 20:27:04 +0000 (13:27 -0700)]
[libc] add strsignal and refactor message mapping
The logic for strsignal and strerror is very similar, so I've moved them
both to use a shared utility (MessageMapper) for the basic
functionality.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D135322
Kadir Cetinkaya [Fri, 7 Oct 2022 18:05:47 +0000 (20:05 +0200)]
Arthur Eubanks [Fri, 7 Oct 2022 18:04:11 +0000 (11:04 -0700)]
[opt] Remove temporary legacy pass name translations
And update corresponding tests.
Michael Jones [Tue, 4 Oct 2022 23:47:24 +0000 (16:47 -0700)]
[libc] add strerror_r function
I've implemente the gnu variant of strerror_r since that seems to be the
one more relevant to what we're trying to do.
Differential Revision: https://reviews.llvm.org/D135227
Xiang Li [Wed, 5 Oct 2022 16:26:25 +0000 (09:26 -0700)]
[Docs] [HLSL] Add note about PCH support
PCH supported for HLSL is added when compile in -cc1 mode using -include-pch for test AST.
This change add some notes about the support of PCH for HLSL.
Reviewed By: beanz
Differential Revision: https://reviews.llvm.org/D134330
Shilei Tian [Fri, 7 Oct 2022 17:42:31 +0000 (13:42 -0400)]
[NFC] Remove trailing white space in openmp/libomptarget/src/CMakeLists.txt
Shilei Tian [Fri, 7 Oct 2022 17:30:31 +0000 (13:30 -0400)]
[Clang][OpenMP] Add one missing form of atomic compare capture
Two another atomic compare capture forms, `{ v = x; expr-stmt }` and `{ expr-stmt; v = x; }`
where `expr-stmt` could be `cond-expr-stmt` are missing.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D135236
Sanjay Patel [Fri, 7 Oct 2022 17:05:39 +0000 (13:05 -0400)]
[InstCombine] propagate 'exact' when converting ashr to lshr
The shift amount is not changing, so if we guaranteed
shifting out zeros before, those bits are still zeros.
https://alive2.llvm.org/ce/z/sokQca
Sanjay Patel [Fri, 7 Oct 2022 17:03:56 +0000 (13:03 -0400)]
[InstCombine] add tests for ashr exact; NFC
Sanjay Patel [Fri, 7 Oct 2022 15:38:25 +0000 (11:38 -0400)]
[InstCombine] add tests for sdiv-of-shl-1; NFC
Andrzej Warzynski [Wed, 27 Jul 2022 13:54:45 +0000 (13:54 +0000)]
[flang][nfc] Relocate a few driver tests
When the work on the Flang driver started, we created 2 test
directories:
* flang/test/Frontend/
* flang/test/Driver/
That was mostly done to model what Clang was doing. In practice, we
stopped using "flang/test/Frontend/" early on and most Flang driver
tests are currently located in "flang/test/Driver/". This patch moves
the remaining tests from the latter into the former directory.
This change also means that we can re-use test input files, i.e.
flang/test/Frontend/Inputs/hello-world.f90 can be replaced with
flang/test/Driver/Inputs/hello.f90. To this end, the affected test is
updated (multiple-input-files.f90).
Differential Revision: https://reviews.llvm.org/D130633
Florian Hahn [Fri, 7 Oct 2022 16:58:53 +0000 (17:58 +0100)]
Revert "[SCEV] Support clearing Block/LoopDispositions for a single value."
This reverts commit
9e931439ddb9b6b8f655940b9d8ed6db50c2a7e2.
This commit causes a crash when TSan, e.g. with
https://lab.llvm.org/buildbot/#/builders/70/builds/28309/steps/10/logs/stdio
Reverting while I extract a reproducer and submit a fix.
Ellis Hoag [Fri, 7 Oct 2022 16:27:40 +0000 (09:27 -0700)]
[InstrProf][llvm-profdata] Dump profile correlation data as YAML
Change the behavior of the `llvm-profdata show --debug-info=` command to dump a YAML file when using debug info correlation since it provides more information in a parseable format.
Reviewed By: yozhu, phosek
Differential Revision: https://reviews.llvm.org/D134770
Ellis Hoag [Tue, 4 Oct 2022 00:48:50 +0000 (17:48 -0700)]
[llvm-profdata] Add --output-format option
Add `--output-format` option for the `llvm-profdata show` command to select the type of output. The existing `--text` flag is used to emit text encoded profiles. To avoid confusion, `--output-format=text-encoding` indicates that the output will be profiles encoded in the text format, and `--output-format=text` indicates the default text output that doesn't necessarily represent a profile.
`--output-format=json` is an alias for `--json` and `--output-format=yaml` will be used in D134770.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D135127
Nicolas Vasilache [Fri, 7 Oct 2022 16:00:48 +0000 (09:00 -0700)]
[mlir][Linalg] Retire LinalgStrategyPadPass and filter-based pattern.
Context: https://discourse.llvm.org/t/psa-retire-linalg-filter-based-patterns/63785
Differential Revision: https://reviews.llvm.org/D135454
Joseph Huber [Fri, 7 Oct 2022 15:43:34 +0000 (10:43 -0500)]
[Libomptarget] Remove debug definitions DeviceRTL's CMake
These debugging definitions are no longer used in the new runtime. The
old runtime has been removed since Clang-14 so we can safely get rid of
these leftover variables.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D135452
Krzysztof Parzyszek [Thu, 6 Oct 2022 23:09:50 +0000 (16:09 -0700)]
[Hexagon] Formatting changes, NFC
Krzysztof Parzyszek [Thu, 6 Oct 2022 23:02:10 +0000 (16:02 -0700)]
[Hexagon] Add couple of helper functions in HexagonVectorCombine
1. `length(value/type)`: return the number of elements in the vector
input,
2. `getHvxTy(elem_type)`: return the HVX vector type with the element
type provided.
These will help write things more succintly.
Jacques Pienaar [Fri, 7 Oct 2022 16:05:49 +0000 (09:05 -0700)]
[mlir][doc] Remove trailing whitespace (NFC)
Nicolas Vasilache [Fri, 7 Oct 2022 15:27:17 +0000 (08:27 -0700)]
[mlir][Linalg] Retire LinalgStrategyDecomposePass and filter-based pattern.
Context: https://discourse.llvm.org/t/psa-retire-linalg-filter-based-patterns/63785
Differential Revision: https://reviews.llvm.org/D135450
Nicolas Vasilache [Fri, 7 Oct 2022 08:43:38 +0000 (01:43 -0700)]
[mlir][Transform] Add a transform.split_handles operation and fix general silenceable bugs.
The transform.split_handles op is useful for ensuring a statically known number of operations are
tracked by the source `handle` and to extract them into individual handles
that can be further manipulated in isolation.
In the process of making the op robust wrt to silenceable errors and the suppress mode, issues were
uncovered and fixed.
The main issue was that silenceable errors were short-circuited too early and the payloads were not
set. This resulted in suppressed silenceable errors not propagating correctly.
Fixing the issue triggered a few test failures: silenceable error returns now must properly set the results state.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D135426
Krzysztof Parzyszek [Thu, 6 Oct 2022 22:58:47 +0000 (15:58 -0700)]
[Hexagon] Add default parameter to HexagonVectorCombine::getIntTy, NFC
Krzysztof Parzyszek [Thu, 6 Oct 2022 22:51:15 +0000 (15:51 -0700)]
[Hexagon] Make HexagonSubtarget::isHVXVectorType take EVT instead of MVT
EVT can be created for any Type, and so this function can now be used to
check if given Type, as-is, is an HVX type (as opposed to a type that may
be subject to legalization to an HVX type).
Sanjay Patel [Fri, 7 Oct 2022 15:21:28 +0000 (11:21 -0400)]
[InstCombine] refactor sdiv by (negative) power-of-2 folds; NFCI
It's probably better to try harder on this kind of
pattern by using ValueTracking.
Sanjay Patel [Thu, 6 Oct 2022 20:19:56 +0000 (16:19 -0400)]
[InstCombine] add tests for udiv with common factor; NFC
Sanjay Patel [Thu, 6 Oct 2022 19:01:08 +0000 (15:01 -0400)]
[InstCombine] add tests for udiv with shift-left divisor; NFC
issue #58137
Kazu Hirata [Fri, 7 Oct 2022 15:27:02 +0000 (08:27 -0700)]
[AMDGPU] Fix a warning
This patch fixes:
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp:800:17:
error: unused variable 'DST_IDX' [-Werror,-Wunused-variable]
Krzysztof Parzyszek [Wed, 28 Sep 2022 21:58:15 +0000 (14:58 -0700)]
[Hexagon] Replace llvm::Optional with std::optional, NFC
Krzysztof Parzyszek [Tue, 27 Sep 2022 17:58:26 +0000 (10:58 -0700)]
[Hexagon] Constify member refererence, NFC
Yaxun (Sam) Liu [Fri, 7 Oct 2022 15:17:08 +0000 (11:17 -0400)]
Fix test bool-range.cu
Promoting kernel arg pointer to global addr space is only
available with registered amdgcn target.
Fix test so that it does not require registered amdgcn target.