Commit Graph

436464 Commits

Author SHA1 Message Date
Joshua Batista b95c57444a [HLSL] add sqrt library function
This change exposes the sqrt library function for HLSL scalar types,
excluding long and long long doubles. Sqrt is supported for all scalar, vector,
and matrix types. This patch only adds a subset of scalar type support.

Long and long long double support is missing in this patch because that type
doesn't exist in HLSL.

The full documentation of the HLSL asin function is available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-sqrt

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D132711
2022-09-20 15:42:08 -05:00
Zequan Wu d4514b1553 [LLDB][NativePDB] Pass register_kind as reference (an oversight in 71d778f).
Fix #57799
2022-09-20 13:41:13 -07:00
Scott Linder f583151461 [NFC][AMDGPU] Refactor AMDGPUDisassembler
Clean up ahead of a patch to fix bugs in the AMDGPUDisassembler.

Use lit.local.cfg substitutions and more idiomatic use of split-file to
simplify and extend existing kernel-descriptor disassembly tests.

Add a comment to AMDHSAKernelDescriptor.h, as at least one small set
towards keeping all kernel-descriptor sensitive code in sync.

Reviewed By: kzhuravl, arsenm

Differential Revision: https://reviews.llvm.org/D130105
2022-09-20 20:37:19 +00:00
Craig Topper 549231d38e [RISCV] Support -mno-implicit-float.
This can be used to disable vectorization and memcpy/memset
expansion for things like OS kernels. It also disables implicit
uses of scalar FP, but I don't know if we have any of those for
RISC-V.

NOTE: Without this patch you can still do -Xclang -no-implicit-float

Reviewed By: rui.zhang

Differential Revision: https://reviews.llvm.org/D134077
2022-09-20 13:32:40 -07:00
Anshil Gandhi a0c53524a5 [AMDGPU] Fix size of SOPK instructions to 4 bytes
Instructions in SOPK format may not have 32-bit
literal constants following the instruction.

Differential Revision: https://reviews.llvm.org/D133972
2022-09-20 14:27:09 -06:00
Markus Böck b751da43b2 [InstCombine] Handle integer extension in `select` patterns using the condition as value
These patterns were previously only implemented for i1 type but can be extended for any integer type by also handling zext and sext operands.

Differential Revision: https://reviews.llvm.org/D134142
2022-09-20 22:25:13 +02:00
Sam McCall 8a13119007 [clangd] Remove second tracer (which breaks threading contract) 2022-09-20 22:17:34 +02:00
rkayaith 04df971d65 [mlir][standalone] Specify python path when configuring
Specifying the python path here ensures that the python binary used matches the
one used by the main MLIR tests. This is useful when cmake's automatic detection
has to be overridden.

Reviewed By: stellaraccident, bondhugula

Differential Revision: https://reviews.llvm.org/D134251
2022-09-20 15:43:39 -04:00
Frederik Gossen 6e50d66419 [MLIR] Update bazel build files after 242d558658
Differential Revision: https://reviews.llvm.org/D134301
2022-09-20 15:20:22 -04:00
George Hu 3ae633766b [LLDB]Initialize accept_socket with nullptr
Fix high impact issue of illegal access of memory.
Initialize accept_socket with nullptr.

Differential Revision: https://reviews.llvm.org/D134293
2022-09-20 12:17:32 -07:00
owenca 6257832bf9 [clang-format] Wrap inserted braces only if preceded by comments
Fixes #57805.

Differential Revision: https://reviews.llvm.org/D134233
2022-09-20 12:09:39 -07:00
Zain Jaffal 68cc35d52c
[InstCombine] Matrix multiplication negation optimisation
If one of the operands in a matrix multiplication is negated we can optimise the equation by moving the negation to the smallest element of the operands or the result.

Reviewed By: spatel, fhahn

Differential Revision: https://reviews.llvm.org/D133300
2022-09-20 19:50:39 +01:00
Matt Arsenault 28e03692ae AMDGPU: Fix expansion of 16-bit atomicrmw
Fixes issue 57830
2022-09-20 14:47:40 -04:00
Douglas Yung f2949febf3 Add explicit tests for the PS4/PS5 C/C++ standards version defaults. 2022-09-20 11:31:38 -07:00
Alex Brachet 16f735d2fb [Driver] Make --execute-only the default for aarch64-fuchsia
Clang already generates code that doesn't use writeable data in executable
sections so the linker flag is all that is necessary.

-Wl,--no-execute-only can be used to turn this default off.

Differential Revision: https://reviews.llvm.org/D134289
2022-09-20 18:25:16 +00:00
Katherine Rasmussen 2e58d3e334 [flang] Write semantics test for atomic_or
Write a semantics test for the atomic intrinsic subroutine,
atomic_or.

