Fangrui Song [Tue, 22 Nov 2022 21:33:34 +0000 (13:33 -0800)]
[libc++] Replace __ppc64__ with __powerpc64__ and fix is_iec559 for non-ibm128
The lowercase `__ppc64__` is not defined by non-darwin powerpc64 GCC, therefore
it lures users to write code which is not portable to GCC. Migrate to
`__powerpc64__` in preparation for undefining `__ppc64__`. `__powerpc64__` is
much more common than `__PPC64__`.
Update alignment_of.pass.cpp to use 1 unconditionally:
on powerpc-unknown-linux-gnu `alignof(bool) = _Alignof(bool) = __alignof(bool) = 1`.
The value 4 might be derived from an ancient Clang.
Change is_iec559 to true when long double uses uses IEEE 754 quadruple or double
precision (i.e. not ibm128).
Reviewed By: #libc, thesamesam, ldionne
Differential Revision: https://reviews.llvm.org/D137513
Louis Dionne [Tue, 22 Nov 2022 21:26:43 +0000 (16:26 -0500)]
[libc++][NFC] Add missing #ifdef for TEST_HAS_NO_WIDE_CHARACTERS
Nancy Wang [Tue, 22 Nov 2022 19:31:51 +0000 (14:31 -0500)]
XFAIL hidden-duplicates.m for AIX and zOS
as this is failing on the build bots:
https://lab.llvm.org/buildbot/#/builders/214/builds/4442/steps/6/logs/FAIL__Clang__hidden-duplicates_m
and is being investigate under https://reviews.llvm.org/D130327.
Roman Lebedev [Tue, 22 Nov 2022 21:04:06 +0000 (00:04 +0300)]
[SROA] `isVectorPromotionViable()`: integer-ify non-pointer non-common types
This rectifies a FIXME that dates all the way back
to 2014 about not doing so due to the backend issues.
Presumably sufficient amount of time has passes
and all the known issues have been addressed,
or at least we will find out of there are some left...
Roman Lebedev [Tue, 22 Nov 2022 16:54:39 +0000 (19:54 +0300)]
[SROA] `isVectorPromotionViable()`: pointer-ness is sticky
As it has been established previously by precedent,
if we see a pointer type, then that is the type we must use.
Essentially, we don't want to introduce `inttoptr`'s.
Jay Foad [Tue, 22 Nov 2022 18:40:22 +0000 (18:40 +0000)]
[AMDGPU] More cleanup after D117544. NFC.
Fangrui Song [Tue, 22 Nov 2022 20:59:45 +0000 (12:59 -0800)]
[ELF] -r: don't define _TLS_MODULE_BASE_
_TLS_MODULE_BASE_ is supposed to be defined by the final link. Defining it in a
relocatable link may render the final link value incorrect.
GNU ld i386/x86-64 have the same issue: https://sourceware.org/bugzilla/show_bug.cgi?id=29820
Yingchi Long [Fri, 11 Nov 2022 14:45:08 +0000 (22:45 +0800)]
[Sema] check InitListExpr format strings like {"foo"}
Adds InitListExpr case in format string checks.
e.g.
int sprintf(char *__restrict, const char * __restrict, ...);
int foo()
{
char data[100];
constexpr const char* fmt2{"%d"}; // no-warning
sprintf(data, fmt2, 123);
}
Fixes: https://github.com/llvm/llvm-project/issues/58900
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D137839
Fangrui Song [Tue, 22 Nov 2022 20:37:51 +0000 (12:37 -0800)]
[ELF] -r: don't define __global_pointer$
This symbol is supposed to be defined by the final executable link. The new
behavor matches GNU ld.
Davide Italiano [Tue, 22 Nov 2022 20:29:44 +0000 (12:29 -0800)]
[X86] Don't lower f16->f80 fpext to libcall on darwin.
We don't provide __extendhfxf2, and only have the soft-float
__extendhfsf2 in compiler-rt. This only changed recently with
655ba9c8a1d2, so this patch reverts back to the previous behavior.
However, the f80->f16 fptrunc is not easily implementable without
the compiler-rt __truncxfhf2, but that has always been true, and
isn't an immediate regression.
Patch by Ahmed Bougacha.
rdar://
102194995
Michael Maitland [Tue, 22 Nov 2022 00:02:47 +0000 (16:02 -0800)]
[llvm-mca] Fix class dominance warnings for parseCodeRegions
Fixes issue [59091](https://github.com/llvm/llvm-project/issues/59091).
`CodeRegionGenerator::parseCodeRegions` is implemented by `AsmCodeRegionGenerator`.
If it were to be implemented in `AnalysisRegionGenerator` or `InstrumentRegionGenerator`,
then `parseCodeRegions` from an `AsmAnalysisRegionGenerator` or `AsmInstrumentRegionGenerator`
object would be ambiguous. To solve this, `AsmAnalysisRegionGenerator` and
`AsmInstrumentRegionGenerator` qualify their call to `AsmCodeRegionGenerator::parseCodeRegions`.
Differential Revision: https://reviews.llvm.org/D138462
Shoaib Meenai [Mon, 21 Nov 2022 23:59:42 +0000 (15:59 -0800)]
[libcxxabi] Always use thread_local for cxa_exception_storage
This was previously guarded by HAS_THREAD_LOCAL, which was never set by
CMake and had to be specified manually. Android has been setting this to
solve https://github.com/android/ndk/issues/1200 [1], but every compiler
and platform libc++abi supports should have thread_local by now, so we
can just get rid of the fallback implementation and simplify things
significantly (including removing the now unused fallback calloc).
[1] https://android-review.googlesource.com/c/toolchain/llvm-project/+/1285596
Reviewed By: #libc_abi, MaskRay, ldionne
Differential Revision: https://reviews.llvm.org/D138461
Ikhlas Ajbar [Tue, 22 Nov 2022 20:19:36 +0000 (12:19 -0800)]
[Hexagon] Add missing patterns for select
Fixes https://github.com/llvm/llvm-project/issues/59077.
Benjamin Kramer [Tue, 22 Nov 2022 20:12:42 +0000 (21:12 +0100)]
[VectorCombine] Don't touch instruction after foldSingleElementStore, it might be deleted
Use after free found by asan.
Mitch Phillips [Tue, 22 Nov 2022 18:27:46 +0000 (10:27 -0800)]
Make -fsanitize=scudo use scudo_standalone. Delete check-scudo.
Leaves the implementation and tests files in-place for right now, but
deletes the ability to build the old sanitizer-common based scudo. This
has been on life-support for a long time, and the newer scudo_standalone
is much better supported and maintained.
Also patches up some GWP-ASan wording, primarily related to the fact
that -fsanitize=scudo now is scudo_standalone, and therefore the way to
reference the GWP-ASan options through the environment variable has
changed.
Future follow-up patches will delete the original scudo, and migrate all
its tests over to be part of the scudo_standalone test suite.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D138157
Stefan Gränitz [Tue, 22 Nov 2022 19:51:09 +0000 (20:51 +0100)]
Revert "[CGObjC] Add run line for release mode in test arc-exceptions-seh.mm (NFC)"
This reverts commit
01023bfcd33f922ed8c934ce563e54abe8bfe246. The extended test now triggers undefined behavior:
```
/b/sanitizer-aarch64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp:577:41: runtime error: load of value 180, which is not a valid value for type 'bool'
#0 0xaaaae3333a30 in hasCFGChanged /b/sanitizer-aarch64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp:577:41
#1 0xaaaae3333a30 in llvm::ObjCARCOptPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-aarch64-linux-bootstrap-ubsan/build/llvm-project/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp:2494:26
...
```
Fangrui Song [Tue, 22 Nov 2022 19:38:57 +0000 (11:38 -0800)]
[ELF] addRelIpltSymbols: make it explicit some passes are for non-relocatable links. NFC
and prepare for __global_pointer$ and _TLS_MODULE_BASE_ fix.
Rong Xu [Tue, 22 Nov 2022 19:22:38 +0000 (11:22 -0800)]
[CHR] Add a threshold for the code duplication
ControlHeightReduction (CHR) clones the code region to reduce the
branches in the hot code path. The number of clones is linear to the
depth of the region.
Currently it does not have control over the code size increase. We are
seeing one ~9000 BB functions get expanded to ~250000 BBs, an 25x
increase. This creates a big compile time issue for the downstream
optimizations.
This patch adds a cap for number of clones for one region.
Differential Revision: https://reviews.llvm.org/D138333
Nikolas Klauser [Fri, 4 Nov 2022 19:08:56 +0000 (20:08 +0100)]
[libc++][math.h][NFC] Refactor enable_ifs
Reviewed By: ldionne, Mordante, #libc
Spies: EricWF, libcxx-commits
Differential Revision: https://reviews.llvm.org/D137501
Nikolas Klauser [Fri, 4 Nov 2022 16:01:22 +0000 (17:01 +0100)]
[libc++][math.h] Remove some code duplication
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D137500
Nikolas Klauser [Fri, 4 Nov 2022 15:56:51 +0000 (16:56 +0100)]
[libc++][math.h] Remove __libcpp_<func> functions and instead call builtins directly
Reviewed By: ldionne, Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D137499
Nikolas Klauser [Fri, 4 Nov 2022 15:45:35 +0000 (16:45 +0100)]
[libc++] Assume that builtins for math.h functions are available
All supported compilers support the builtins, so this removes dead code and simplifies a lot of the functions through that.
Reviewed By: ldionne, #libc, EricWF
Spies: EricWF, michaelplatings, libcxx-commits
Differential Revision: https://reviews.llvm.org/D135781
Nikolas Klauser [Fri, 28 Oct 2022 01:11:44 +0000 (03:11 +0200)]
[libc++] Remove duplication in math_h.pass.cpp and improve coverage
Reviewed By: ldionne, huixie90, #libc
Spies: mstorsjo, EricWF, libcxx-commits
Differential Revision: https://reviews.llvm.org/D136908
Krzysztof Parzyszek [Fri, 18 Nov 2022 22:31:04 +0000 (14:31 -0800)]
[Hexagon] Use V6_vmpyuhvs for 16-bit mulhu on HVX v69+
Zequan Wu [Tue, 22 Nov 2022 19:00:56 +0000 (11:00 -0800)]
Reland "[LTO][COFF] Use bitcode file names in lto native object file names."
This reverts commit
eef5405f74ae208e3e2eb7daacecac923d7338f2.
Paul Kirth [Tue, 22 Nov 2022 19:12:58 +0000 (19:12 +0000)]
Revert "[clang-doc] Move file layout to the generators."
This reverts commit
f8a469fc572778d05b72f34a772082cf3abd3cda.
The test in single-file-public.cpp breaks on Mac, due to an unknown
regextype in the find command.
Benjamin Kramer [Tue, 22 Nov 2022 19:05:12 +0000 (20:05 +0100)]
[mlir] Add tablegen types for fp8 types
For consistency and allowing users easy access to these types.
Differential Revision: https://reviews.llvm.org/D138516
Vitaly Buka [Tue, 22 Nov 2022 18:50:40 +0000 (10:50 -0800)]
Revert "[AArch64] Add GPR rr instructions to isAssociativeAndCommutative"
Breaks msan on aarch64.
This reverts commit
5f7f484ee54ebbf702ee4c5fe9852502dc237121.
Zequan Wu [Tue, 22 Nov 2022 18:54:46 +0000 (10:54 -0800)]
Revert "[LTO][COFF] Use bitcode file names in lto native object file names."
This reverts commit
531ed6d5aa65f41c6dfe2e74905d5c6c88fc95a7.
Mariya Podchishchaeva [Tue, 22 Nov 2022 16:44:54 +0000 (11:44 -0500)]
[Driver][Test] Fix pic.c when CLANG_DEFAULT_PIE_ON_LINUX set to OFF
Brett Wilson [Tue, 15 Nov 2022 20:51:45 +0000 (12:51 -0800)]
[clang-doc] Move file layout to the generators.
Previously file naming and directory layout was handled on a per Info
object basis by ClangDocMain and the generators blindly wrote to the
files given. This means all generators must use the same file layout and
caused problems where multiple objects mapped to the same file. The
object collision problem happens most easily with template
specializations because the template parameters are not part of the
"name".
This patch moves the responsibility for output file organization to the
generators. Currently HTML and MD use the same structure as before. But
they now collect all objects that map to a given file and combine them,
avoiding the corruption problems.
Converts the YAML generator to naming files based on USR in one
directory. This is easier for downstream tools to manage and avoids
the naming problems with template specializations. Since this change
requires backward-incompatible output changes to referenced files anyway
(since each one is now an array), this is a good time to introduce this
change.
Differential Revision: https://reviews.llvm.org/D138073
Zequan Wu [Thu, 17 Nov 2022 21:31:40 +0000 (13:31 -0800)]
[LLDB][Minidump] Merge executable module's architecture into target's architecture.
This allows minidump process ABI to match the PE/COFF file ABI.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D137873
Sami Tolvanen [Tue, 22 Nov 2022 18:09:22 +0000 (18:09 +0000)]
[Clang][Driver] Add KCFI to SupportsCoverage
Allow `-fsanitize=kcfi` to be enabled with `-fsanitize-coverage=` modes
such as `trace-{pc,cmp}`.
Link: https://github.com/ClangBuiltLinux/linux/issues/1743
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D138458
Zequan Wu [Wed, 2 Nov 2022 00:06:01 +0000 (17:06 -0700)]
[LTO][COFF] Use bitcode file names in lto native object file names.
Currently the lto native object files have names like main.exe.lto.1.obj. In
PDB, those names are used as names for each compiland. Microsoft’s tool
SizeBench uses those names to present to users the size of each object files.
So, names like main.exe.lto.1.obj is not user friendly.
This patch makes the lto native object file names more readable by using
the bitcode file names as part of the file names. For example, if the input
bitcode file has path like "path/to/foo.obj", its corresponding lto native
object file path would be "path/to/main.exe.lto.foo.obj". Since the lto native
object file name only bothers PDB, this patch only changes the lld-linker's
behavior.
Reviewed By: tejohnson, MaskRay, #lld-macho
Differential Revision: https://reviews.llvm.org/D137217
Simon Pilgrim [Tue, 22 Nov 2022 18:16:09 +0000 (18:16 +0000)]
[DAG] isGuaranteedNotToBeUndefOrPoison - handle FrameIndex/TargetFrameIndex
Fixes #58904
dbakunevich [Mon, 14 Nov 2022 09:26:55 +0000 (16:26 +0700)]
[Utils] Improved chunk-print-before-all.py script
As part of this patch, the ability to work with dump files
containing ir after passes received using the -print-after-all
option was added to script chunk-print-before-all.py.
The names of the output files have also been changed.
Before: chunk-NUM.ll
Now: NUM-STAGE-PASS_NAME.ll
NUM - sequence number of the pass operation.
STAGE - stage of the pass operation (for example: before, after, dump).
PASS_NAME - the name of the pass.
Alexander Timofeev [Tue, 18 Oct 2022 13:34:49 +0000 (15:34 +0200)]
[AMDGPU] Avoid SCC clobbering before S_CSELECT_B32
Frame lowering inserts scalar addition to compute the offset to the
stack objects. This instructions inserted in arbitrary place and may clobber
SCC between its definition and S_CSELECT_B32 instruction. This change
workarounds this particular code pattern. It queries the scavenger for SGPR and
if available saves SCC to it and restore its value after frame lowering code
insertion.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D136169
Hassnaa Hamdi [Fri, 18 Nov 2022 13:26:53 +0000 (13:26 +0000)]
[AArch64][SME]: Generate streaming-compatible code for fp_arith and fp-fma
1-To generate code compatible to streaming mode:
- enable custom lowering for FADD, FDIV, FMA, FNEG, FSQRT, FSUB, and FABS.
Differential Revision: https://reviews.llvm.org/D138290
Hassnaa Hamdi [Fri, 18 Nov 2022 13:20:40 +0000 (13:20 +0000)]
[AArch64][SME]: Add precursory tests for D138290
Add testing files:
- fp-arith.ll
- fp-fma.ll
Kazu Hirata [Tue, 22 Nov 2022 17:57:22 +0000 (09:57 -0800)]
[ADT] Define None as std::nullopt (NFC)
This patch defines NoneType and None as std::nullopt_t and
std::nullopt, respectively.
This patch effectively makes None and std::nullopt interchangeable, so
we can gradually replace None with std::nullopt all while we continue
to use llvm::Optional.
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
Differential Revision: https://reviews.llvm.org/D138468
Simon Pilgrim [Tue, 22 Nov 2022 17:56:07 +0000 (17:56 +0000)]
[X86] Cleanup WriteBlend classes to match (V)PLENDW instruction
Minor cleanup toward fixing the unnecessary scheduler overrides warnings from D138359
Krzysztof Parzyszek [Tue, 22 Nov 2022 17:11:17 +0000 (09:11 -0800)]
[Hexagon] Make local array static in getIntrinsicForHexagonNonClangBuiltin
It should not be created on every call, the omission of `static` was a bug
in the patch that introduced it.
Kirill Stoimenov [Fri, 18 Nov 2022 23:46:54 +0000 (23:46 +0000)]
[Sanitizer][NFC] Rearranged prototype definitions in lsan_common.h to group them by implementation file.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D138335
Guozhi Wei [Tue, 22 Nov 2022 17:18:29 +0000 (17:18 +0000)]
[AArch64] Correctly recognize -reserve-regs-for-regalloc=X30,X29
In AArch64 backend X30 is named as LR, X29 is named as FP. So the code in AArch64Subtarget::AArch64Subtarget can't recognize these 2 registers.
for (unsigned i = 0; i < 31; ++i) {
if (ReservedRegNames.count(TRI->getName(AArch64::X0 + i)))
ReserveXRegisterForRA.set(i);
}
This patch add code to explicitly handle these 2 registers.
Differential Revision: https://reviews.llvm.org/D137810
Jay Foad [Tue, 22 Nov 2022 17:06:53 +0000 (17:06 +0000)]
[AMDGPU] Remove RegStrictDom variable. NFC.
D117544 removed the only substantive use of RegStrictDom. Now we can
simplify by using StrictDom for everything.
Jay Foad [Tue, 22 Nov 2022 16:59:53 +0000 (16:59 +0000)]
[AMDGPU] Define and use new allZeroWaitcnt helper. NFC.
Florian Hahn [Tue, 22 Nov 2022 16:55:08 +0000 (16:55 +0000)]
[AArch64] Add zext test with scalable vectors.
Mark de Wever [Tue, 15 Nov 2022 18:53:30 +0000 (19:53 +0100)]
[libc++][format] Fixes visit_format_arg.
The Standard specifies which types are stored in the basic_format_arg
"variant" and which types are stored as a handle. Libc++ stores
additional types in the "variant". During a reflector discussion
@jwakely mention this is user observable; visit_format_arg uses the type
instead of a handle as argument.
This optimization is useful and will probably be used for other small
types in the future. To be conferment the visitor creates a handle and
uses that as argument. There is a second visitor so the formatter can
still directly access the 128-bit integrals.
The test for the visitor and get has been made public too, there is no
reason not too. The 128-bit integral types are required by the Standard,
when they are available.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D138052
Matthias Springer [Tue, 22 Nov 2022 16:26:19 +0000 (17:26 +0100)]
[mlir][tensor] Add dim(expand_shape/collapse_shape) folding
Differential Revision: https://reviews.llvm.org/D138487
Timm Bäder [Fri, 18 Nov 2022 13:13:18 +0000 (14:13 +0100)]
[clang][Parse] Remove constant expression from if condition
MaybeTypeCast here is not a variable, it's an enum member with value 1.
Differential Revision: https://reviews.llvm.org/D138289
bixia1 [Mon, 21 Nov 2022 05:57:30 +0000 (21:57 -0800)]
[mlir][sparse] Fix a bug in concatenate operator rewriting.
When calculating the dynamic dimensions for the concatenate result, we
shouldn't accumulate the sizes for the non-concatenating dimensions.
Reviewed By: aartbik, Peiming
Differential Revision: https://reviews.llvm.org/D138436
Matt Arsenault [Sun, 20 Nov 2022 17:08:34 +0000 (09:08 -0800)]
clang/HIP: Add new header test for math IR gen
The current header testing is pretty thin. This is in
preparation for a series of patches to replace many
builtin implementations.
I did try to stress everything in this header, but skipped
a few things. Mostly I didn't understand why we have
various language version checks which skip defining some
things. It doesn't seem right to have any of these if guards
on __cplusplus, __HIPCC_RTC__, and __OPENMP_AMDGCN__.
Matt Arsenault [Mon, 21 Nov 2022 03:07:01 +0000 (19:07 -0800)]
LoopDeletion: Fix missing newlines in debug printing
Yitzhak Mandelbaum [Thu, 3 Nov 2022 00:36:58 +0000 (00:36 +0000)]
[clang][dataflow] Add widening API and implement it for built-in boolean model.
* Adds API support for widening of lattice elements and environments,
* Updates the algorithm to apply widening where appropriate,
* Implements widening for boolean values. In the process, moves the unsoundness
of comparison from the default implementation of
`Environment::ValueModel::compare` to model-specific handling inside
`DataflowEnvironment::equivalentTo`. This change is intended to clarify
the source and location of unsoundess.
This patch is a replacement for, and was based substantially on, https://reviews.llvm.org/D131645.
Differential Revision: https://reviews.llvm.org/D137948
Matthias Springer [Tue, 22 Nov 2022 16:03:32 +0000 (17:03 +0100)]
[mlir][bufferize][NFC] Minor code and comment cleanups
Differential Revision: https://reviews.llvm.org/D135056
Kelvin Li [Tue, 22 Nov 2022 15:09:47 +0000 (10:09 -0500)]
[Flang] Removing Float Bessel functions for AIX
AIX libc only provides bessel functions j0,j1,jn and y0,y1,yn but
does not have their float equivalents j0f,j1f,jnf and y0f,y1f,ynf.
Committed on behalf of madanial
Differential Revision: https://reviews.llvm.org/D136128
David Spickett [Mon, 21 Nov 2022 17:01:11 +0000 (17:01 +0000)]
[libcxx] Add BOT_OWNERS.txt
Buildkite doesn't provide a way to list bot owners so currently
we are pinging people on Discord and Phabricator.
Which works ok until that person is on vacation. This file gives us
a place to list multiple people, or group contacts for each bot.
I've stuck to the CODE_OWNERS.txt format because there's no great
reason to change it.
Reviewed By: #libc, EricWF, ldionne
Differential Revision: https://reviews.llvm.org/D138445
Vy Nguyen [Fri, 18 Nov 2022 20:21:23 +0000 (15:21 -0500)]
[lld-macho] Fix bug in CUE folding that resulted in wrong unwind table.
PR/59070
Differential Revision: https://reviews.llvm.org/D138320
Yaxun (Sam) Liu [Thu, 17 Nov 2022 17:04:57 +0000 (12:04 -0500)]
[HIP] Fix lld failure when devie object is empty
When -fgpu-rdc is used for linking relocatable objects, clang driver launches
clang-offload-bundler to extract a device relocatable object from each input
relocatable object file and passes the extracted files to lld. The input relocatable
object file could either come from HIP program or C++ program. The relocatable
object file from C++ program does not contain device relocatable objects, therefore
clang-offload-bundler extracts an empty file and passes it to lld. lld treates
empty file as linker script. When there is no object input file to lld, lld
will emit error:
target emulation unknown: -m or at least one .o file required
This patch adds "elf64_amdgpu" to lld so that lld always know the target
no matter whether there are object input files or not.
Reviewed by: Artem Belevich, Fangrui Song
Differential Revision: https://reviews.llvm.org/D138221
Stefan Pintilie [Tue, 22 Nov 2022 14:41:14 +0000 (08:41 -0600)]
[PowerPC] Add handling for WACC register spilling.
This patch adds spilling for the new WACC registers.
In order to get the spilling test to work the MMA instructions from Power 10 are
now supported for Future CPU except that they are all using the new WACC
registers instead of the ACC registers from Power 10.
Reviewed By: amyk, saghir
Differential Revision: https://reviews.llvm.org/D136728
Sanjay Patel [Tue, 22 Nov 2022 14:28:55 +0000 (09:28 -0500)]
[VectorCombine] switch on opcode to compile faster
This follows
87debdadaf18 to further eliminate wasting time
calling helper functions only to early return to the main
run loop.
Once again, this results in significant savings based on
experimental data:
https://llvm-compile-time-tracker.com/compare.php?from=
01023bfcd33f922ed8c934ce563e54abe8bfe246&to=
3dce4f70b73e48ccb045decb634c185e6b4c67d5&stat=instructions:u
This is NFCI other than making the pass faster. The total
cost of VectorCombine runs in an -O3 build appears to be
well under 0.1% of compile-time now, so there's not much
left to do AFAICT.
There's a TODO about making the code cleaner, but it
probably doesn't change timing much. I didn't include those
changes here because it requires updating much more code.
Pavel Labath [Sun, 6 Nov 2022 08:43:27 +0000 (09:43 +0100)]
[lldb] rm include/lldb/Host/posix/Fcntl.h
File is unused.
Pavel Labath [Sun, 6 Nov 2022 08:45:17 +0000 (09:45 +0100)]
Add include guards for PlatformQemuUser.h
Oleksandr "Alex" Zinenko [Tue, 22 Nov 2022 15:08:47 +0000 (16:08 +0100)]
[mlir] fix incorrect summary/description in doc
Summary is the short one.
Paul Walker [Fri, 11 Nov 2022 21:01:59 +0000 (21:01 +0000)]
[SVE] Fix incorrect predicate for fixed length int/fp conversion.
When performing shrinking int/fp conversions the predicate should
be created to match the original fixed length vector type so the
unused lanes don't trigger side effects.
This patch also includes related refactoring to better detect such
issues and streamline the code a little.
Differential Revision: https://reviews.llvm.org/D138351
Philip Pfaffe [Tue, 22 Nov 2022 14:29:19 +0000 (14:29 +0000)]
[lldb] Allow plugins to extend DWARF expression parsing for vendor extensions
Parsing DWARF expressions currently does not support DW_OPs that are vendor
extensions. With this change expression parsing calls into SymbolFileDWARF for
unknown opcodes, which is the semantically "closest" plugin that we have right
now. Plugins can then extend SymbolFileDWARF to add support for vendor
extensions.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D137247
Pierre van Houtryve [Tue, 22 Nov 2022 14:14:46 +0000 (14:14 +0000)]
[AMDGPU][NFC] Remove isLegalVOP3PShuffleMask
Unused function since D134967
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D138493
Jan Sjodin [Wed, 16 Nov 2022 13:54:05 +0000 (08:54 -0500)]
[OpenMP][OMPIRBuilder] Add a configuration class that captures flags that affect codegen
This patch introudces the OpenMPIRBuilderConfig class which contains various
flags that are needed to lower OMP constructs to LLVM-IR. The purpose is to
keep the flags in one place so they do not have to be passed in every time.
The flags can be set optionally since some uses cases don't rely on functions
that depend on these flags.
Reviewed By: jdoerfert, tschuett
Differential Revision: https://reviews.llvm.org/D138220
Ties Stuij [Tue, 22 Nov 2022 12:38:47 +0000 (12:38 +0000)]
[AArch64][clang] implement 2022 General Data-Processing instructions
This patch implements the 2022 Architecture General Data-Processing Instructions
They include:
Common Short Sequence Compression (CSSC) instructions
- scalar comparison instructions
SMAX, SMIN, UMAX, UMIN (32/64 bits) with or without immediate
- ABS (absolute), CNT (count non-zero bits), CTZ (count trailing zeroes)
- command-line options for CSSC
Associated with these instructions in the documentation is the Range Prefetch
Memory (RPRFM) instruction, which signals to the memory system that data memory
accesses from a specified range of addresses are likely to occur in the near
future. The instruction lies in hint space, and is made unconditional.
Specs for the individual instructions can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/
contributors to this patch:
- Cullen Rhodes
- Son Tuan Vu
- Mark Murray
- Tomas Matheson
- Sam Elliott
- Ties Stuij
Reviewed By: lenary
Differential Revision: https://reviews.llvm.org/D138488
Pierre van Houtryve [Tue, 22 Nov 2022 08:35:02 +0000 (08:35 +0000)]
[AMDGPU][GISel] Select llvm.amdgcn.fcmp intrinsics
Adds FP CCs opcodes/selection logic, including src mods selection
Depends on D136591, D136448
Resolves #58326 (https://github.com/llvm/llvm-project/issues/58326)
Reviewed By: arsenm, foad
Differential Revision: https://reviews.llvm.org/D136592
Youling Tang [Tue, 22 Nov 2022 14:08:47 +0000 (22:08 +0800)]
[Sanitizer] Fix the implementation of internal_fstat on LoongArch
If `pathname` is an empty string and the AT_EMPTY_PATH flag is specified in `flags`,
statx `pathname` argument is of type `const char *restrict`, so it should be `""`
instead of `0`.
Reviewed By: SixWeining, xen0n, xry111, lixing-star
Differential Revision: https://reviews.llvm.org/D138414
Valentin Clement [Tue, 22 Nov 2022 14:13:18 +0000 (15:13 +0100)]
[flang][NFC] Switch CollectBindings return to SymbolVector
As suggested on D138129, switching rteurn of CollectBindings
function to SymbolVector.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D138419
Youling Tang [Tue, 22 Nov 2022 14:02:30 +0000 (22:02 +0800)]
[scudo] Add loongarch64 support for scudo
Enable scudo on LoongArch64 on both clang side and compiler-rt side.
Reviewed By: SixWeining
Differential Revision: https://reviews.llvm.org/D138350
Valentin Clement [Tue, 22 Nov 2022 13:47:05 +0000 (14:47 +0100)]
[flang] Set initial size and type code for unlimited polymorphic descriptor
Initialization of unlimited polymorphic descriptor was raising an error.
This patch sets a default size and type code for unlimited polymoprhic descriptor
that will be updated once allocated/assigned.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D138479
David Green [Tue, 22 Nov 2022 13:47:56 +0000 (13:47 +0000)]
[SelectOptimize] Add some debug logging. NFC
This is some quick debug messages for the SelectOptimize pass, adding
some information for the costs that are measured from getInstructionCost
calls, and re-using the existing optimization remarks to print some
information about if transforms were performed or not.
Differential Revision: https://reviews.llvm.org/D138108
Dmitry Bushev [Tue, 22 Nov 2022 11:52:10 +0000 (14:52 +0300)]
[RISCV][NFC] Mark rs1 in most memory instructions as memory operand.
Marking rs1 (memory offset base) as memory operand provides additional
semantic value to this operand that can be used by different tools
(e.g. llvm-exegesis).
This change does not affect neigther Isel nor assembler. However it
required some tweaks in tablegen compressed inst emmiter.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D136847
Matthias Springer [Tue, 22 Nov 2022 13:29:47 +0000 (14:29 +0100)]
[mlir][bufferize][NFC] Rename DialectAnalysisState and move to OneShotAnalysis
`DialectAnalysisState` is now `OneShotAnalysisState::Extension`.
This state extension mechanism is needed only for One-Shot Analysis, so it is moved from `BufferizableOpInterface.h` to `OneShotAnalysis.h`.
Extensions are now identified via TypeIDs instead of StringRefs. The API of state extensions is cleaned up and follows the same pattern as other extension mechanisms in MLIR (e.g., `transform::TransformState::Extension`).
Also delete some dead code.
Differential Revision: https://reviews.llvm.org/D135051
Fahad Nayyar [Tue, 22 Nov 2022 13:26:21 +0000 (13:26 +0000)]
[Clang][Sema] Added space after ',' in a warning
This change fixes a typo in a warning message.
rdar://
79707705
Thomas Symalla [Mon, 14 Nov 2022 08:45:58 +0000 (09:45 +0100)]
[InstCombine] Fold extractelt with select of constants
An extractelt with a constant index which extracts an element from the
two vector operands of a select can be directly folded into a select.
extractelt (select %x, %vec1, %vec2), %const ->
select %x, %vec1[%const], %vec2[%const]
Note: the implementation currently only works for constant vector operands.
Reviewed By: foad, spatel
Differential Revision: https://reviews.llvm.org/D137934
Stefan Gränitz [Mon, 7 Nov 2022 11:23:58 +0000 (12:23 +0100)]
[CGObjC] Add run line for release mode in test arc-exceptions-seh.mm (NFC)
In release mode `arc-exceptions-seh.mm` fails. It needs `-enable-objc-arc-opts=false` to skip ObjC ARC optimizations.
Reviewed By: triplef
Differential Revision: https://reviews.llvm.org/D137942
Nuno Lopes [Tue, 22 Nov 2022 12:41:22 +0000 (12:41 +0000)]
Revert "[CodeGen] Use poison instead of undef as placeholder in AtomicExpandPass [NFC]"
This reverts commit
f50423c1a4422900aa1240fed643f5920451a88d.
chenglin.bi [Tue, 22 Nov 2022 12:39:25 +0000 (20:39 +0800)]
[AMDGPU] precommit test for D138401; NFC
esmeyi [Tue, 22 Nov 2022 12:17:44 +0000 (07:17 -0500)]
[XCOFF] set fragment for XMC_PR csects.
Summary: -xcoff-traceback-table is a default option on AIX regardless of optimization and debug levels. An error of relocation for paired relocatable term is not yet supported in XCOFFObjectWriter::recordRelocation occurred when both of the -xcoff-traceback-table and -function-sections are enabled.
The root cause is that we missed to calculate the symbols difference as absolute value before adding fixups when symbol_A without the fragment set is the csect itself and symbol_B is in it.
This patch only sets the fragment for XMC_PR csects because we don't have other cases that hit this problem yet.
Reviewed By: DiggerLin, hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D137230
Yi Kong [Tue, 22 Nov 2022 11:11:42 +0000 (20:11 +0900)]
Revert "[libc++] Remove workarounds for systems that used to require __need_XXX macros"
This reverts commit
119cef40d18c48240854edc553dca61c4e9fdf27.
The change broke multiple builders.
Manuel Brito [Tue, 22 Nov 2022 11:40:06 +0000 (11:40 +0000)]
[CodeGen] Use poison instead of undef as placeholder in AtomicExpandPass [NFC]
Differential Revision: https://reviews.llvm.org/D138483
Stefan Gränitz [Tue, 22 Nov 2022 09:13:33 +0000 (10:13 +0100)]
[CGObjC] Open cleanup scope before SaveAndRestore CurrentFuncletPad and push CatchRetScope early
Pushing the `CatchRetScope` early causes cleanups for catch parameters to be emitted in the basic block of the catch handler instead of the `catchret.dest` block. This is important because the latter is not part of the catchpad and this caused code truncations due to ARC PreISel intrinsics in WinEHPrepare.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D137939
Piotr Sobczak [Tue, 22 Nov 2022 09:35:07 +0000 (10:35 +0100)]
[AMDGPU] Add encoding tests for SALU_CYCLE_2/3
Add missing assembler/disassembler tests for INSTID_SALU_CYCLE_2
and INSTID_SALU_CYCLE_3 which are possible arguments in S_DELAY_ALU.
Differential Revision: https://reviews.llvm.org/D138482
Lorenzo Chelini [Tue, 22 Nov 2022 09:19:34 +0000 (10:19 +0100)]
[MLIR][Tensor] Use the existing helper function `applyPermutationToVector` (NFC)
Avoid duplicate code by using an existing helper function to interchange
a vector based on a permutation. Address comments emerged after landing
D138119.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D138480
Matthias Springer [Tue, 22 Nov 2022 10:20:41 +0000 (11:20 +0100)]
[mlir][SCF] Add tensor.dim(scf.foreach_thread) folding
Dim sizes of `scf.foreach_thread` op results match the dim sizes of their respective tied shared_outs operands.
Differential Revision: https://reviews.llvm.org/D138484
Alexander Belyaev [Tue, 22 Nov 2022 09:58:23 +0000 (10:58 +0100)]
[mlir] Update custom<DynamicIndexList> for Pack/Unpack.
Alexander Belyaev [Tue, 22 Nov 2022 07:55:59 +0000 (08:55 +0100)]
[mlir] Clean-up ViewLikeOpInterface w.r.t. kDynamic change.
Differential Revision: https://reviews.llvm.org/D138478
Benjamin Kramer [Tue, 22 Nov 2022 09:46:52 +0000 (10:46 +0100)]
[bazel] Add missing dependency after
9aa505a28d
zhanghb97 [Fri, 11 Nov 2022 08:01:05 +0000 (16:01 +0800)]
[mlir] Initial MLIR VP intrinsic integration test on host and RVV emulator.
This patch adds the initial VP intrinsic integration test on the host backend and RVV emulator. Please see more detailed [discussion on the discourse](https://discourse.llvm.org/t/mlir-vp-ops-on-rvv-backend-integration-test-and-issues-report/66343).
- Run the test cases on the host by configuring the CMake option: `-DMLIR_INCLUDE_INTEGRATION_TESTS=ON`
- Build the RVV environment and run the test cases on RVV QEMU by [this doc](https://gist.github.com/zhanghb97/
ad44407e169de298911b8a4235e68497).
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D137816
Han-Kuan Chen [Tue, 8 Nov 2022 09:43:11 +0000 (01:43 -0800)]
[CodeGen] Refactor visitSCALAR_TO_VECTOR. NFC.
Differential Revision: https://reviews.llvm.org/D137688
WuXinlong [Mon, 21 Nov 2022 03:20:41 +0000 (11:20 +0800)]
[RISCV] Add CodeGen support and MC testcase of RISCV Zca Extension
This patch add the support of RISCV Zca ext
`Zca` is a subset of C extension instructions that are compatible with the Zc extension.
So this patch implements Zca code generation with reference to the C extension and sets the 2-byte alignment for the Zca extension, just like C extension does.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D130483
Pierre van Houtryve [Tue, 22 Nov 2022 09:13:57 +0000 (09:13 +0000)]
[AMDGPU] Make aperture registers 64 bit
Makes the SRC_(SHARED|PRIVATE)_(BASE|LIMIT) registers 64 bit instead of 32.
They're still usable as 32 bit operands by using the _LO suffix.
Preparation for D137542
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D137767
Valentin Clement [Tue, 22 Nov 2022 09:11:50 +0000 (10:11 +0100)]
Revert "[flang][NFC] Switch CollectBindings return to SymbolVector"
This reverts commit
97e8eeb758fcae4f2afd9ac516ffc9509b4daaf0.
Max Kazantsev [Tue, 22 Nov 2022 08:52:49 +0000 (15:52 +0700)]
[SCEV][NFC] Introduce API for getting basic block's symbolic max exit count
Currently, it just returns exact exit count. This is a refectoring step
before it is actually implemented.
gonglingqin [Tue, 22 Nov 2022 08:16:09 +0000 (16:16 +0800)]
[LoongArch] Fix issue on CMake Xcode build configuration
Add missing dependency for loongarch-resource-headers. This patch refers to D126892 to repair same error.
Differential Revision: https://reviews.llvm.org/D138403
Valentin Clement [Tue, 22 Nov 2022 08:42:32 +0000 (09:42 +0100)]
[flang][NFC] Switch CollectBindings return to SymbolVector
As suggested on D138129, switching rteurn of CollectBindings
function to SymbolVector.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D138419