Guray Ozen [Tue, 23 Aug 2022 07:28:16 +0000 (09:28 +0200)]
[mlir][Linalg] Retire Linalg generic interchange pattern and pass
This revision removes the Linalg generic interchange pattern and pass.
It also changes transform-patterns test to make use of transform dialect.
Context: https://discourse.llvm.org/t/psa-retire-linalg-filter-based-patterns/63785
Differential Revision: https://reviews.llvm.org/D132368
Balázs Kéri [Tue, 23 Aug 2022 06:51:54 +0000 (08:51 +0200)]
[clang][AST] RecursiveASTVisitor should visit owned TagDecl of friend type.
A FriendDecl node can have a friend record type that owns a RecordDecl
object. This object is different than the one got from TypeSourceInfo
object of the FriendDecl. When building a ParentMapContext this owned
tag decaration has to be encountered to have the parent set for it.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D131685
Adrian Kuegel [Fri, 19 Aug 2022 13:20:06 +0000 (15:20 +0200)]
[mlir][Linalg] Remove unused method declaration.
The "real" method declaration is in LinalgInterfaces.h
Differential Revision: https://reviews.llvm.org/D132227
liaochunyu [Tue, 23 Aug 2022 05:53:06 +0000 (13:53 +0800)]
[llvm-profdata][NFC] fix warning
warning: unused variable ‘FC’
Reviewed By: kazu
Differential Revision: https://reviews.llvm.org/D132429
LLVM GN Syncbot [Tue, 23 Aug 2022 05:49:48 +0000 (05:49 +0000)]
[gn build] Port
15b65bcd6519
Weining Lu [Tue, 23 Aug 2022 05:11:32 +0000 (13:11 +0800)]
[Clang][LoongArch] Add initial LoongArch target and driver support
With the initial support added, clang can compile `helloworld` C
to executable file for loongarch64. For example:
```
$ cat hello.c
int main() {
printf("Hello, world!\n");
return 0;
}
$ clang --target=loongarch64-unknown-linux-gnu --gcc-toolchain=xxx --sysroot=xxx hello.c
```
The output a.out can run within qemu or native machine. For example:
```
$ file ./a.out
./a.out: ELF 64-bit LSB pie executable, LoongArch, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-loongarch-lp64d.so.1, for GNU/Linux 5.19.0, with debug_info, not stripped
$ ./a.out
Hello, world!
```
Currently gcc toolchain and sysroot can be found here:
https://github.com/loongson/build-tools/releases/download/2022.08.11/loongarch64-clfs-5.1-cross-tools-gcc-glibc.tar.xz
Reference: https://github.com/loongson/LoongArch-Documentation
The last commit hash (main branch) is:
99016636af64d02dee05e39974d4c1e55875c45b
Note loongarch32 is not fully tested because there is no reference
gcc toolchain yet.
Differential Revision: https://reviews.llvm.org/D130255
Carlos Alberto Enciso [Tue, 23 Aug 2022 04:45:25 +0000 (05:45 +0100)]
[CMake] Support passing arguments to build tool (bootstrap).
For bootstrap builds (CLANG_ENABLE_BOOTSTRAP=ON) allow
arguments to be passed to the native tool used in CMake
for the stage2 step.
Can be used to pass extra arguments for enhanced versions
of build tools, e.g. distributed build options.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D131665
Kazushi (Jam) Marukawa [Mon, 22 Aug 2022 14:31:44 +0000 (23:31 +0900)]
[VE] Support inlineasm memory operand
Support inline asm memory operand for VE. Add regression tests also.
Reviewed By: efocht
Differential Revision: https://reviews.llvm.org/D132380
liqinweng [Tue, 23 Aug 2022 04:13:06 +0000 (12:13 +0800)]
[LV][NFC] Modify code comments
Reviewed By: jacquesguan
Differential Revision: https://reviews.llvm.org/D132093
liqinweng [Tue, 23 Aug 2022 04:09:31 +0000 (12:09 +0800)]
[NFC]] Use llvm::all_of instead of std::all_of
Reviewed By: kazu
Differential Revision: https://reviews.llvm.org/D131886
owenca [Tue, 23 Aug 2022 04:15:26 +0000 (21:15 -0700)]
[clang-format] Remove an extraneous test in TokenAnnotatorTest.cpp
This removes an obsolete test case introduced by mistake from
commit
2e36120726ee46cbfd3eee1e9244bdd756dee92d.
Jakub Kuderski [Tue, 23 Aug 2022 03:55:05 +0000 (23:55 -0400)]
[ADT] Add all_equal predicate
`llvm::all_equal` checks if all values in the given range are equal, i.e., there are no two elements that are not equal.
Similar to `llvm::all_of`, it returns `true` when the range is empty.
`llvm::all_equal` is intended to supersede `llvm::is_splat`, which will be deprecated and removed in future patches.
See the discussion thread for more details:
https://discourse.llvm.org/t/adt-is-splat-and-empty-ranges/64692.
Reviewed By: dblaikie, shchenz
Differential Revision: https://reviews.llvm.org/D132334
owenca [Tue, 16 Aug 2022 23:30:40 +0000 (16:30 -0700)]
[clang-format] Fix regressions in WhitespaceSensitiveMacros
Fixes #54522.
Fixes #57158.
Differential Revision: https://reviews.llvm.org/D132001
Stanley Winata [Tue, 23 Aug 2022 03:37:05 +0000 (23:37 -0400)]
[mlir][spirv] Use spv.store instead of init in var
- Add spv.store instead of init for spv.variable to fix data issues in
some GPU drivers
Reviewed By: antiagainst
Patch By: raikonenfnu
Differential Revision: https://reviews.llvm.org/D132427
Stanley Winata [Tue, 23 Aug 2022 03:32:51 +0000 (23:32 -0400)]
[mlir][spirv] Add vector.fma lowering to CL.fma
Reviewed By: antiagainst
Patch By: raikonenfnu
Differential Revision: https://reviews.llvm.org/D132424
Phoebe Wang [Mon, 22 Aug 2022 01:59:42 +0000 (09:59 +0800)]
[X86][AVX512FP16] Relax limitation to AVX512FP16 intrinsics. NFCI
Since we have enabled the support for `_Float16` on SSE2, we can relax
the limitation for AVX512FP16 now. This helps for user to use AVX512FP16
mixed with unsupported versions, e.g., multiversioning.
Also fix lit fails due to missing const modifier. Found during this change.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D132342
Chenbing Zheng [Tue, 23 Aug 2022 03:01:18 +0000 (11:01 +0800)]
[InstCombine] add tests for shuf bitcast. nfc
Nico Weber [Tue, 23 Aug 2022 01:46:36 +0000 (21:46 -0400)]
[gn build] port
e78208f082f0
Jan Svoboda [Mon, 22 Aug 2022 18:33:07 +0000 (11:33 -0700)]
[clang][deps] Allow switching between lazily/eagerly loaded PCMs
This patch introduces new option `-eager-load-pcm` to `clang-scan-deps`, which controls whether the resulting command-lines will load PCM files eagerly (at the start of compilation) or lazily (when handling import directive). This patch also switches the default from eager to lazy.
To reduce the potential for churn in LIT tests in the future, this patch also removes redundant checks of command-line arguments and introduces new test `modules-dep-args.c` as a substitute.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D132066
Dave Lee [Thu, 18 Aug 2022 01:51:37 +0000 (18:51 -0700)]
[llvm][utils] Make lldb data formatters show both summaries and children
When a type has a summary and synthetic child provider, the children are shown
only if `--expand`/`-e` is given.
This updates `lldbDataFormatters.py` to expand children of types that have both
a summary and synthetic children.
Differential Revision: https://reviews.llvm.org/D132095
jackalcooper [Tue, 23 Aug 2022 00:37:26 +0000 (20:37 -0400)]
[mlir][vulkan-runner] Use aligned pointer for host buffer
Fix incorrect pointer usage in Vulkan buffer and Memref descriptor binding:
- Vulkan runtime produced incorrect result if there is alignment.
- There was illegal memory access if binding a LLVM global materialized
from a constant op (0xdeadbeef).
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D132291
Jacques Pienaar [Mon, 22 Aug 2022 23:49:46 +0000 (16:49 -0700)]
[mlir] Populate default attributes on op creation
Default attributes were only handled by ODS accessors generated with the
intention that these behave as if set attributes. This addresses the
long standing TODO to address this inconsistency. Moving the
initialization to construction vs every access. Removing need for
duplicated default attribute population in python bindings.
Switch some of the OpenMP ones to optional attribute with default as the
currently set default values are not legal. May need to dig more there.
Switched LinAlg generated ones to optional attribute with default as its
quite widely used and unclear where it falls on two different
interpretations.
Differential Revision: https://reviews.llvm.org/D130916
Akira Hatanaka [Mon, 22 Aug 2022 23:37:33 +0000 (16:37 -0700)]
Revert "[compiler-rt][builtins] Add compiler flags to catch potential errors"
This reverts commit
5f886adbfd7c09f7883589ec9d85c04a08335043.
It broke clang-hip-vega20.
https://lab.llvm.org/buildbot/#/builders/165/builds/23675
Yuanfang Chen [Mon, 22 Aug 2022 23:01:09 +0000 (16:01 -0700)]
[compiler-rt][lit] initialize LIT LLVMConfig instance
to handle lit tools searching. Otherwise
compiler-rt depends on system environment variable PATH for lit tools
which diverge from the other LLVM projects. This reverts D83486 which
really should be implemented in LIT itself when the PATH is constructed.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D122837
Akira Hatanaka [Mon, 22 Aug 2022 23:25:59 +0000 (16:25 -0700)]
[compiler-rt][builtins] Add compiler flags to catch potential errors
that can lead to security vulnerabilities
Also, fix a few places that were causing -Wshadow and
-Wformat-nonliteral warnings to be emitted.
Differential Revision: https://reviews.llvm.org/D131714
Siva Chandra Reddy [Mon, 22 Aug 2022 23:12:35 +0000 (23:12 +0000)]
[libc][Obvious] Move some macros definitions to sys/stat.h.
They were previously incorrectly listed in fcntl.h
Christopher Di Bella [Mon, 22 Aug 2022 22:30:12 +0000 (22:30 +0000)]
[clang][libcxx] renames `__remove_reference`
libc++ prior to LLVM 15 has a bug in it due to it excluding
`remove_reference_t` when `__remove_reference` is available as a
compiler built-in. This went unnoticed until D116203 because it wasn't
available in any compiler.
To work around this, we're renaming `__remove_reference` to
`__remove_reference_t`.
TEST=Tested locally, tested using emscripten
Keith Smiley [Fri, 19 Aug 2022 23:33:30 +0000 (16:33 -0700)]
[llvm-objcopy][MachO] Remove more sections with llvm-bitcode-strip
This adds the other potential bitcode sections that can exist and should
be stripped with `-r` from `llvm-bitcode-strip`.
Differential Revision: https://reviews.llvm.org/D132267
Andrew Browne [Wed, 17 Aug 2022 21:26:43 +0000 (14:26 -0700)]
[DFSan] Fix handling of libAtomic external functions.
Implementation based on MSan.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D132070
Yuanfang Chen [Mon, 22 Aug 2022 22:59:51 +0000 (15:59 -0700)]
[CodeGen] Sort llvm.global_ctors by lexing order before emission
Fixes https://github.com/llvm/llvm-project/issues/55804
The lexing order is already bookkept in DelayedCXXInitPosition but we
were not using it based on the wrong assumption that inline variable is
unordered. This patch fixes it by ordering entries in llvm.global_ctors
by orders in DelayedCXXInitPosition.
for llvm.global_ctors entries without a lexing order, ordering them by
the insertion order.
(This *mostly* orders the template instantiation in
https://reviews.llvm.org/D126341 intuitively, minus one tweak for which I'll
submit a separate patch.)
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D127233
Dave Lee [Mon, 22 Aug 2022 04:48:14 +0000 (21:48 -0700)]
[lldb] Remove prefer-dynamic-value test override
Remove the test override of `target.prefer-dynamic-value`.
Previously, the lldb default was `no-dynamic-values`. In rG9aa7e8e9ffbe (in
2015), the default was changed to `no-run-target`, but at that time the tests
were changed to be run with `no-dynamic-value`. I don't know the reasons for
not changing the tests, perhaps to avoid determining which tests to change, and
what about them to change.
Because `no-run-target` is the lldb default, I think it makes sense to make it
the test default too. It puts the test config closer to what's used in
practice.
This change removes the `target.prefer-dynamic-value` override, and for those
tests that failed, they have been updated to explicitly use
`no-dynamic-values`. Future changes could update these tests to use dynamic
values too, or they can be left as is to exercise non-dynamic typing.
Differential Revision: https://reviews.llvm.org/D132382
Jacques Pienaar [Mon, 22 Aug 2022 22:45:23 +0000 (15:45 -0700)]
[mlir][tosa] Switch TosaFoldConstantTranspose to use ElementsAttr.
Also avoid redoing index calculation.
Differential Revision: https://reviews.llvm.org/D132274
Yaxun (Sam) Liu [Thu, 18 Aug 2022 15:14:09 +0000 (11:14 -0400)]
[AMDGPU] Add builtin s_sendmsg_rtn
Reviewed by: Brian Sumner, Artem Belevich
Differential Revision: https://reviews.llvm.org/D132140
Fixes: SWDEV-352017
Chris Bieneman [Mon, 22 Aug 2022 22:25:09 +0000 (17:25 -0500)]
[DirectX] Remove broken assert
This assert always fails. It is unclear to me what it was attempting to
test, but removing it gets our tests passing, so it clearly isn't
checking the right thing.
Philip Reames [Sat, 20 Aug 2022 15:07:28 +0000 (08:07 -0700)]
[TTI] Use OperandValueInfo in getArithmeticInstrCost implementation [NFC]
This change completes the process of replacing OperandValueKind and OperandValueProperties which were previously passed independently in this API with a single container class which contains both.
This is the change which motivated the whole sequence which preceeded it. In an original spike version of this change, I'd noticed a nasty bug: I'd changed the signature without changing names, and as result, we silently passed additional information through a callsite which previously dropped the power-of-two fact. This might be harmless in most cases, but at least a couple clearly dependend for correctness on not passing that property through.
I did my best to split off prior changes which reduced the scope of this one, and which made it possible to use compiler assistance. For instance, every parameter which changes type in this change also changes name. This was intentional to make sure that every call site possible effected must show up in the diff. This let me audit each one closely.
Jacques Pienaar [Mon, 22 Aug 2022 18:47:15 +0000 (11:47 -0700)]
[mlir][shape] refine shape.func and shape.with_shape
- shape.with_shape supports ExtentTensorType
- add helper to create shape.func
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D131977
Greg Clayton [Tue, 12 Jul 2022 00:51:00 +0000 (17:51 -0700)]
Modify all register values whose byte size matches the address size to be formatter as eFormatAddressInfo.
This allows users to see similar output to what the "register read" command emits in LLDB's command line.
Added a test to verify that the PC has the correct value with contains a pointer followed by the module + function name and the source line info. Something like:
0x0000000100000a64 a.out`main + 132 at main.cpp:17:11
Differential Revision: https://reviews.llvm.org/D129528
Greg Clayton [Thu, 11 Aug 2022 04:08:04 +0000 (21:08 -0700)]
Don't create sections for SHN_ABS symbols in ELF files.
Symbols that have the section index of SHN_ABS were previously creating extra top level sections that contained the value of the symbol as if the symbol's value was an address. As far as I can tell, these symbol's values are not addresses, even if they do have a size. To make matters worse, adding these extra sections can stop address lookups from succeeding if the symbol's value + size overlaps with an existing section as these sections get mapped into memory when the image is loaded by the dynamic loader. This can cause stack frames to appear empty as the address lookup fails completely.
This patch:
- doesn't create a section for any SHN_ABS symbols
- makes symbols that are absolute have values that are not addresses
- add accessors to SBSymbol to get the value and size of a symbol as raw integers. Prevoiusly there was no way to access a symbol's value from a SBSymbol because the only accessors were:
SBAddress SBSymbol::GetStartAddress();
SBAddress SBSymbol::GetEndAddress();
and these accessors would return an invalid SBAddress if the symbol's value wasn't an address
- Adds a test to ensure no ".absolute.<symbol-name>" sections are created
- Adds a test to test the new SBSymbol APIs
Differential Revision: https://reviews.llvm.org/D131705
Sanjay Patel [Mon, 22 Aug 2022 21:19:34 +0000 (17:19 -0400)]
[InstCombine] add tests for mul+add common factor; NFC
Chris Bieneman [Fri, 19 Aug 2022 14:55:47 +0000 (09:55 -0500)]
[NFC] Rename dx.shader to hlsl.shader
This metadata annotation is HLSL-specific not DirectX specific. It will
need to be attached for shaders regardless of whether they are targeting
DXIL.
Philip Reames [Mon, 22 Aug 2022 19:03:36 +0000 (12:03 -0700)]
[X86][AArch64][WebAsm][RISCV] Query operand properties instead of using enums directly [nfc]
This is part of an ongoing transition to use OperandValueInfo which combines OperandValueKind and OperandValueProperties. This change adds some accessor methods and uses them to simplify backend code. The primary motivation of doing so is removing uses of the parameters so that an upcoming api change is less error prone.
Philip Reames [Mon, 22 Aug 2022 18:30:47 +0000 (11:30 -0700)]
[X86][TTI] Rename OpNInfo to OpNKind [nfc]
Both are reasonable names; this is solely that an upcoming change can use the OpNInfo name, and the compiler can tell me if I forgot to update something (instead of silently passing along properties that might not hold.)
Alan Zhao [Mon, 22 Aug 2022 20:16:37 +0000 (16:16 -0400)]
Revert "[ARM] Use getSymbolPreferLocal() in GetARMGVSymbol"
This reverts commit
6db15a82cc0966458c2b7d84b39f42ef09d2ac20.
Reverted because this breaks offical Chrome builds targeting Android on
arm: https://crbug.com/1354305
Repro: https://drive.google.com/file/d/1pgQI2adwx3DJJqIYvMY4i249ouHU0rmu/view?usp=sharing
David Majnemer [Sun, 21 Aug 2022 20:03:22 +0000 (20:03 +0000)]
[clang-cl] Add _M_FP_* #defines for floating point modes
This keeps clang compatible with MSVC defines for the FP environment.
These defines are used by the CRT and other libraries to interrogate
what to expect. Perhaps most importantly, they feed into the definition
of float_t and double_t which may result in ODR violations between MSVC
and clang.
Shoaib Meenai [Mon, 22 Aug 2022 18:58:46 +0000 (21:58 +0300)]
[MachO] Fix formatting. NFC
The style guide says that all arms of an if-else should have braces if
any arm does [1].
[1] https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
Stephen Tozer [Mon, 22 Aug 2022 19:52:47 +0000 (20:52 +0100)]
[InstrRef] Fix unused variable in InstrRefLDVTest
Stephen Tozer [Sat, 18 Jun 2022 00:09:13 +0000 (01:09 +0100)]
[DebugInfo] Let InstrRefBasedLDV handle joins for lists of debug ops
In preparation for adding support for DBG_VALUE_LIST instructions in
InstrRefLDV, this patch updates the logic for joining variables at block
joins to support joining variables that use multiple debug operands.
This is one of the more meaty "logical" changes, although the line count
isn't too high - this changes pickVPHILoc to find a valid joined
location for every operand, with part of the function being split off
into pickValuePHILoc which finds a location for a single operand.
Differential Revision: https://reviews.llvm.org/D128180
Akira Hatanaka [Mon, 22 Aug 2022 19:13:48 +0000 (12:13 -0700)]
[Sema][ObjC] Don't warn about implicitly-retained self in an unevaluated
context
David Penry [Thu, 30 Jun 2022 18:03:50 +0000 (11:03 -0700)]
[ModuloSchedule] Add interface call to accept/reject SMS schedules
This interface allows a target to reject a proposed
SMS schedule. For Hexagon/PowerPC, all schedules
are accepted, leaving behavior unchanged. For ARM,
schedules which exceed register pressure limits are
rejected.
Also, two RegisterPressureTracker methods now need to be public so
that register pressure can be computed by more callers.
Reapplication of D128941/(reversion:D132037) with small fix.
Differential Revision: https://reviews.llvm.org/D132170
Jay Foad [Mon, 18 Jul 2022 15:09:41 +0000 (16:09 +0100)]
[InstCombine] Change order of canonicalization of ADD and AND
Canonicalize ((x + C1) & C2) --> ((x & C2) + C1) for suitable constants
C1 and C2, instead of the other way round. This should allow more
constant ADDs to be matched as part of addressing modes for loads and
stores.
Differential Revision: https://reviews.llvm.org/D130080
Jay Foad [Mon, 18 Jul 2022 18:32:40 +0000 (19:32 +0100)]
[InstCombine] Try not to demand low order bits for Add
Don't demand low order bits from the LHS of an Add if:
- they are not demanded in the result, and
- they are known to be zero in the RHS, so they can't possibly
overflow and affect higher bit positions
This is intended to avoid a regression from a future patch to change
the order of canonicalization of ADD and AND.
Differential Revision: https://reviews.llvm.org/D130075
Jay Foad [Mon, 22 Aug 2022 15:35:46 +0000 (16:35 +0100)]
[InstCombine] Add tests for D130075
Differential Revision: https://reviews.llvm.org/D132381
Vitaly Buka [Mon, 22 Aug 2022 18:38:07 +0000 (11:38 -0700)]
[tsan] Keep thread/stack for closed FD
Fixes b/
242869837
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D132068
David Majnemer [Sun, 21 Aug 2022 19:09:49 +0000 (19:09 +0000)]
[clang-cl] Increase /fp flag fidelity
They were mapped as follows:
- /fp:except to --ftrapping-math
- /fp:except- to --fno-trapping-math
- /fp:strict to --fno-fast-math
- /fp:precise to --fno-fast-math
Let's map them as follows:
- /fp:except to --ffp-exception-behavior=strict
- /fp:except- to --ffp-exception-behavior=ignore
- /fp:strict to --ffp-model=strict
- /fp:precise to --ffp-model=ignore
I believe the changes to /fp:except are technically a no-op but it makes
the mapping a lot clearer. The changes for /fp:strict and /fp:precise are not
no-ops, they now match MSVC's behavior.
While we are here, also add support for /fp:contract by mapping it to
-ffp-contract=on.
Philip Reames [Mon, 22 Aug 2022 18:20:14 +0000 (11:20 -0700)]
[TTI] Use OperandValueInfo in getMemoryOpCost client api [nfc]
This removes the last use of OperandValueKind from the client side API, and (once this is fully plumbed through TTI implementation) allow use of the same properties in store costing as arithmetic costing.
Kazu Hirata [Mon, 22 Aug 2022 18:11:30 +0000 (11:11 -0700)]
[CodeGen] Fix unused variable warnings
Usman Nadeem [Mon, 22 Aug 2022 17:24:49 +0000 (10:24 -0700)]
[Flang][Driver] Add support for PIC
This patch does the following:
- Consumes the PIC flags (fPIC/fPIE/fropi/frwpi etc) in flang-new.
tools::ParsePICArgs() in ToolChains/CommonArgs.cpp is used for this.
- Adds FC1Option to "-mrelocation-model", "-pic-level", and "-pic-is-pie"
command line options.
- Adds the above options to flang/Frontend/CodeGenOptions' data structure.
- Sets the relocation model in the target machine, and
- Sets module flags for the respective PIC/PIE type in LLVM IR.
I have tried my best to replicate how clang does things.
Differential Revision: https://reviews.llvm.org/D131533
Change-Id: I68fe64910be28147dc5617826641cea71b92d94d
Philip Reames [Mon, 22 Aug 2022 17:41:28 +0000 (10:41 -0700)]
[TTI] Remove OperandValueKind/Properties from getArithmeticInstrCost interface [nfc]
This completes the client side transition to the OperandValueInfo version of this routine. Backend TTI implementations still use the prior versions for now.
Nemanja Ivanovic [Mon, 22 Aug 2022 15:34:19 +0000 (10:34 -0500)]
[GTest] Change detection of libpthread
We currently use CMake's find_library function to detect whether
libpthread exists on the system to determine if pthread should
be added on the link step. However, there are configurations in
which CMake's path checking fails to find the library even though
the toolchain has it.
One such case is with Clang 14.0.0 on PowerPC. Due to a recent
change, the build puts libc++ and related libraries in a
subdirectory that appears to depend on the default target triple.
CMake then uses that subdirectory to determine the architecture
and adds that name to its search paths. However, the triple for
the system GNU toolchain is different so CMake fails to find it.
Namely, Clang 14.0.0's default target triple and the subdirectory
name is powerpc64le-unknown-linux-gnu whereas the system GNU
toolchain has powerpc64le-linux-gnu. Clang's driver has no trouble
finding either the GNU includes/libraries or Clang's own. But
CMake seems to get this wrong.
The net result of this is that we can't do a shared libraries
build of ToT with Clang 14.0.0.
This patch proposes using HAVE_LIBPTHREAD which CMake seems to
determine by compiling a test file with -lpthread (or perhaps
-pthread, I can't really get CMake to tell me how it is figuring
this out). If that variable tells CMake that the build compiler
accepts the pthread option, it seems reasonable to depend on
that variable to determine if we should add it to the link step
when building the llvm_gtest library.
Kazu Hirata [Mon, 22 Aug 2022 17:57:16 +0000 (10:57 -0700)]
[LiveDebugValues] Fix a warning
This patch fixes:
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h:330:5: error:
anonymous types declared in an anonymous union are an extension
[-Werror,-Wnested-anon-types]
Mike Rice [Fri, 19 Aug 2022 23:44:55 +0000 (16:44 -0700)]
[OpenMP][NFC] Use OMPInteropInfo in the OMPDeclareVariantAttr attribute
In preparation for allowing the prefer_type list in the append_args clause,
use the OMPInteropInfo in the attribute for 'declare variant'.
This requires adding a new Argument kind to the attribute code. This change
adds a specific attribute to pass an array of OMPInteropInfo. It implements
new tablegen needed to handle the interop-type part of the structure. When
prefer_type is added, more work will be needed to dump, instantiate, and
serialize the PreferTypes field in OMPInteropInfo.
Differential Revision: https://reviews.llvm.org/D132270
Tarun Prabhu [Mon, 22 Aug 2022 17:21:47 +0000 (11:21 -0600)]
[flang] Fold F08 parity intrinsic
Perform compile-time folding of the F08 parity intrinsic when all parameters are compile-time constants.
Differential Revision: https://reviews.llvm.org/D129785
Philip Reames [Mon, 22 Aug 2022 16:59:59 +0000 (09:59 -0700)]
[TTI] Migrate getOperandInfo to OperandVaueInfo [nfc]
This is part of merging OperandValueKind and OperandValueProperties.
Arthur Eubanks [Mon, 22 Aug 2022 17:02:30 +0000 (10:02 -0700)]
[bazel][docs] Mention how to provide path to compiler
And some other cleanups/clarifications.
Reviewed By: saugustine
Differential Revision: https://reviews.llvm.org/D132396
Arthur Eubanks [Mon, 22 Aug 2022 17:12:10 +0000 (10:12 -0700)]
[bazel] Move some CI flags into .bazelrc
Stephen Tozer [Fri, 17 Jun 2022 15:20:06 +0000 (16:20 +0100)]
[DebugInfo][NFC] Represent DbgValues with multiple ops in IRefLDV
In preparation for allowing InstrRefBasedLDV to handle DBG_VALUE_LIST,
this patch updates the internal representation that it uses to represent
debug values to store a list of values. This is one of the more
significant changes in terms of line count, but is fairly simple and
should not affect the output of this pass.
Differential Revision: https://reviews.llvm.org/D128177
River Riddle [Mon, 22 Aug 2022 17:02:18 +0000 (10:02 -0700)]
[mlir:Bytecode] Fix asan failure
We were accessing the region state after it got popped from the stack.
Dmitry Preobrazhensky [Mon, 22 Aug 2022 16:51:31 +0000 (19:51 +0300)]
[AMDGPU][MC][GFX10][NFC] Consolidate tests by encoding
Differential Revision: https://reviews.llvm.org/D132235
Philip Reames [Mon, 22 Aug 2022 15:58:15 +0000 (08:58 -0700)]
[TTI] Start process of merging OperandValueKind and OperandValueProperties [nfc]
OperandValueKind and OperandValueProperties both provide facts about the operands of an instruction for purposes of cost modeling. We've discussed merging them several times; before I plumb through more flags, let's go ahead and do so.
This change only adds the client side interface for getArithmeticInstrCost and makes a couple of minor changes in client code to prove that it works. Target TTI implementations still use the split flags. I'm deliberately splitting what could be one big change into a series of smaller ones so that I can lean on the compiler to catch errors along the way.
Arthur Eubanks [Mon, 22 Aug 2022 16:36:23 +0000 (09:36 -0700)]
[bazel] Add note about using -c opt for CI
Matthias Braun [Wed, 17 Aug 2022 17:54:12 +0000 (10:54 -0700)]
RegisterClassInfo: Fix CSR cache invalidation
`RegisterClassInfo` caches information like allocation orders and reuses
it for multiple machine functions where possible. However the `MCPhysReg
*CalleeSavedRegs` field used to test whether the set of callee saved
registers changed did not work: After D28566
`MachineRegisterInfo::getCalleeSavedRegs()` can return dynamically
computed CSR sets that are only valid while the `MachineRegisterInfo`
object of the current function exists.
This changes the code to make a copy of the CSR list instead of keeping
a possibly invalid pointer around.
Differential Revision: https://reviews.llvm.org/D132080
Nico Weber [Fri, 19 Aug 2022 18:45:32 +0000 (14:45 -0400)]
clang/apple: Infer simulator env from -mios-simulator-version-min= flag
Before this patch, open-source clang would consider
`-target x86_64-apple-darwin -mios-simulator-version-min=11.0` as
targeting the iOS simulator, due to the mios flag informing it
that we want to target iOS, and logic in the driver then realizing
that x86 iOS builds must be the simulator.
However, for `-target arm64-apple-darwin -mios-simulator-version-min=11.0`
that didn't work and clang thought that it's building for actual iOS,
and not for the simulator.
Due to this, building compiler-rt for arm64 iossim would lead to
all .o files in RTSanitizerCommonSymbolizer.iossim.dir being built
for iOS instead of for iOS simulator, and clang would ask ld64 to
link for iOS, but using the iPhoneSimulator sysroot. This would then
lead to many warnings from ld64 looking like:
ld: warning: building for iOS, but linking in .tbd file
(.../iPhoneSimulator.sdk/usr/lib/libc++abi.tbd) built for iOS Simulator
Worse, with ld64.lld, this diagnostic is currently an error instead
of a warning.
This patch makes it so that the presence of -mios-simulator-version-min=
now informs clang that we're building for simulator. That way, all the
.o files are built for simulator, the linker is informed that we're
building for simulator, and everything Just Works.
(Xcode's clang already behaves like this, so this makes open-source clang
match Xcode clang.)
We can now likely remove the hack to treat non-mac darwin x86 as
simulator, but doing that feels slightly risky, so I'm leaving that
for a follow-up patch.
(This patch is made necessary by the existence of arm64 macs.)
Differential Revision: https://reviews.llvm.org/D132258
Goran Flegar [Mon, 22 Aug 2022 15:59:51 +0000 (17:59 +0200)]
[mlir] Fix compile errors with bytecode support
Guillaume Chatelet [Mon, 22 Aug 2022 15:40:57 +0000 (15:40 +0000)]
[NFC][libc] clarify CPP folder documentation
Stephen Tozer [Thu, 16 Jun 2022 14:08:13 +0000 (15:08 +0100)]
[DebugInfo][NFC] Update LDV to use generic DBG_VALUE* MI interface
Currently, InstrRefLDV only handles DBG_VALUE instructions, not
DBG_VALUE_LIST, and as a result of this it handles these instructions
using functions that only work for that type of debug value, i.e. using
getOperand(0) to get the debug operand. This patch changes this to use
the generic debug value functions, such as getDebugOperand and
isDebugOffsetImm, as well as adding an IsVariadic field to the
DbgValueProperties class and a few other minor changes to acknowledge
DBG_VALUE_LISTs. Note that this patch does not add support for
DBG_VALUE_LIST here, but is a precursor to other patches that do add
that support.
Differential Revision: https://reviews.llvm.org/D128174
Guillaume Chatelet [Mon, 22 Aug 2022 15:25:14 +0000 (15:25 +0000)]
[libc][NFC] Use STL case for string_view
Matthias Springer [Mon, 22 Aug 2022 14:59:36 +0000 (16:59 +0200)]
[mlir][tensor][bufferize] Bufferize tensor.pad
tensor.pad is lowered to tensor.generate + tensor.insert_slice during bufferization. For best performance with constant padding values, users should vectorize the IR before bufferizing it.
This change also relaxes tje restriction that no new ops that bufferize to a memory write should be added during bufferization. Since bufferization has been split into two steps a while ago (tensor copy insertion + bufferization), it is reasonable to allow this now.
Differential Revision: https://reviews.llvm.org/D132355
Matthias Springer [Mon, 22 Aug 2022 14:48:17 +0000 (16:48 +0200)]
[mlir][linalg][transform] Support dynamic tile sizes in TileToForeachThreadOp
TileToForeachThreadOp now accepts mixed SSA value operands / index attributes for tile_sizes and num_threads. (Reusing OperandsOrIntegersSizesList.) In case of an operand, a PDL_Operation must be specified that is mapped to a payload op that returns the tile size or number of threads.
Differential Revision: https://reviews.llvm.org/D131949
Denis Antrushin [Mon, 22 Aug 2022 14:00:51 +0000 (21:00 +0700)]
Reapply "[NFC] Precommit test for D132255".
Changed check line to accomodate assertion text difference on
mac and windows; added 'REQUIRES: asserts' line.
This reverts commit
89aaae57eacf77a6902ef8d4af5c92a3d6c642c2.
Chuanqi Xu [Mon, 22 Aug 2022 14:15:24 +0000 (22:15 +0800)]
[docs] Adjust the example command line in DebuggingCoroutines.rst
The original commandline example was not correct in some environments.
Adjust the example to avoid any misunderstanding.
Phoebe Wang [Mon, 22 Aug 2022 01:59:42 +0000 (09:59 +0800)]
[X86][AVX512FP16] Add the missing const modifiers. NFCI
This patch fixes lit fails after D132342.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D132372
Stephen Tozer [Tue, 17 May 2022 14:35:27 +0000 (15:35 +0100)]
[DebugInfo] Handle joins PHI+Def values in InstrRef LiveDebugValues
In the InstrRefBasedImpl for LiveDebugValues, we attempt to propagate
debug values through basic blocks in part by checking to see whether all
a variable's incoming debug values to a BB "agree", i.e. whether their
properties match and they refer to the same underlying value.
Prior to this patch, the check for agreement between incoming values
relied on exact equality, which meant that a VPHI and a Def DbgValue
that referred to the same underlying value would be seen as disagreeing.
This patch changes this behaviour to treat them as referring to the same
value, allowing the shared value to propagate into the BB.
Differential Revision: https://reviews.llvm.org/D125953
Aaron Ballman [Mon, 22 Aug 2022 13:46:12 +0000 (09:46 -0400)]
Add N2562 to the C status page
It was originally left off thinking the paper only impacts the C
standard library, but Clang supports diagnostics for incorrect use of
a format specifier, so this paper has some frontend impacts as well.
Michael Buch [Fri, 19 Aug 2022 14:11:26 +0000 (15:11 +0100)]
[lldb][ClangExpression] Remove storage-class check when creating AsmLabel
This check was put in place to prevent static functions
from translation units outside the one that the current
expression is evaluated from taking precedence over functions
in the global namespace. However, this is really a different
bug. LLDB lumps functions from all CUs into a single AST and
ends up picking the file-static even when C++ context rules
wouldn't allow that to happen.
This patch removes the check so we apply the AsmLabel to all
FunctionDecls we create from DWARF if we have a linkage name
available. This makes the code-path easier to reason about and
allows calling static functions in contexts where we previously
would've chosen the wrong function.
We also flip the XFAILs in the API test to reflect what effect
this change has.
**Testing**
* Fixed API tests and added XFAIL
Differential Revision: https://reviews.llvm.org/D132231
Michael Buch [Sat, 20 Aug 2022 00:47:41 +0000 (01:47 +0100)]
[lldb][Test] Replace expect() with expect_expr() in TestNamespaceLookup.py
This will be useful in preparation for some reshuffling
of assertions in this file since we won't have to
adjust the persitent variable names during the process.
sed commands:
```
s/expect("expr -- /expect_expr("/g
s/startstr="(int) [$0-9]* = /result_type="int", result_value="/g
```
**Testing**
* API tests still pass
Differential Revision: https://reviews.llvm.org/D132271
Florian Hahn [Mon, 22 Aug 2022 12:11:26 +0000 (13:11 +0100)]
[LAA] Add test cases where BTC can be used to rule out dependences.
Test cases for using the backedge-taken-count to rule out dependencies between
an invariant and strided accesses.
isuckatcs [Sat, 13 Aug 2022 13:41:51 +0000 (15:41 +0200)]
[analyzer] Handling non-POD multidimensional arrays in ArrayInitLoopExpr
This patch makes it possible for lambdas, implicit copy/move ctors
and structured bindings to handle non-POD multidimensional arrays.
Differential Revision: https://reviews.llvm.org/D131840
Martin Storsjö [Mon, 22 Aug 2022 11:53:29 +0000 (14:53 +0300)]
[lldb] Silence a GCC warning about missing returns after a fully covered switch. NFC.
David Green [Mon, 22 Aug 2022 11:44:57 +0000 (12:44 +0100)]
[AArch64] Add SK_Splice fixed-width costs
A fixed length SK_Splice shuffle vector is lowered to a Ext under
AArch64, which should have a cost of 1.
Differential Revision: https://reviews.llvm.org/D132299
Simon Pilgrim [Mon, 22 Aug 2022 11:40:07 +0000 (12:40 +0100)]
[CostModel][X86] Fix a off-by-one typo in the v64i8 splice shuffle test
isuckatcs [Tue, 16 Aug 2022 07:31:24 +0000 (09:31 +0200)]
[analyzer] Remove pattern matching of lambda capture initializers
Prior to this patch we handled lambda captures based on their
initializer expression, which resulted in pattern matching. With
C++17 copy elision the initializer expression can be anything,
and this approach proved to be fragile and a source of crashes.
This patch removes pattern matching and only checks whether the
object is under construction or not.
Differential Revision: https://reviews.llvm.org/D131944
Guillaume Chatelet [Mon, 22 Aug 2022 10:52:14 +0000 (10:52 +0000)]
[NFC][libc] Remove ArrayRef which is replaced with span
Simon Pilgrim [Mon, 22 Aug 2022 10:26:30 +0000 (11:26 +0100)]
[CostModel][X86] Add some basic SK_Splice shuffle test coverage
These are currently recognised as SK_PermuteTwoSrc
Guillaume Chatelet [Mon, 22 Aug 2022 10:26:48 +0000 (10:26 +0000)]
[NFC][libc] Switch File impl to span instead of ArrayRef
Goran Flegar [Mon, 22 Aug 2022 10:06:47 +0000 (12:06 +0200)]
[mlir][Bazel] Fix bazel build
Add fixes for https://reviews.llvm.org/D131747
Emmmer [Mon, 22 Aug 2022 08:28:43 +0000 (16:28 +0800)]
[LLDB] Fix: make m_target_arch private
Using GetTargetArchitecture() instead of m_target_arch, and set m_target_arch to private.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D132353
Guillaume Chatelet [Mon, 22 Aug 2022 09:56:38 +0000 (09:56 +0000)]
[NFC][libc] Switch mem* tests from ArrayRef to span
David Green [Mon, 22 Aug 2022 09:58:14 +0000 (10:58 +0100)]
[ARM] Add a couple of MVE fixed-order-reduction tests. NFC
Simon Pilgrim [Mon, 22 Aug 2022 09:50:57 +0000 (10:50 +0100)]
[CostModel][X86] getShuffleCost - treat SK_Splice as SK_PermuteTwoSrc
SK_Splice should be equivalent to a PALIGNR instruction etc. - but as discussed on D132308, until full fixed vector support for SK_Splice is in place, just assume its a SK_PermuteTwoSrc.
Guillaume Chatelet [Mon, 22 Aug 2022 09:42:53 +0000 (09:42 +0000)]
[libc] Allow span views over mutable data