Reviewed By: rouson

Differential Revision: https://reviews.llvm.org/D134200
2022-09-20 11:15:53 -07:00
Fangrui Song 87792bdc38 [ELF] Name ctx->objectFiles[0] in the EF_RISCV_FLOAT_ABI mismatch error
Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D134198
2022-09-20 11:14:04 -07:00
Peiming Liu 52887071ea [mlir][scf] Support simple symbolic expression without depending on AffineDialect to simply trivial loops.
Remove dependence of AffineDialect

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D134291
2022-09-20 18:13:05 +00:00
Jeff Niu daedea39d1 [mlir][ods] Allow empty array ref parameter
This patch "fixes" a longstanding issue where the assembly format for
ArrayRefParameter could not handle an empty list. This is because there
was no way to generically optionally parse the first element of the
array. The only solution was to write a (relatively simple) custom parser.

This patch implements "empty" ArrayRefParameters by using
inverted optional groups and an optional ArrayRefParameter.

Depends on D133816

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133819
2022-09-20 11:07:56 -07:00
Jeff Niu 4792f2ab21 [mlir][ods] Generalize default/optional parameters
This patch consolidates the notions of an optional parameter and a
default parameter. An optional parameter is a parameter equal to its
default value, which for a "purely optional" parameter is its "null"
value.

This allows the existing `comparator` and `defaultValue` fields to be
used enabled more complex "optional" parameters, such as empty arrays.

Depends on D133812

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133816
2022-09-20 11:07:53 -07:00
Jeff Niu 95a33b455d [mlir][ods] Format: allow anchors in the else elements
This patch changes optional groups to allow anchors in the 'else'
element group. When printing, the optional condition is inverted to
decide which group to print. This is useful for parsing concrete
optional elements that don't have a `parseOptional*` method or some
other way to test whether it's present.

Depends on D133805

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133812
2022-09-20 11:07:50 -07:00
Jeff Niu 52a479de60 [mlir][ods] Store the pointer to the anchor element (NFC)
Instead of its index. There is no benefit to storing the index instead
of the pointer.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D133805
2022-09-20 11:07:47 -07:00
Brett Wilson 4df84ac377 [clang-doc] Centralize TypeInfo creation.
Several different places in the code had similar computations for the parameters that were eventually passed to the TypeInfo constructor.

This centralizes that code in one function, and allows passing TypeInfo to the various other *Info structures that need it.

Remove some "auto" types and replace with the real type for getting declarations. This was making some duplicate checking difficult to see.

Reviewed By: paulkirth

Differential Revision: https://reviews.llvm.org/D134225
2022-09-20 17:55:47 +00:00
Jorge Gorbe Moya dce6887336 [NFCI] Clean up enum FormatCategoryItem.
- Merge pairs like `eFormatCategoryItemSummary` and
  `eFormatCategoryItemRegexSummary` into a single value. See explanation
  below.

- Rename `eFormatCategoryItemValue` to `eFormatCategoryItemFormat`. This
  makes the enum match the names used elsewhere for formatter kinds
  (format, summary, filter, synth).

- Delete unused values `eFormatCategoryItemValidator` and
  `eFormatCategoryItemRegexValidator`.

This enum is only used to reuse some code in CommandObjectType.cpp.  For
example, instead of having separate implementations for `type summary
delete`, `type format delete`, and so on, there's a single generic
implementation that takes an enum value, and then the specific commands
derive from it and set the right flags for the specific kind of
formatter.

Even though the enum distinguishes between regular and regex matches for
every kind of formatter, this distinction is never used: enum values are
always specified in pairs like
`eFormatCategoryItemSummary | eFormatCategoryItemRegexSummary`.

This causes some ugly code duplication in TypeCategory.cpp. In order to
handle every flag combination some code appears 8 times:

{format, summary, synth, filter} x {exact, regex}

Differential Revision: https://reviews.llvm.org/D134244
2022-09-20 10:41:06 -07:00
Anton Sidorenko 3cd503f181 [NFC][RISCV] Move calculations of SDNode policy operand idx to a separate function
Since there is no guaranteed correspondence of SDNode and MI operands, we need
getters simular to RISCVII::get*OpNum for SDNodes.

More uses of getVecPolicyOpIdx will be added in D130895.

Reviewed By: craig.topper, arcbbb

Differential Revision: https://reviews.llvm.org/D134179
2022-09-20 10:36:47 -07:00
Philip Reames eda2af575f [RISCV][MC] Add support for experimental Zawrs extension
This implements experimental support for the Zawrs extension as specified here: https://github.com/riscv/riscv-zawrs/releases/download/V1.0-rc3/Zawrs.pdf. Despite the 1.0 version name, this has not been ratified and there was a major change to proposed specification between rc2 and rc3.  Once this is ratified, it'll move out of experimental status.

