8088 Commits

Author SHA1 Message Date
Matt Arsenault
672e91ed98 clang: Add baseline test for nofpclass emission 2023-03-15 01:13:08 -04:00
jinge90
b38aa29717 Add __builtin_set_flt_rounds
This builtin will be converted to llvm.set.rounding intrinsic
in IR level and should be work with "#pragma STDC FENV_ACCESS ON"
since it changes default FP environment. Users can change rounding
mode via this builtin without introducing libc dependency.

Reviewed by: andrew.w.kaylor, rjmccall, sepavloff, aaron.ballman
Differential Revision: https://reviews.llvm.org/D145765
Signed-off-by: jinge90 <ge.jin@intel.com>
2023-03-15 11:13:55 +08:00
Daniel Thornburgh
d505d20a62 Revert "[LLVM][OHOS] Clang toolchain and targets"
This change had tests that break whenever LLVM_ENABLE_LINKER_BUILD_ID is
set, as is the case in the Fuchsia target.

This reverts commits:
f81317a54586dbcef0c14cf512a0770e8ecaab3d
72474afa27570a0a1307f3260f0187b703aa6d84
2023-03-14 13:46:21 -07:00
Snehasish Kumar
a1bbf5ac3c [memprof] Record BuildIDs in the raw profile.
This patch adds support for recording BuildIds usng the sanitizer
ListOfModules API. We add another entry to the SegmentEntry struct and
change the memprof raw version.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D145190
2023-03-14 18:16:38 +00:00
Matt Devereau
a1fae98ba9 [AArch64] Add svboolx2_t and svboolx4_t tuple types
https://reviews.llvm.org/D145505
2023-03-14 10:16:51 +00:00
Pavel Kosov
72474afa27 [LLVM][OHOS] Clang toolchain and targets
Add a clang part of OpenHarmony target

Related LLVM part: D138202

~~~

Huawei RRI, OS Lab

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D145227
2023-03-14 12:24:44 +03:00
Snehasish Kumar
debe80cb8d Revert "[memprof] Record BuildIDs in the raw profile."
This reverts commit 287177a47a396ca6cc0bef7696108cdaa0c68e5f.
2023-03-13 20:09:46 +00:00
Snehasish Kumar
287177a47a [memprof] Record BuildIDs in the raw profile.
This patch adds support for recording BuildIds usng the sanitizer
ListOfModules API. We add another entry to the SegmentEntry struct and
change the memprof raw version.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D145190
2023-03-13 19:28:38 +00:00
Paul Walker
1597e5e693 [SVE][Builtins] Lower X forms of fp binop/mla arithmetic builtins to dedicated intrinsics
This patch changes the lowering for the following fp builtins to
emit calls to the new aarch64.sve.###.u intrinsics.
  svabd_x, svabd_n_x
  svadd_x, svadd_n_x
  svdiv_x, svdiv_n_x
  svdivr_x, svdivr_n_x
  svmad_x, svmad_n_x
  svmax_x, svmax_n_x
  svmaxnm_x, svmaxnm_n_x
  svmin_x, svmin_n_x
  svminnm_x, svminnm_n_x
  svmla_x, svmla_n_x
  svmls_x, svmls_n_x
  svmsb_x, svmsb_n_x
  svmul_x, svmul_n_x
  svmulx_x, svmulx_n_x
  svnmad_x, svnmad_n_x
  svnmla_x, svnmla_n_x
  svnmls_x, svnmls_n_x
  svnmsb_X, svnmsb_n_x
  svsub_x, svsub_n_x
  svsubr_x, svsubr_n_x

Depends on D143765.

Differential Revision: https://reviews.llvm.org/D143767
2023-03-12 11:32:00 +00:00
ManuelJBrito
6a02cd45a5 Revert "[X86] Drop single use check for freeze(undef) in LowerAVXCONCAT_VECTORS"
This reverts commit 1a4d0eb866be909fe16da5ebffe4122aa0693d8c.
2023-03-10 22:24:01 +00:00
Zahira Ammarguellat
2f1264260b Revert "Currently the control of the eval-method is mixed with fast-math."
Setting __FLT_EVAL_METHOD__ to -1 with fast-math will set
__GLIBC_FLT_EVAL_METHOD to 2 and long double ends up being used for
float_t and double_t. This creates some ABI breakage with various C libraries.
See details here: https://github.com/llvm/llvm-project/issues/60781

