Youling Tang [Sat, 10 Dec 2022 03:50:35 +0000 (11:50 +0800)]
[sanitizer] Fix the internal_clone implementation on loongarch
Fix syscall clone argument passing order, also `call fn(arg)` should
return, change `jr $a5`(jirl $zero, $a5, 0) to `jirl $ra, $a5, 0`.
Reviewed By: SixWeining
Differential Revision: https://reviews.llvm.org/D139619
Youling Tang [Sat, 10 Dec 2022 03:48:12 +0000 (11:48 +0800)]
[safestack] Enable loongarch64
Enable safestack on loongarch64.
Some test cases will fail on loongarch, it will be fixed in glibc,
Links: https://sourceware.org/pipermail/libc-alpha/2022-November/143641.html
Reviewed By: #sanitizers, SixWeining, vitalybuka
Differential Revision: https://reviews.llvm.org/D139494
Kazu Hirata [Sat, 10 Dec 2022 03:47:16 +0000 (19:47 -0800)]
[libc] Use std::nullopt instead of None (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
gonglingqin [Sat, 10 Dec 2022 02:26:06 +0000 (10:26 +0800)]
[LoongArch] Add testcases for privileged intrinsic macros
Add testcases calling macros to the implemented privileged intrinsics
as discussed in D139288. The intrinsics involved include ibar, dbar,
break, syscall, and CRC check intrinsics.
Differential Revision: https://reviews.llvm.org/D139397
Konstantin Varlamov [Sat, 10 Dec 2022 03:32:18 +0000 (19:32 -0800)]
[libc++][ranges][NFC] Update Ranges status.
Add a link to an in-progress patch.
Kazu Hirata [Sat, 10 Dec 2022 03:14:05 +0000 (19:14 -0800)]
[libc] Use std::nullopt instead of None (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Austin Kerbow [Fri, 2 Dec 2022 20:32:02 +0000 (12:32 -0800)]
[AMDGPU] Update MFMASmallGemmOpt with better performing stategy
Based on experiments this does better with target small GEMM kernels.
Reviewed By: jrbyrnes
Differential Revision: https://reviews.llvm.org/D139227
Kazu Hirata [Sat, 10 Dec 2022 02:39:01 +0000 (18:39 -0800)]
[clang] Use std::nullopt instead of None in comments (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Kazu Hirata [Sat, 10 Dec 2022 02:32:33 +0000 (18:32 -0800)]
[flang] Use std::nullopt instead of llvm::None (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Kazu Hirata [Sat, 10 Dec 2022 02:32:31 +0000 (18:32 -0800)]
[llvm] Use std::nullopt instead of None (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Jakub Kuderski [Sat, 10 Dec 2022 01:25:31 +0000 (20:25 -0500)]
[mlir][arith] Define mulsi_extended op
Extend D139688 with the signed version of the extended multiplication
op. Add conversion to the SPIR-V and LLVM dialects.
This was originally proposed in:
https://discourse.llvm.org/t/rfc-arith-add-extended-multiplication-ops/66869.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D139743
Dominic Chen [Sat, 10 Dec 2022 01:15:47 +0000 (17:15 -0800)]
[scudo] Enable more warnings for standalone build
Differential Revision: https://reviews.llvm.org/D122761
Craig Topper [Sat, 10 Dec 2022 01:00:29 +0000 (17:00 -0800)]
[RISCV] clang-format lowerReductionSeq. NFC
Wraps a long line to 80 columns.
Yeting Kuo [Sat, 10 Dec 2022 01:01:47 +0000 (09:01 +0800)]
[LangRef] Fix typo. NFC.
bswap is an unary operation.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D139751
Craig Topper [Sat, 10 Dec 2022 00:21:33 +0000 (16:21 -0800)]
[RISCV] Simplify RISCVSubtarget. NFC
The flags, initialization of the flags, and the getter methods for
features defined in RISCV.td can be generated by TableGen.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D139746
Peiming Liu [Fri, 9 Dec 2022 23:21:09 +0000 (23:21 +0000)]
[mlir][sparse] avoid sorting when unnecessary when convert sparse tensors.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D139744
LLVM GN Syncbot [Fri, 9 Dec 2022 23:21:59 +0000 (23:21 +0000)]
[gn build] Port
ec3f8feddf81
Abraham Corea Diaz [Fri, 9 Dec 2022 22:38:34 +0000 (22:38 +0000)]
[Clang-Tidy] Empty Check
Adds a clang-tidy check for the incorrect use of `empty()` on a
container when the result of the call is ignored.
Authored-by: Abraham Corea Diaz <abrahamcd@google.com>
Co-authored-by: Denis Nikitin <denik@google.com>
Reviewed By: cjdb
Differential Revision: https://reviews.llvm.org/D128372
Ryan Prichard [Fri, 9 Dec 2022 23:15:22 +0000 (15:15 -0800)]
[Headers][ARM] Allow `struct _Unwind_Exception` in unwind.h
Use the same approach as used in libunwind/include/unwind_arm_ehabi.h
(D89570) and GCC's unwind-arm-common.h, so that _Unwind_Exception can be
used both with and without the struct tag.
Fixes a build failure in libcxxabi/test/forced_unwind1.pass.cpp.
Reviewed By: danielkiss
Differential Revision: https://reviews.llvm.org/D139503
Ryan Prichard [Fri, 9 Dec 2022 23:15:16 +0000 (15:15 -0800)]
[libc++][Android] Disable pbump2gig for Android
Android devices frequently don't have enough memory to run this test.
e.g. On the API 33 x86-64 emulator with 2GiB RAM, the test triggers the
OOM Killer, the device reboots, and then `adb shell` exits with status
0 and no output.
Reviewed By: danalbert, #libc, Mordante
Differential Revision: https://reviews.llvm.org/D139502
Ryan Prichard [Fri, 9 Dec 2022 23:14:42 +0000 (15:14 -0800)]
[libc++][Android] Android/Bionic headers don't work with modules yet
The current Android headers don't appear to work with modules. We may
want to fix them eventually.
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D139498
Ryan Prichard [Fri, 9 Dec 2022 23:14:04 +0000 (15:14 -0800)]
[libc++][Android] Include cstdlib to define __BIONIC__
__ANDROID__ is a built-in compiler macro, but __BIONIC__ is defined by
the libc header.
Reviewed By: #libc_abi, compnerd
Differential Revision: https://reviews.llvm.org/D137128
Stefan Pintilie [Fri, 9 Dec 2022 23:00:42 +0000 (17:00 -0600)]
[NFC][Assignment Tracking Analysis] Stop failing test from running on PPC.
The test remove-undef-fragment.ll fails on the PPC bots. I've disabled the test
everywhere except X86 to allow for the investigation of the issue.
SaeHie Park [Fri, 9 Dec 2022 22:51:36 +0000 (14:51 -0800)]
[mlir] Remove double 'the' in comment (NFC)
Remove the double 'the' in the comment for 'getInsertionBlock()'.
Reviewed By: jpienaar, rriddle
Differential Revision: https://reviews.llvm.org/D139605
Jakub Kuderski [Fri, 9 Dec 2022 22:37:05 +0000 (17:37 -0500)]
[mlir][arith] Define mului_extended op
Add conversion to the SPIR-V and LLVM dialects.
This was originally proposed in:
https://discourse.llvm.org/t/rfc-arith-add-extended-multiplication-ops/66869.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D139688
Michael Jones [Thu, 1 Sep 2022 22:19:35 +0000 (15:19 -0700)]
[libc] add result class to strtointeger
This is a class intended to improve errno handling for internal
functions by allowing functions to return their result and error status
instead of setting errno. This specific class will be used for
strtointeger and (in a followup patch) strtofloat.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D133163
Johannes Doerfert [Fri, 9 Dec 2022 22:13:52 +0000 (14:13 -0800)]
[OpenMP][FIX] Do not use reachability reasoning in parallel contexts
Similar to dominance reasoning, we cannot use CFG reachability if the
instructions might be executed by different threads. A follow up will
improve our sensitivity for situations when it is OK to use graph
reasoning.
Arthur Eubanks [Fri, 9 Dec 2022 22:17:37 +0000 (14:17 -0800)]
Revert "Implement CWG2631"
This reverts commit
c9a6713b4788f10b81202b70993068e475b392f7.
Causes crashes, see D136554.
Florian Hahn [Fri, 9 Dec 2022 22:14:03 +0000 (22:14 +0000)]
[SCEV] Cache ZExt SCEV expressions.
When creating SCEV expressions for ZExt, there's quite a bit of
reasoning done and in many places the reasoning in turn will try to
create new SCEVs for other ZExts.
This can have a huge compile-time impact. The attached test from #58402
takes an excessive amount of compile time; without the patch, the test
doesn't complete in 1500+ seconds, but with the patch it completes in 1
second.
To speed up this case, cache created ZExt expressions for given (SCEV, Ty) pairs.
Caching just ZExts is relatively straight-forward, but it might make
sense to extend it to other expressions in the future.
This has a slight positive impact on CTMark:
* O3: -0.03%
* ReleaseThinLTO: -0.03%
* ReleaseLTO-g: 0.00%
https://llvm-compile-time-tracker.com/compare.php?from=
bf9de7464946c65f488fe86ea61bfdecb8c654c1&to=
5ac0108553992fb3d58bc27b1518e8cf06658a32&stat=instructions:u
The patch also improves compile-time for some internal real-world workloads
where time spent in SCEV goes from ~300 seconds to ~3 seconds.
There are a few cases where computing & caching the result earlier may
return more pessimistic results, but the compile-time savings seem to
outweigh that.
Fixes #58402.
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D137505
Kai Nacke [Fri, 9 Dec 2022 20:26:17 +0000 (15:26 -0500)]
[SystemZ][NFC] Simplify SystemZSubtarget
The flags, initialization of the flags, and the getter methods for
features defined in SystemZFeatures.td can be generated by TableGen.
Reviewed By: uweigand
Differential Revision: https://reviews.llvm.org/D139738
Tom Eccles [Fri, 9 Dec 2022 21:20:42 +0000 (21:20 +0000)]
[flang] Skip fast_math linker test on powerpc
Related to https://reviews.llvm.org/D138675
Philip Reames [Fri, 9 Dec 2022 19:56:20 +0000 (11:56 -0800)]
[RISCV] Share reduction lowering code for vp.reduce
We can consolidate code and clarify edge case behavior at the same time.
There are two functional differences here.
First, I remove the ResVT handling, and always use the reduction element type. This appears to be dead code. There's no test coverage, and this code doesn't need to account for scalar type legalization anyways.
Second, if the VL happens to be known non-zero, we can avoid passing through start. This is mostly needed to allow reuse of the existing code; I don't consider it interesting as an optimization on it's own.
Differential Revision: https://reviews.llvm.org/D139733
Ariel Burton [Fri, 9 Dec 2022 20:04:27 +0000 (20:04 +0000)]
Allow epilogue_begin to be emitted when generating DWARF
We identify epilogue code by looking for instructions tagged
with FrameDestroy.
A function may have more than one epilogue, e.g., because of early
returns or code duplicated during optimization. We need only track
the current block, and emit epilogie_begin at most once per block.
We reduce the number of entries in the line table by combining
epilogue_begin with other flags instead of emitting a separate
entry just for epilogue_begin.
Reviewed By: dblaikie, aprantl
Differential Revision: https://reviews.llvm.org/D133376
Steven Wu [Fri, 9 Dec 2022 20:14:42 +0000 (12:14 -0800)]
[CodeView][Test] Fix module build by removing unused header
Remove unnecessary header from CodeView unittest. The unused PDB header
include has a dependency on Object -> Bitcode -> intrinsics_gen, which
will fail the module build because the module needed to build the tests
rely on the intrinsics gen.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D139724
Vy Nguyen [Fri, 9 Dec 2022 20:07:08 +0000 (15:07 -0500)]
Revert "Reland [lld-macho] Fix bug in reading cpuSubType field."
This reverts commit
f472da190b65a1db2512960ee5334889a6663aef.
Tom Eccles [Wed, 19 Oct 2022 13:19:28 +0000 (13:19 +0000)]
[flang] Add -ffast-math and -Ofast
clang -cc1 accepts -Ofast. I did not add it to flang -fc1 because this
seems redundant because the compiler driver will always resolve -Ofast
into -O3 -ffast-math (I added a test for this).
-menable-infs is removed from the frontend-forwarding test because if
all of the fast-math component flags are present, these will be resolved
into the fast-math flag. Instead -menable-infs is tested in the
fast-math test.
Specifying -ffast-math to the compiler driver causes linker invocations
to include crtfastmath.o.
RFC: https://discourse.llvm.org/t/rfc-the-meaning-of-ofast/66554
Differential Revision: https://reviews.llvm.org/D138675
Paul Robinson [Fri, 9 Dec 2022 19:52:47 +0000 (11:52 -0800)]
[LLD] Convert a test to use 'target=...' instead of triple check
Part of the project to eliminate special handling for triples in lit
expressions.
Chris Bieneman [Fri, 9 Dec 2022 19:29:46 +0000 (13:29 -0600)]
Move Clang's per-suite test targets into a folder
Putting these under a folder allows the CMake integraiton for IDEs to
sort the per-suite targets under a folder nested under the clang tests.
Chris Bieneman [Fri, 9 Dec 2022 19:27:49 +0000 (13:27 -0600)]
Resolve possible test failure on Windows
If dr0xx.c's timestamp is newer than dr324.c the preprocessor will issue
an unexpected diagnostic in dr324.c. To prevent this diagnostic we can
have dr324.c run touch against itself to force its timestamp to be new.
Jakub Kuderski [Fri, 9 Dec 2022 19:40:04 +0000 (14:40 -0500)]
[mlir][arith] Add canon pattern: addui_extended -> addi
Demote `arith.addui_extended` to `arith.addi` when the 'overflow'
result has no uses.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D139722
Philip Reames [Fri, 9 Dec 2022 19:24:01 +0000 (11:24 -0800)]
[LV] Account for minimum vscale when rejecting scalable vectorization of short loops
The vectorizer has code to reject scalable vectorization of loops with very short trip counts, and instead use fixed length vectors. The current code doesn't account for the minimum vscale value known, and thus under estimates the number of lanes in the scalable type for RISCV's default configuration. This results in use of predication and a trivially dead loop where a single straight line piece of code would suffice.
Note that the code quality of the original scalable vectorization could (and probably should) be improved other ways as well. This patch is solely about whether the scalable vectorization was the right choice to begin with.
This bit of code - both with and without my change - does make the unchecked assumption that the target knows how to lower fixed length vectors whose length is provably less than the vector length.
Differential Revision: https://reviews.llvm.org/D137285
Matt Arsenault [Fri, 9 Dec 2022 19:11:02 +0000 (14:11 -0500)]
AMDGPU: Erase llvm.global_ctors/global_dtors after lowering
We should be able to run the pass multiple times without breaking
anything. If we still need to track these for some reason, we could
replace with new entries for the kernels.
Chris Bieneman [Fri, 9 Dec 2022 19:15:34 +0000 (13:15 -0600)]
[NFC][DX] Update test case to use new opt flags
The legacy `-<pass>` options are now erroring out. This updates to the
new pass manager option.
Chris Bieneman [Fri, 9 Dec 2022 17:57:07 +0000 (11:57 -0600)]
[NFC] Update DXContainer tests to use fake parts
The tests that are focused on testing the file structure should use
fake part names so that the errors get triggered consistently. As we
add parsing support for known data types and structures under the parts
the parsing errors change to be more semantically accurate.
This change ensures the general errors continue to work with less churn
on the test cases in the future.
Jim Ingham [Thu, 8 Dec 2022 19:00:08 +0000 (11:00 -0800)]
Fix GetAddressOf for children of pointer ValueObjectConstResult* variables.
The original code always set the m_live_address of children of the ValueObjects that
use ValueObjectConstResultImpl backends to the parent m_live_address + child_byte_offset.
That is correct for structure types, but wrong for pointer types, since m_live_address
for a pointer type is the address of the storage for the pointer, not of the pointee.
Also added a test which was failing before this patch.
Vy Nguyen [Fri, 9 Dec 2022 14:06:43 +0000 (09:06 -0500)]
Reland [lld-macho] Fix bug in reading cpuSubType field.
This reverts commit
66692c822aee47baa2cb71f92090d58a8dc01116.
New changes:
- update test to require aarch64
- update test to not hard-code cpu[sub] type values (since they could change)
- update test to temporarily skip windows (because llvm-mc on windows doesn't seem to work with triple arm64-apple-macos)
Differential Revision: https://reviews.llvm.org/D139572
Heejin Ahn [Wed, 30 Nov 2022 23:37:29 +0000 (15:37 -0800)]
[WebAssembly] Nullify dangling register DBG_VALUEs
Register-based `DBG_VALUE` should have been
converted into either local-based or stack-operand-based, so at this
point they don't contain any information.
This CL nullifies them, i.e., turning them info
`DBG_VALUE $noreg, $noreg, ...`, which makes the variable appear as
"optimized out". It is not safe to simply remove these instruction
because at this point, because the fact that there is a `DBG_VALUE` here
means the location this variable resides has changed to somewhere else;
we've lost that information where that was.
---
The below is not really about the CL itself, but a pre-existing bug in
`llvm-locstats` variable coverage we are going to be affected after this
CL. Feel free to skip if you don't have time.
This CL has an unexpected side effect of increasing variable coverage
reported by `llvm-locstats`, due to a bug mentioned in
https://lists.llvm.org/pipermail/llvm-dev/2021-January/148139.html.
Currently inlined functions' formal parameters that don't have any
coverage, including those who only have `DBG_VALUE $noreg, $noreg`s
associated with them, don't generate `DW_TAG_formal_parameter` DIEs, and
they don't get into consideration in `llvm-dwarf --statistics` and
`llvm-locstats`. This is a known bug mentioned in
https://lists.llvm.org/pipermail/llvm-dev/2021-January/148139.html. For
example, this is a snippet of `llvm-dwarfdump` output of `wc`, where
`isword` is inlined into another function. `isword` has a formal
parameter `c`, which doesn't have any coverage in this inlined area, so
its `DW_TAG_formal_parameter` was not generated:
```
0x0000018d: DW_TAG_inlined_subroutine
DW_AT_abstract_origin (0x0000012c "isword")
DW_AT_low_pc (0x00000166)
DW_AT_high_pc (0x0000016d)
DW_AT_call_file ("/usr/local/google/home/aheejin/test/dwarf-verify/wc/wc.c")
DW_AT_call_line (100)
DW_AT_call_column (0x0a)
```
But our dangling-register-based formal parameters currently generate
`DW_TAG_formal_parameter` DIEs, even though they don't have any
meaningful coverage, and this happened to generate correct statistics,
because it correctly sees this `c` doesn't have any coverage in this
inlined area. So our current `llvm-dwarfdump` (before this CL) is like:
```
0x0000018d: DW_TAG_inlined_subroutine
DW_AT_abstract_origin (0x0000012c "isword")
DW_AT_low_pc (0x00000166)
DW_AT_high_pc (0x0000016d)
DW_AT_call_file ("/usr/local/google/home/aheejin/test/dwarf-verify/wc/wc.c")
DW_AT_call_line (100)
DW_AT_call_column (0x0a)
0x0000019a: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x00000134 "c")
```
Note that this `DW_TAG_formal_parameter` doesn't have any
`DW_AT_location` attribute under it, meaning it doesn't have any
coverage.
On the other hand, if the `DW_TAG_formal_parameter` is not generated,
`llvm-dwarfdump --statistics` wouldn't even know about the parameter's
existence, and doesn't include it in the coverage computation, making
the overall coverage (incorrectly) go up.
`DBG_VALUE $noreg, $noreg` used to generate this empty
`DW_TAG_formal_parameter`, but it changed for consistency in D95617.
It looks this bug in `llvm-dwarf --statistics` (and `llvm-locstats`,
which uses `llvm-dwarf --statistics`) has not been fixed so far. So we
get the coverage that's little incorrectly higher than our actual
coverage. But this bug apparently affects every target in LLVM.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D139675
Jim Ingham [Fri, 9 Dec 2022 01:23:04 +0000 (17:23 -0800)]
Switch the "command script add" interactive input to use the new command form.
We're suggesting people use the form of the command that takes an exe_ctx - it
is both more convenient and more correct - since you should not be using
GetSelected{Target, Process, etc.} in commands.
Yitzhak Mandelbaum [Wed, 7 Dec 2022 16:03:37 +0000 (16:03 +0000)]
[clang][dataflow] Add support for structured bindings of tuple-like types.
This patch adds interpretation of binding declarations resulting from a
structured binding (`DecompositionDecl`) to a tuple-like type. Currently, the
framework only supports binding to a struct.
Fixes issue #57252.
Differential Revision: https://reviews.llvm.org/D139544
Heejin Ahn [Wed, 7 Dec 2022 18:51:06 +0000 (10:51 -0800)]
[WebAssembly] Print DEBUG_VALUE once for target indices
`DEBUG_VALUE` comments are printed before an instruction, so they are
not printed with `AddComment` method as other comments are, but printed
using `emitRawComment` method. But currently `emitDebugValueComment`
calls `emitRawComment` twice for target-index-based `DBG_VALUE`s: once
in the `switch`-`case`,
https://github.com/llvm/llvm-project/blob/
d77ae7f2513504655e555cd326208598093d66e2/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L1192-L1193
and again at the end of the method:
https://github.com/llvm/llvm-project/blob/
d77ae7f2513504655e555cd326208598093d66e2/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L1227-L1228
This makes them printed twice. I think this happened through multiple
commits modifying and refactoring this method.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D139579
Matt Arsenault [Fri, 9 Dec 2022 18:33:30 +0000 (13:33 -0500)]
AMDGPU: Port AMDGPUCtorDtorLowering to new PM
Yifan Yang [Fri, 9 Dec 2022 18:30:47 +0000 (13:30 -0500)]
Add the thread sanitizer support for X86_64 WatchOS simulators
Allow TSan in clang driver for X86_64 WatchOS simulator.
It was already functional, and Apple's downstream fork of clang allows it, but that change had not made it upstream yet.
Reviewed By: jyknight, yln
Differential Revision: https://reviews.llvm.org/D139652
Matt Arsenault [Fri, 9 Dec 2022 18:22:12 +0000 (13:22 -0500)]
AMDGPU: Fix not emitting code for exotic constructor types
This was simply ignoring any entries that weren't direct function
calls. This really should have been erroring on anything
unexpected. We should be able to handle calling just about anything
these days, so just call anything.
OCHyams [Fri, 9 Dec 2022 17:07:19 +0000 (17:07 +0000)]
[Assignment Tracking] Update TODO list in docs
Chi Chun Chen [Fri, 9 Dec 2022 17:06:45 +0000 (11:06 -0600)]
Revert "[OpenMP] Clang Support for taskwait nowait clause"
This reverts commit
100dfe7a8ad3789a98df623482b88d9a3a02e176.
Vitaly Buka [Fri, 9 Dec 2022 16:59:03 +0000 (08:59 -0800)]
[NFC][scudo] Fix warnings in tests after D139430
Jakub Kuderski [Fri, 9 Dec 2022 16:55:25 +0000 (11:55 -0500)]
[mlir][arith] Update addui_extended naming in canon tests. NFC.
Update some arith canonicalization tests to follow the new naming
convention for `arith.addui_extened`. I missed this in the original
patch that did the renaming: D139569.
Saleem Abdulrasool [Fri, 9 Dec 2022 16:58:15 +0000 (16:58 +0000)]
Sema: diagnose PMFs passed through registers to inline assembly
The itanium ABI represents the PMF as a pair of pointers. As such the
structure cannot be passed through a single register. Diagnose such
cases in the frontend rather than trying to generate IR to perform this
operation.
Fixes: 59033
Differential Revision: https://reviews.llvm.org/D13851
Reviewed By: aaron.ballman
Petar Avramovic [Fri, 9 Dec 2022 16:55:31 +0000 (17:55 +0100)]
AMDGPU: Check if operand RC contains register used when printing
Disassembler can successfully decode sgpr register when only vgpr
registers are valid for the operand (e.g. VReg_* and VISrc_* operands).
In InstPrinter, detect when operand register class does not contain
register that is being printed. Does not result in an error.
Intended use is for disassembler tests.
Differential Revision: https://reviews.llvm.org/D139646
Petar Avramovic [Fri, 9 Dec 2022 16:45:37 +0000 (17:45 +0100)]
AMDGPU: Precommit wmma tests for D139646
LLVM GN Syncbot [Fri, 9 Dec 2022 16:40:46 +0000 (16:40 +0000)]
[gn build] Port
1d1de7467c32
OCHyams [Fri, 9 Dec 2022 16:37:48 +0000 (16:37 +0000)]
Fix compile error in unittests after
1d1de7467c32d52926ca56b9167a2c65c451ecfa
Build-bot failure: https://lab.llvm.org/buildbot/#/builders/139/builds/32477
commit
1d1de7467c32d52926ca56b9167a2c65c451ecfa (HEAD -> main, origin/main)
Author: OCHyams <orlando.hyams@sony.com>
Date: Fri Dec 9 15:43:56 2022 +0000
Krzysztof Parzyszek [Fri, 9 Dec 2022 02:08:32 +0000 (20:08 -0600)]
[STLExtras] Convert deref_or_none and zip_longest to std::optional
Philip Reames [Fri, 9 Dec 2022 16:17:44 +0000 (08:17 -0800)]
[RISCV] Consolidate a bit of common logic for forming reductions
There's several patches in flght which change this code, better to only have one copy.
The VP case is left seperate for the moment as the result value type differs.
OCHyams [Fri, 9 Dec 2022 15:43:56 +0000 (15:43 +0000)]
[Assignment Tracking][Analysis] Add analysis pass
The Assignment Tracking debug-info feature is outlined in this RFC:
https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir
Add initial revision of assignment tracking analysis pass
---------------------------------------------------------
This patch squashes five individually reviewed patches into one:
#1 https://reviews.llvm.org/D136320
#2 https://reviews.llvm.org/D136321
#3 https://reviews.llvm.org/D136325
#4 https://reviews.llvm.org/D136331
#5 https://reviews.llvm.org/D136335
Patch #1 introduces 2 new files: AssignmentTrackingAnalysis.h and .cpp. The
two subsequent patches modify those files only. Patch #4 plumbs the analysis
into SelectionDAG, and patch #5 is a collection of tests for the analysis as
a whole.
The analysis was broken up into smaller chunks for review purposes but for the
most part the tests were written using the whole analysis. It would be possible
to break up the tests for patches #1 through #3 for the purpose of landing the
patches seperately. However, most them would require an update for each
patch. In addition, patch #4 - which connects the analysis to SelectionDAG - is
required by all of the tests.
If there is build-bot trouble, we might try a different landing sequence.
Analysis problem and goal
-------------------------
Variables values can be stored in memory, or available as SSA values, or both.
Using the Assignment Tracking metadata, it's not possible to determine a
variable location just by looking at a debug intrinsic in
isolation. Instructions without any metadata can change the location of a
variable. The meaning of dbg.assign intrinsics changes depending on whether
there are linked instructions, and where they are relative to those
instructions. So we need to analyse the IR and convert the embedded information
into a form that SelectionDAG can consume to produce debug variable locations
in MIR.
The solution is a dataflow analysis which, aiming to maximise the memory
location coverage for variables, outputs a mapping of instruction positions to
variable location definitions.
API usage
---------
The analysis is named `AssignmentTrackingAnalysis`. It is added as a required
pass for SelectionDAGISel when assignment tracking is enabled.
The results of the analysis are exposed via `getResults` using the returned
`const FunctionVarLocs *`'s const methods:
const VarLocInfo *single_locs_begin() const;
const VarLocInfo *single_locs_end() const;
const VarLocInfo *locs_begin(const Instruction *Before) const;
const VarLocInfo *locs_end(const Instruction *Before) const;
void print(raw_ostream &OS, const Function &Fn) const;
Debug intrinsics can be ignored after running the analysis. Instead, variable
location definitions that occur between an instruction `Inst` and its
predecessor (or block start) can be found by looping over the range:
locs_begin(Inst), locs_end(Inst)
Similarly, variables with a memory location that is valid for their lifetime
can be iterated over using the range:
single_locs_begin(), single_locs_end()
Further detail
--------------
For an explanation of the dataflow implementation and the integration with
SelectionDAG, please see the reviews linked at the top of this commit message.
Reviewed By: jmorse
Sanjay Patel [Fri, 9 Dec 2022 15:58:27 +0000 (10:58 -0500)]
[InstCombine] allow more fast-math-flags to propagate in fneg-of-select fold
We were conservatively intersecting flags, but we can take the union here
because forbidden special values (nsz/nnan/ninf) are not altered by fneg.
So if they were guaranteed not present on the select or fneg, then they
are guaranteed not present on the new select. Alive2 appears to agree on
the test diffs (reduced to not include irrelevant flags like reassoc):
https://alive2.llvm.org/ce/z/ViqqrO
This prevents a potential regression if we tighten up the FMF behavior
for fabs with NAN as suggested in issue #59279.
Nico Weber [Fri, 9 Dec 2022 15:55:22 +0000 (10:55 -0500)]
[gn build] Unbreak link after
9ebaf4fef4aac89
9ebaf4fef4aac89 removed one of two redundant deps in CMake, but it removed the
one dep in the GN build. Since the CMake build still has the dep, so should the
GN build. (Things don't link without it.)
Nicolas Vasilache [Fri, 9 Dec 2022 12:02:28 +0000 (04:02 -0800)]
[mlir][Linalg] Apply fixes to TileReductionUsingForeachThreadOp
In the process, numerous insertion point issues were found and fixed.
RAII on insertion points is now used more dilligently.
Differential Revision: https://reviews.llvm.org/D139714
David Spickett [Fri, 9 Dec 2022 15:21:28 +0000 (15:21 +0000)]
Revert "[mlir] FunctionOpInterface: make get/setFunctionType interface methods"
and "[mlir] Fix examples build"
This reverts commit
fbc253fe81da4e1d6bfa2519e01e03f21d8c40a8 and
96cf183bccd7d1c3083f169a89a6af1f263b3aae.
Which I missed in the first revert in
f3379feabe38fd3711b13ffcf6de4aab03b7ccdc.
Paul Robinson [Fri, 9 Dec 2022 15:24:16 +0000 (07:24 -0800)]
[MLIR/S90x] Convert tests to check 'target=...'
Part of the project to eliminate special handling for triples in lit
expressions.
Daniel Kiss [Fri, 9 Dec 2022 15:23:10 +0000 (16:23 +0100)]
[AArch64][NFC] Move hasFeature fields initiations to the declaration
hasFeature fields need to be initialised to false. Easy to miss as missed for hasPAuth and hasFlagM.
Maybe the code less error prone like this.
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D139622
Nikita Popov [Fri, 9 Dec 2022 15:17:45 +0000 (16:17 +0100)]
[BasicAA] Handle phi with itself as incoming value
We can skip such incoming values. This was already done by
PhiValues if present, but we can also do this without the
additional analysis.
Nikita Popov [Fri, 9 Dec 2022 15:14:07 +0000 (16:14 +0100)]
[BasicAA] Add test for phi that contains itself (NFC)
This currently produces a better result with PhiValues.
Valentin Clement [Fri, 9 Dec 2022 14:59:59 +0000 (15:59 +0100)]
[flang] Handle correctly polymorphic descriptor for IO input
Polymorphic entities are already emboxed. Just update
the code to use `BaseBoxType` instead of `BoxType`.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D139707
Nikita Popov [Fri, 9 Dec 2022 15:05:31 +0000 (16:05 +0100)]
[BasicAA] Convert test to opaque pointers (NFC)
Alexandros Lamprineas [Fri, 9 Dec 2022 11:05:03 +0000 (11:05 +0000)]
[IPSCCP] Move the IPSCCP run function under the IPO directory.
Reland
42c2dc401742266da3e0251b6c1ca491f4779963 which was reverted
in
cb03b1bd99313a728d47060b909a73e7f5991231. The fix for the link
errors was to reintroduce one of the two occurences of 'Scalar'
under the LINK_COMPONENTS.
Differential Revision: https://reviews.llvm.org/D138654
Simon Pilgrim [Fri, 9 Dec 2022 15:03:11 +0000 (15:03 +0000)]
[TableGen] Add a !listremove() bang operator
This patch proposes to add a !listremove() bang operator to allow us to prune list entries by removing any entries from the first list arg that are also contained in the second list arg.
The particular use case I have in mind is for improved analysis of x86 scheduler models for which I'm hoping to start using the CodeGenProcModel 'Unsupported' features lists, which lists the ISA features a particular model DOESN'T support - with such a diverse and growing list of x86 ISAs, I don't want to have to update all these lists with every ISA change to every model - so I'm intending to keep a single central list of all x86 features, and then have the each model "remove" the features that it supports via a !listremove() - leaving just the unsupported ones.
Differential Revision: https://reviews.llvm.org/D139642
David Spickett [Fri, 9 Dec 2022 14:49:44 +0000 (14:49 +0000)]
Revert "[mlir] FunctionOpInterface: arg and result attrs dispatch to interface"
and "[flang] Fix flang after MLIR update"
This reverts commit
dd74e6b6f4fb7a4685086a4895c1934e043f875b and
1897b67ae86470ad54f6baea6f220933d8053b5b due to ongoing test failures on flang
bots e.g. https://lab.llvm.org/buildbot/#/builders/179/builds/5050
Nikita Popov [Fri, 9 Dec 2022 14:49:15 +0000 (15:49 +0100)]
[BasicAA] Convert some tests to opaque pointers (NFC)
Nikolas Klauser [Wed, 7 Dec 2022 17:31:14 +0000 (18:31 +0100)]
[libc++] Refactor char_traits
This allows us to reuse workarounds for compilers that don't provide the builtins or constexpr support.
Reviewed By: ldionne, Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D139555
Valentin Clement [Fri, 9 Dec 2022 14:37:25 +0000 (15:37 +0100)]
[flang] Embox derived-type when passed to element procedure as passed object
In elemental procedure lowering the passed object is always emboxed. The current code
was not correctly dealing with scalar derived-type used as passed object.
Reviewed By: jeanPerier, PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D139667
Nikita Popov [Fri, 9 Dec 2022 14:30:40 +0000 (15:30 +0100)]
[GVN] Regenerate test checks (NFC)
David Truby [Tue, 22 Nov 2022 13:32:47 +0000 (13:32 +0000)]
[openmp][mlir] Lower parallel if to new fork_call_if function.
This patch adds a new runtime function `fork_call_if` and uses that
to lower parallel if statements when going through OpenMPIRBuilder.
This fixes an issue where the OpenMPIRBuilder passes all arguments to
fork_call as a struct but this struct is not filled corretly in the
non-if branch by handling the fork inside the runtime.
Differential Revision: https://reviews.llvm.org/D138495
Matthias Springer [Fri, 9 Dec 2022 14:17:30 +0000 (15:17 +0100)]
[mlir][linalg] Fold duplicate and unused inputs in linalg.generic
If an input bbArg is not used, its corresponding input operand is removed. If there are duplicate input operands or input operands that are also used as output operands, the duplicate input operands are removed. Output operands are never modified.
Differential Revision: https://reviews.llvm.org/D139709
Alex Richardson [Fri, 9 Dec 2022 13:42:47 +0000 (13:42 +0000)]
[MemoryBuiltins] Avoid comparing against Type::getInt8PtrTy(0)
This does not make sense with opaque pointers, and also caused issues for
CHERI/Morello where hardcoding address-space zero prevented optimization.
Downstream change: https://git.morello-project.org/morello/llvm-project/-/merge_requests/180
Co-authored-by: Silviu Baranga <silviu.baranga@arm.com>
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D139708
Nico Weber [Fri, 9 Dec 2022 13:56:02 +0000 (08:56 -0500)]
[clang] Try to unbreak test/C/drs/dr324.c on Windows
The test uses
#pragma GCC dependency "oops\..\dr0xx.c"
to test preprocessor "tokenization obscurities". However, that
pragma also emits a warning if the refered file is newer than the
current file -- and
d694e2490af8 edited dr0xx.c, causing this warning
to fire.
As workaround, touch this file, so that it's newer than dr0xx.c again.
Sam McCall [Fri, 9 Dec 2022 13:30:04 +0000 (14:30 +0100)]
[Serialization] Add -ftime-trace block for reading loaded modules.
The existing ReadAST block only describes the top-level PCM file being
loaded, when in practice most of the time taken is dealing with other
PCM files which are loaded in turn.
Because this work isn't strictly recursive (first all the modules are
discovered, then processsed in several flat loops), we can't have a neat
recursive structure like processing of source files. Instead, slap a
timer on the largest of these boxes: reading the AST block for modules.
In practice this shows where most of the time goes, and in particular
which modules are most expensive.
Matthias Springer [Fri, 9 Dec 2022 13:30:08 +0000 (14:30 +0100)]
[mlir][bufferize] Improve analysis of external functions
External functions have no body, so they cannot be analyzed. Assume conservatively that each tensor bbArg may be aliasing with each tensor result. Furthermore, assume that each function arg is read and written-to after bufferization. This default behavior can be controlled with `bufferization.access` (similar to `bufferization.memory_layout`) in test cases.
Also fix a bug in the dialect attribute verifier, which did not run for region argument attributes.
Differential Revision: https://reviews.llvm.org/D139517
Nico Weber [Fri, 9 Dec 2022 13:32:10 +0000 (08:32 -0500)]
Revert "[lld-macho] Fix bug in reading cpuSubType field."
This reverts commit
e54cfa48d2d56e025fee9e239f8ba4fdec5520c8.
Test fails at least on macOS: https://reviews.llvm.org/D139572#3984162
Nico Weber [Fri, 9 Dec 2022 13:32:01 +0000 (08:32 -0500)]
Revert "Mark test lld/test/MachO/fat-arch.s updated in e54cfa4 to require aarch64."
This reverts commit
9c381c430e413b2c2b7a15e43f4db3f4b7a7e138.
Prerequisite for reverting
e54cfa48d2d56e025fee9e239f8ba4fdec5520c8.
Nikita Popov [Fri, 9 Dec 2022 13:29:51 +0000 (14:29 +0100)]
[TBAA] Avoid duplicate set lookup (NFC)
Tobias Gysi [Fri, 9 Dec 2022 12:40:18 +0000 (14:40 +0200)]
[mlir][llvm] Improve LLVM IR import error handling.
Instead of exiting in the middle of the import handle errors more
gracefully by printing an error message and returning failure. The
revision handles and tests the import of unsupported instructions,
values, constants, and intrinsics.
Depends on D139404
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D139405
Manas [Fri, 9 Dec 2022 12:30:57 +0000 (13:30 +0100)]
[analyzer][solver] Introduce reasoning for not equal to operator
With this patch, the solver can infer results for not equal (!=) operator
over Ranges as well. This also fixes the issue of comparison between
different types, by first converting the RangeSets to the resulting type,
which then can be used for comparisons.
Patch by Manas.
Reviewed By: steakhal
Differential Revision: https://reviews.llvm.org/D112621
Alexey Bataev [Thu, 8 Dec 2022 21:32:25 +0000 (13:32 -0800)]
[SLP][NFC]prepare isUndefVector function to be used for differently
sized vectors as shuffle masks, NFC.
Use use-mask instead of actual mask to speed up the process and make it
possible to use for the cases where the mask is used for vector
resizing.
Haojian Wu [Sat, 26 Nov 2022 00:02:25 +0000 (01:02 +0100)]
[include-cleaner] Filter out references that not spelled in the main file.
A HTML report of gtest after this patch:
https://gist.githubusercontent.com/hokein/
73eee6f65a803e5702d8388c187524a6/raw/
cf05a503519703a2fb87840bb0b270fe11a7a9fd/RecordTest.html
Differential Revision: https://reviews.llvm.org/D138779
Nikita Popov [Fri, 9 Dec 2022 11:57:40 +0000 (12:57 +0100)]
[MemoryBuiltins] Remove unused TLI parameters (NFC)
Nikita Popov [Fri, 9 Dec 2022 11:45:00 +0000 (12:45 +0100)]
[MemoryBuiltins] Remove CallocLike (NFC)
All functions of this kind already use allocator attributes. This
also highlights that isMallocOrCallocLikeFn() doesn't really do
what the name says (notably, it does not check for allocator
attributes). The places it is used in are also very dubious, so
we'll want to remove it.
Simon Pilgrim [Fri, 9 Dec 2022 11:45:59 +0000 (11:45 +0000)]
[SLP][X86] slp-fma-loss.ll - add various targets with different FMA abilities
Add targets with FMA3, FMA4 and no-FMA support
Should help with D132872 testing
Nikita Popov [Fri, 9 Dec 2022 11:35:43 +0000 (12:35 +0100)]
[MemoryBuiltins] Remove AlignedAllocLike (NFC)
All functions that formerly had this AllocType now use allocator
attributes, so drop it.
Ilya Biryukov [Wed, 7 Dec 2022 16:14:27 +0000 (17:14 +0100)]
[clangd] NFC. Add a newline at the end of the file