This change adds assembly support, but does not include C language or IR intrinsics. We can decide if we want them, and handle that in a separate patch.

Differential Revision: https://reviews.llvm.org/D133443
2022-09-20 10:15:11 -07:00
LLVM GN Syncbot b4f86f04d0 [gn build] Port 00798e5006 2022-09-20 17:07:57 +00:00
Mingming Liu ce7b4747e8 [AArch64] Define __ARM_FEATURE_RCPC
This patch implements the definition of __ARM_FEATURE_RCPC when clang
command specifies +rcpc.

Differential Revision: https://reviews.llvm.org/D127798
2022-09-20 10:03:13 -07:00
Mark de Wever 088c7f7e3c [libc++] Applies P0602R4 retro-actively.
While testing a test failure of C++17 with Clang ToT it was noticed the
paper
  P0602R4 variant and optional should propagate copy/move triviality
was not applied as a DR in libc++.

This was discovered while investigating the issue "caused by" D131479.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D133326
2022-09-20 19:01:34 +02:00
Gulfem Savrun Yeniceri f039a9fa32 [InstrProfiling] Emit runtime hook only once
This patch fixes the issue about calling emitRuntimeHook() twice
when we need to unconditionally emit runtime hook as discussed in
https://reviews.llvm.org/rGd6aed77f0d19.

Differential Revision: https://reviews.llvm.org/D134254
2022-09-20 17:00:46 +00:00
Mark de Wever 7c932cdb10 [NFC][libc++][format] Uses ranges algorithm.
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D134060
2022-09-20 18:59:50 +02:00
Mark de Wever d23f609d9c [libc++][test] Adds format string helper.
Update the formatter day tests to the new style.
Other test will be done separately.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D134031
2022-09-20 18:58:37 +02:00
Mark de Wever f2a263512c [libc++][chrono] Removes format include.
Switch to the new granular format_functions header. Since the chrono's
format dependency in C++20 hasn't been in a release it's save to remove
it.

Depends on D133665

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D133796
2022-09-20 18:58:13 +02:00
Mark de Wever 00798e5006 [libc++][format] Granularizes the format header.
Moves the last pieces of code to its own header.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D133665
2022-09-20 18:57:10 +02:00
Jay Foad f19cc793d2 [AMDGPU] Disable fp atomic to s_denorm_mode hazard for GFX11
This hazard only exists on GFX10.

Differential Revision: https://reviews.llvm.org/D134276
2022-09-20 17:40:49 +01:00
yronglin 8392f1cc78 Fix __builtin_assume_aligned incorrect type descriptor and C++ object polymorphic address
Fix __builtin_assume_aligned incorrect type descriptor

example from @rsmith

struct A { int n; };
struct B { int n; };
struct C : A, B {};

void *f(C *c) {
  // Incorrectly returns `c` rather than the address of the B base class.
  return __builtin_assume_aligned((B*)c, 8);
}

Differential Revision: https://reviews.llvm.org/D133583
2022-09-20 12:35:18 -04:00
Kazu Hirata 00874c48ea [IPO] Reorder parameters of InlineFunction (NFC)
With the recent addition of new parameter MergeAttributes (D134117),
callers need to specify several default parameters before getting to
specify the new parameter.

This patch reorders the parameters so that callers do not have to
specify as many default parameters.

Differential Revision: https://reviews.llvm.org/D134125
2022-09-20 09:09:38 -07:00
David Green cb375e8c1f [AArch64] Enable LSLFast for modern OoO cpus
This patch enables the LSLFast feature for Cortex-A76, Cortex-A77,
Cortex-A78, Cortex-A78C, Cortex-A710, Cortex-X1, Cortex-X2, Neoverse N1,
Neoverse N2, Neoverse V1 and the Neoverse 512TB pseudo-cpu, in-line with
the software optimization guides for those CPUs.

Differntial revision: https://reviews.llvm.org/D134273
2022-09-20 17:09:14 +01:00
Chris Bieneman 0c89b34337 [HLSL] Pass flags to cc1 based on language
Having the flags only pass through if you're using the dxc-driver means
that the clang driver doesn't work for HLSL, which is undesirable. This
change switches to instead passing flags based on the language mode
similar to how OpenCL does it. This allows the clang driver to be used
for HLSL source files as well.

Reviewed By: python3kgae

Differential Revision: https://reviews.llvm.org/D133958
2022-09-20 10:56:17 -05:00
Ben Dunbobbin 837caa99a2 Revert "[Utils] Refactor update_cc_test_checks.py to use shutil"
This reverts commit 2e6c50855b.