This reverts commit bbf0d1932a3c1be970ed8a580e51edf571b80fd5.
2023-03-10 14:44:06 -05:00
Nikita Popov
a20874276b [Clang] Convert some tests to opaque pointers (NFC) 2023-03-10 14:43:42 +01:00
Joshua Batista
4c82050c56 Add codegen for llvm exp/exp2 elementwise builtins
Add codegen for llvm exp/exp2 elementwise builtin
The exp/exp2 elementwise builtins are necessary for HLSL codegen.
Tests were added to make sure that the expected errors are encountered when these functions are given inputs of incompatible types.
The new builtins are restricted to floating point types only.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D145270
2023-03-09 12:14:59 -08:00
Snehasish Kumar
e99b5ad383 [memprof] Add scripts to automate testdata regeneration.
The memprof profiles and binaries need to be updated in case of version
updates. This change adds three scripts for llvm-profdata, clang and
llvm tests where memprof profiles are used as inputs. Also update the
tests, profiles and binaries in this change. Change based on the review
suggestions in D145023.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D145644
2023-03-09 19:54:23 +00:00
ManuelJBrito
1a4d0eb866 [X86] Drop single use check for freeze(undef) in LowerAVXCONCAT_VECTORS
Ignoring freeze(undef) if it has multiple uses in LowerAVXCONCAT_VECTORS
causes the custom INSERT_SUBVECTOR for vector widening to be ignored.

Differential Revision: https://reviews.llvm.org/D144903
2023-03-09 14:32:30 +00:00
Aaron Ballman
feec067982 Revert "Add __builtin_set_flt_rounds"
This reverts commit 24b823554acd25009731b2519880aa18c7263550.

These changes broke the PPC build bot.
2023-03-09 08:02:31 -05:00
Aaron Ballman
9aa54db44c Revert "Disable test for __builtin_set_flt_rounds to avoid breaking PPC buildbot"
This reverts commit d4fcc692ee15b2c6d249daabe31208d6a5afa025.

(This change removed all test coverage from a previous change, also to be reverted.)
2023-03-09 08:01:55 -05:00
ManuelJBrito
85e6617b60 Revert "[X86] Drop single use check for freeze(undef) in LowerAVXCONCAT_VECTORS"
This reverts commit e2817933fdd4417673eb7f96a2842ae2dca8fc59.
2023-03-09 11:56:08 +00:00
ManuelJBrito
e2817933fd [X86] Drop single use check for freeze(undef) in LowerAVXCONCAT_VECTORS
Ignoring freeze(undef) if it has multiple uses in LowerAVXCONCAT_VECTORS
causes the custom INSERT_SUBVECTOR for vector widening to be ignored.

Differential Revision: https://reviews.llvm.org/D144903
2023-03-09 11:01:09 +00:00
jinge90
d4fcc692ee Disable test for __builtin_set_flt_rounds to avoid breaking PPC buildbot
Signed-off-by: jinge90 <ge.jin@intel.com>
2023-03-09 13:14:36 +08:00
jinge90
24b823554a Add __builtin_set_flt_rounds
This builtin will be converted to llvm.set.rounding intrinsic
in IR level and should be work with "#pragma STDC FENV_ACCESS ON"
since it changes default FP environment. Users can change rounding
mode via this builtin without introducing libc dependency.

Reviewed by: andrew.w.kaylor, rjmccall, sepavloff
Differential Revision: https://reviews.llvm.org/D144454
Signed-off-by: jinge90 <ge.jin@intel.com>
2023-03-09 11:52:52 +08:00
Sander de Smalen
07158c54ad [Clang] Create opaque type for AArch64 SVE2p1/SME2 svcount_t.
This patch adds the builtin type __SVCount_t to Clang, which is an opaque
scalable type defined in the SME2 C and C++ Language Extensions.

