Commit Graph

438287 Commits

Author SHA1 Message Date
Craig Topper f749b2d9a5 [RISCV] Fix incorrect parenthese placement in comment. NFC 2022-10-07 17:16:38 -07:00
Craig Topper 9f67047cf0 [VP][RISCV] Add vp.smax/smin/umax/umin intrinsics
Differential Revision: https://reviews.llvm.org/D135418
2022-10-07 17:14:31 -07:00
Jeff Bailey aa8ab5b213 [libc] Document which date funcs are needed/done
Reviewed By: rtenneti

Differential Revision: https://reviews.llvm.org/D135501
2022-10-08 00:06:22 +00:00
Kostya Serebryany ec96aea846 [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
2022-10-07 16:31:06 -07:00
Arthur Eubanks 47b1623b1f [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
2022-10-07 16:22:13 -07:00
Michael Jones 7c7f331a00 [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
2022-10-07 16:17:41 -07:00
Krzysztof Parzyszek 09d84e0ad8 [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.
2022-10-07 15:56:06 -07:00
Amaury Séchet 62ea6c5be7
[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
2022-10-08 00:55:14 +02:00
Jessica Paquette 42cb2f8b12 [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
2022-10-07 15:47:05 -07:00
Lang Hames 7c57a37c30 [JITLink][aarch64] Fix typo in error message. 2022-10-07 14:56:45 -07:00
Arthur Eubanks f3a928e233 [opt] Don't translate legacy -analysis flag to require<analysis>
Tests relying on this should explicitly use -passes='require<analysis>,foo'.
2022-10-07 14:54:34 -07:00
Maksim Panchenko 978f11c8e8 [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
2022-10-07 14:38:49 -07:00
Evgeny Shulgin c585a44651 [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
2022-10-07 21:31:38 +00:00
Pavel Chupin 27ef42bec8 Fix warnings in build done by clang-based compiler
Differential Revision: https://reviews.llvm.org/D135230
2022-10-07 14:12:10 -07:00
Artem Belevich 9a01cca660 Add support for CUDA-11.8 and sm_{87,89,90} GPUs.
Differential Revision: https://reviews.llvm.org/D135306
2022-10-07 13:59:28 -07:00
Artem Belevich f3a2cbcf97 Refactored CUDA version housekeeping to use less boilerplate.
Differential Revision: https://reviews.llvm.org/D135328
2022-10-07 13:59:23 -07:00
Arthur Eubanks c966da35df [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.
2022-10-07 13:50:16 -07:00
Florian Hahn 13ac102726
[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.
2022-10-07 21:35:42 +01:00
Evgeny Shulgin 0edff6faa2 [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
2022-10-07 20:27:17 +00:00
Matt Arsenault 74ef03d38a 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.
2022-10-07 13:15:15 -07:00
Matt Arsenault 7721cba2ee llvm-reduce: Fix another invalid reduction with repeated input phis
ReduceOperandsSkip had the same issue as ReduceOperands when handling
phis with repeated predecessors.
2022-10-07 13:15:15 -07:00
Matt Arsenault 0a159427ad 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.
2022-10-07 13:15:15 -07:00
Matt Arsenault 023f24d893 llvm-reduce: Use -abort-on-invalid-reduction in a test
Also stop using cat
2022-10-07 13:15:14 -07:00
Matt Arsenault 3a25b21c4e llvm-reduce: Fix missing C++ mode comments 2022-10-07 13:15:14 -07:00
Lei Zhang d32df0f63d [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
2022-10-07 19:51:59 +00:00
Florian Hahn d227029ce4
[ConstraintElimination] Add test for regression after 3771310eed. 2022-10-07 20:42:16 +01:00
Florian Hahn 19ad1cd5ce
Recommit "[SCEV] Support clearing Block/LoopDispositions for a single value."
This reverts commit 92f698f01f.

The updated version of the patch includes handling for non-SCEVable
types. A test case has been added in ec86e9a99b.
2022-10-07 20:15:44 +01:00
Matthew Voss fe50eac85c [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
2022-10-07 12:05:25 -07:00
Florian Hahn ec86e9a99b
[LoopUnroll] Add test for crash exposed by 9e931439. 2022-10-07 20:02:58 +01:00
Arthur Eubanks 37122c722b [opt] Remove -passes=asan-pipeline
It was obsoleted when the asan pass was changed to just be one module pass.
2022-10-07 11:56:02 -07:00
Philip Reames cb66e123c6 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
2022-10-07 11:51:00 -07:00
Arthur Eubanks d3d8465446 [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.
2022-10-07 11:50:43 -07:00
Ellis Hoag ea607d033a [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
2022-10-07 11:35:07 -07:00
Rafael Auler 696b8ea05f [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 729d29e167.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D125941
2022-10-07 11:27:23 -07:00
Michael Jones 07c0a41b53 [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
2022-10-07 11:25:25 -07:00
Maksim Panchenko 5fca9c5763 [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
2022-10-07 11:20:42 -07:00
Maksim Panchenko 0b213c9090 [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
2022-10-07 11:19:51 -07:00
Maksim Panchenko c683e281cd [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
2022-10-07 11:19:14 -07:00
Maksim Panchenko 3e097fab5a [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
2022-10-07 11:18:37 -07:00
Michael Jones 07793f95c4 [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
2022-10-07 11:11:53 -07:00
Kadir Cetinkaya bb4f0af97d
[clangd] Fix buildbots after d1f13c54f1 2022-10-07 20:10:32 +02:00
Arthur Eubanks c384b20b55 [opt] Remove temporary legacy pass name translations
And update corresponding tests.
2022-10-07 11:09:46 -07:00
Michael Jones a9f95b769e [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
2022-10-07 11:07:06 -07:00
Xiang Li 6a6f10fd23 [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
2022-10-07 10:49:21 -07:00
Shilei Tian 395d261de7 [NFC] Remove trailing white space in openmp/libomptarget/src/CMakeLists.txt 2022-10-07 13:42:31 -04:00
Shilei Tian 4cdfab12bb [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
2022-10-07 13:30:38 -04:00
Sanjay Patel 3e6767ed5f [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
2022-10-07 13:17:19 -04:00
Sanjay Patel 5e896628b7 [InstCombine] add tests for ashr exact; NFC 2022-10-07 13:16:55 -04:00
Sanjay Patel 9520fca46e [InstCombine] add tests for sdiv-of-shl-1; NFC 2022-10-07 13:16:55 -04:00
Andrzej Warzynski 49acab3f14 [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
2022-10-07 17:04:06 +00:00