This caused failures on windows bots:
- https://lab.llvm.org/buildbot/#/builders/216/builds/10030
- https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8802513693562827489/overview
2022-09-20 16:50:18 +01:00
Simon Pilgrim 09cb9fdef9 [InstCombine] Fold ult(add(x,-1),c) -> ule(x,c) iff x != 0 (PR57635)
Alive2: https://alive2.llvm.org/ce/z/sZ6wwS

As detailed on Issue #57635 and #37628 - for unsigned comparisons, we can compare prior to a decrement iff the value is known never to be zero.

Differential Revision: https://reviews.llvm.org/D134172
2022-09-20 16:44:41 +01:00
Chris Bieneman 8aed4bb278 [CMake] [NFC] Add clang headers to IDE projects
This just adds the clang headers into a source group so that they get
collected and added into generated IDE projects.
2022-09-20 10:41:27 -05:00
Amara Emerson 78833a43e8 [GlobalISel][Legalizer] Fix lowerSelect() not sign-extending the mask value.
I'm not sure why the SEXT_INREG was gated on a bitwidth check of the mask
vs element size.

This fixes a miscompile in chromium's skia library.

Differential Revision: https://reviews.llvm.org/D134236
2022-09-20 16:40:34 +01:00
Jakub Kuderski c521a052f9 [mlir][arith] Add comparison-based integration tests
Introduces a simple framework for runtime tests of the wide integer emulation.

In these tests, we are only interested in checking that both wide and narrow calculation
produce the same results, and do not check for exact results. This allows us to cover
more of the input space, as we do not have to hardcode each of the expected outputs.

Introduce common helper functions to check the results, print a message on mismatch,
and sample the input space.

Implement runtime comparrison tests for `arith.muli` and `arith.shrui`.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D134184
2022-09-20 11:38:26 -04:00
Jakub Kuderski 883048be84 [mlir][arith] Add integration test for shrui emulation
The new test cases focus on known edge cases in the current implementation.
Specifically, we check for low (0, 1), mid (7, 8, 9) and high (15) shift amounts with i16 operands.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D134182
2022-09-20 11:29:05 -04:00
Jakub Kuderski 242d558658 [mlir][arith] Add test pass for wide integer emulation
The new test pass allows for running wide integer emulation conversion
within specified functions only.

I intend to use it in integration tests in a way that allows me print both
original and emulated results in the same format, or even compare both results
at runtime and print on mismatch only.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D134120
2022-09-20 11:22:28 -04:00
Louis Dionne 887b8bd733 [llvm] Remove libcxx, libcxxabi and libunwind from supported LLVM_ENABLE_PROJECTS
This is a breaking change. If you were passing one of those three runtimes
in LLVM_ENABLE_PROJECTS, you need to start passing them in LLVM_ENABLE_RUNTIMES
instead. The runtimes in LLVM_ENABLE_RUNTIMES will start being built using
the "bootstrapping build" instead, which means that they will be built
using the just-built Clang. This is usually what you wanted anyway.

If you were using LLVM_ENABLE_PROJECTS=all with the explicit goal of
building these three runtimes, you can now use LLVM_ENABLE_RUNTIMES=all
and these runtimes will be built using the bootstrapping build.

Differential Revision: https://reviews.llvm.org/D132480
2022-09-20 11:12:51 -04:00
Eric Li 403d72cd43 [Support][NFC] Clarify function comment
Follow-up to 86118ec2 that addresses the comments in D134072, which
were accidentally left off of the commit.
2022-09-20 11:10:16 -04:00
Eric Li 86118ec2d0 [Support] Provide access to the full mapping in llvm::Annotations
Providing access to the mapping of annotations allows test helpers to
be expressive by using the annotations as expectations. For example, a
matcher could verify that all annotated points were matched by a
matcher, or that an refactoring surgically modifies specific ranges.

Differential Revision: https://reviews.llvm.org/D134072
2022-09-20 11:06:21 -04:00
Joe Nash b982ba2a6e [AMDGPU][GFX11] Use VGPR_32_Lo128 for VOP1,2,C
Due to the encoding changes in GFX11, we had a hack in place that
    disables the use of VGPRs above 128. This patch removes the need for
    that hack.

    We introduce a new register class VGPR_32_Lo128 which is used for 16-bit
    operands of VOP1, VOP2, and VOPC instructions. This register class only has the
    low 128 VGPRs, but is otherwise identical to VGPR_32. Therefore, 16-bit VOP1,
    VOP2, and VOPC instructions are correctly limited to use the first 128
    VGPRs, while the other instructions can freely use all 256.

    We introduce new pseduo-instructions used on GFX11 which have the suffix
    t16 (True 16) to use the VGPR_32_Lo128 register class.

Reviewed By: foad, rampitec, #amdgpu

Differential Revision: https://reviews.llvm.org/D133723
2022-09-20 09:56:28 -04:00