The type maps to the `target("aarch64.svcount")` LLVM IR type.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D136864
2023-03-07 14:43:50 +00:00
Matt Devereau
533997b026 Fix DISABLE-NOT: cc1 check in debug-info-codeview-buildinfo.c test
This check is checking for the cc1 flag but this test has been seen to fail
when FILEPATHVAL has contained cc1 in generated SHAs
2023-03-07 13:22:18 +00:00
Jun Sha (Joshua)
a7d6593a0a Add missing roundtointegral builtin functions for some FP instructions to be generated from C-written codes
To generate FROUND instructions in https://reviews.llvm.org/D143982, we need to use llvm intrinsics in IR files. Now I add some corresponding builtin functions to make sure these roundtointegral instructions can be generated from C codes.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D144935
2023-03-07 14:17:35 +08:00
Dhruv Chawla
9306ef9750 [clang][alias|ifunc]: Add a diagnostic for mangled names
When an alias or ifunc attribute refers to a function name that is
mangled, a diagnostic is emitted to suggest the mangled name as a
replacement for the given function name for every matching name in the
current TU.

Fixes #59164

Differential Revision: https://reviews.llvm.org/D143803
2023-03-06 08:59:02 -08:00
Jakub Chlanda
71b0658585 [NVPTX] Add f16 and v2f16 ldg builtins
Adds f16 and v2f16 ldg builtins and relevant tests.

Differential Revision: https://reviews.llvm.org/D144961
2023-03-03 12:49:18 +01:00
ManuelJBrito
ece0b96979 Revert "[X86] Drop single use check for freeze(undef) in LowerAVXCONCAT_VECTORS"
This reverts commit 9e58182d6446bb61dbd13c0e6314f291e50d4d7c.
2023-02-28 21:50:36 +00:00
ManuelJBrito
9e58182d64 [X86] Drop single use check for freeze(undef) in LowerAVXCONCAT_VECTORS
Ignoring freeze(undef) if it has multiple uses in LowerAVXCONCAT_VECTORS
causes the custom INSERT_SUBVECTOR for vector widening to be ignored.

Differential Revision: https://reviews.llvm.org/D14490
2023-02-28 21:39:10 +00:00
Nikita Popov
26202a57e5 [CGProfile] Don't fetch BFI without profile (NFCI)
Don't fetch BFI if the function has no entry count. Peculiarly,
the implementation was already doing this for the (no longer
existing) legacy PM implementation, but the same principle applies
to the new pass manager. The only reason why the new PM doesn't
have LazyBFI is that with the new pass manager all passes are
lazy.

This improves compile-time for non-PGO builds.
2023-02-28 15:23:07 +01:00
chendewen
ec67d703cf [SVE] Add intrinsics for uniform dsp operations that explicitly undefine the result for inactive lanes.
This patch adds new intrinsics for uniform dsp operations and changes the lowering for the following builtins to emit calls to the new aarch64.sve.###.u intrinsics.
  svsqsub_x
  svsqsub_n_x
  svuqsub_x
  svuqsub_n_x
  svsqsubr_x
  svsqsubr_n_x
  svuqsubr_x
  svuqsubr_n_x

Reviewed By: Paul Walker
Differential Revision: https://reviews.llvm.org/D144704
2023-02-27 18:44:55 +08:00
Serge Pavlov
5cc91f977e [Clang] Copy strictfp attribute from pattern to instantiation
If a template function contained a pragma that made it strictfp, code
generation for such function crashed, because the instantiation did not
have strictfp attribute. As a solution this attribute is copied from the
template to instantiation.

Differential Revision: https://reviews.llvm.org/D143919
2023-02-27 11:19:20 +07:00
Matt Arsenault
8709bcacfb clang: Add __builtin_elementwise_fma
I didn't understand why the other builtins have promotion logic,
or how it would apply for a ternary operation. Implicit conversions
are evil to begin with,  and even more so when the purpose is to get
an exact IR intrinsic. This checks all the arguments have the same type.
2023-02-24 21:55:08 -04:00
Craig Topper
83cd4bea01 [Clang] Teach buildFMulAdd to peek through fneg to find fmul.
Allows us to handle expressions like -(a * b) + c

Based on the examples from D144366 that gcc seems to get.

Reviewed By: kpn

Differential Revision: https://reviews.llvm.org/D144447
2023-02-23 09:05:59 -08:00
John Brawn
25d23b1970 [Clang][NFC] Remove pointless defines from test command lines
A few tests use -D on the command line to define macros that are
already predefined. Remove these pointless defines, as an upcoming
patch will cause this to be a warning.
2023-02-23 16:18:24 +00:00
Chuanqi Xu
6ed67ccba7 [Coroutines] Remove -fcoroutines-ts
Since we decided to remove the support for `-fcoroutines-ts` in
clang/llvm17 and the clang16/llvm16 is branched. So we're going to
remove the `-fcoroutines-ts` option.
2023-02-23 14:40:58 +08:00
Maryam Moghadas
02a71b05fc [PowerPC] Include vector bool and pixel when emitting lax warning
This patch is to fix some missing lax-vector-conversion warnings including
cases that involve vector bool and vector pixel, also to fix the vector
compatibility check for the warnings.

Differential Revision: https://reviews.llvm.org/D143210
2023-02-21 22:26:18 +00:00
Maryam Moghadas
ee815ff2ce [PowerPC] Fix the implicit casting for the emulated intrinsics
This patch is to fix some implicit castings for emulated intrinsics
so that there are no lax-vector-conversions errors and warnings.

Reviewed By: nemanjai, #powerpc

Differential Revision: https://reviews.llvm.org/D144293
2023-02-21 15:44:57 -06:00
Brad Smith
cfca5f4d0c [Driver][FreeBSD] Fix DWARF test after 2a2c0fd96757871f4e8052624000c208cc574fdf
The default DWARF version without a FreeBSD version specified is 4.
2023-02-21 14:54:23 -05:00
Ammarguellat
a790d77746 [NFC] Added a lit test for the arithmetic fence builtin. 2023-02-21 08:33:03 -05:00
Paulo Matos
890146b192 [WebAssembly] Initial support for reference type externref in clang
This patch introduces a new type __externref_t that denotes a WebAssembly opaque
reference type. It also implements builtin __builtin_wasm_ref_null_extern(),
that returns a null value of __externref_t. This lays the ground work
for further builtins and reference types.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D122215
2023-02-17 18:48:48 -08:00
Nikita Popov
06621ecdaf [Clang] Convert some tests to opaque pointers (NFC) 2023-02-17 15:08:50 +01:00
Nikita Popov
f098fb69f1 [Clang] Convert some tests to opaque pointers (NFC) 2023-02-17 14:26:07 +01:00
Nikita Popov
f3fa1086c7 [Clang] Convert some tests to opaque pointers (NFC) 2023-02-17 11:56:00 +01:00
Nikita Popov
e6e0ba8d20 [Clang] Convert some tests to opaque pointers (NFC) 2023-02-17 11:16:35 +01:00
Nikita Popov
3d84f4268d [Clang] Convert some tests to opaque pointers (NFC) 2023-02-17 09:49:03 +01:00
Nikita Popov
55a18bfe9b [Clang] Convert some tests to opaque pointers (NFC) 2023-02-17 09:29:12 +01:00
Nick Desaulniers
329ef60f3e [Clang] support for outputs along indirect edges of asm goto
Initial support for asm goto w/ outputs (D69876) only supported outputs
along the "default" (aka "fallthrough") edge.

We can support outputs along all edges by repeating the same pattern of
stores along the indirect edges that we allready do for the default
edge.  One complication is that these indirect edges may be critical
edges which would need to be split. Another issue is that mid-codgen of
LLVM IR, the control flow graph might not reflect the control flow of
the final function.

To avoid this "chicken and the egg" problem assume that any given
indirect edge may become a critical edge, and pro-actively split it.
This is unnecessary if the edge does not become critical, but LLVM will
optimize such cases via tail duplication.

Fixes: https://github.com/llvm/llvm-project/issues/53562

Reviewed By: void

Differential Revision: https://reviews.llvm.org/D136497
2023-02-16 17:58:34 -08:00
Nigel Perks
0871337d97 [XCore] Adapt Clang tests to opaque pointers.
Differential Revision: https://reviews.llvm.org/D144195
2023-02-16 16:32:29 +00:00
Nikita Popov
eb3dfa0a24 [Clang] Convert some tests to opaque pointers (NFC) 2023-02-16 17:05:26 +01:00
Nikita Popov
081815b4e3 [Clang] Regenerate check lines (NFC)
Convert test to use update_cc_test_checks.
2023-02-16 17:05:25 +01:00