Commit Graph

424452 Commits

Author SHA1 Message Date
David Green b4dd9fc370 [ARM] Cost modelling for MVE vector fptoi_sat
Building on top of D125665, this adds MVE costs for fptosi.sat and
fptoui.sat, providing MVE is available and the types are legal.

Differential Revision: https://reviews.llvm.org/D125666
2022-05-20 11:00:34 +01:00
Caroline Concatto 4cd9510426 [AArch64][SME]Tied up ZA operand for accumulate instructions
This patch updates SMEInstrFormats.td to tie up ZA operand for instructions
that accumulate their results into ZA or use part of ZA as input.

Depends on: D125534

Differential Revision: https://reviews.llvm.org/D125537
2022-05-20 10:42:10 +01:00
Caroline Concatto 8765ad42cd [AArch64][SME][NFC] Add implicit operands for SME instructions in the disassembly.
This patch simplifies the switch statement in getInstruction to add
implicit operands (register ZA and Immediate  equal to zero)
in the SME operands when disassembly.

The register ZA and the zero immediate  can be added by checking the operand
in MCInstDesc.

Differential Revision: https://reviews.llvm.org/D125534
2022-05-20 10:29:21 +01:00
Daniil Dudkin a61835b1e3 [flang] Fix use-associated false-positive error
For the program provided as the test case flang fired the following
error:

    error: Semantic errors in main.f90
    error: 'foo' is not a procedure

This change fixes the error by postponing handling of `UseErrorDetails`
from `CharacterizeProcedure` to a later stage.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D125791
2022-05-20 12:14:02 +03:00
Florian Hahn cd61d4bd2f
[LV] Do not LoopSimplify/LCSSA after generating main vector loop.
At the moment LV runs LoopSimplify and reconstructs LCSSA form after
generating the main vector loop and before generating the epilogue
vector loop.

In practice, this adds a new exit block for the scalar loop because the
middle block now also branches to the original exit block of the scalar
loop. It also requires adding a new LCSSA phi in the newly created exit
block.

This complicates things when modeling exit values in VPlan, because we
would need to update the VPlan for the epilogue loop to update the newly
created LCSSA phi node.

But none of that should be necessary, as all analysis requiring
loop-simplify form is already done at this point and LCSSA form of the
original loop is not broken.

Reviewed By: bmahjour

Differential Revision: https://reviews.llvm.org/D125810
2022-05-20 09:58:40 +01:00
Zi Xuan Wu 632cfbc9f9 [NFC][test] Fix the line num of expected-error for CSKY at builtin-alloca-with-align.c 2022-05-20 16:54:23 +08:00
David Green 1379b15099 [AArch64] Fix the generation of BE Nops
Big endian Nops were being generated as d5 03 20 1f   fnmadd  s21, s30,
s0, s0, getting the bytes of the NOP in the wrong order. This switches
the bytes to not be dependant on the endianness.

Differential Revision: https://reviews.llvm.org/D125980
2022-05-20 09:31:00 +01:00
Jon Chesterfield 83c431fb9e [amdgpu] Add amdgpu_kernel calling conv attribute to clang
Allows emitting define amdgpu_kernel void @func() IR from C or C++.

This replaces the current workflow which is to write a stub in opencl that
calls an external C function implemented in C++ combined through llvm-link.

Calling the resulting function still requires a manual implementation of the
ABI from the host side. The primary application is for more rapid debugging
of the amdgpu backend by permuting a C or C++ test file instead of manually
updating an IR file.

Implementation closely follows D54425. Non-amd reviewers from there.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D125970
2022-05-20 08:50:37 +01:00
Serge Pavlov 5537b22ccb Make CompoundStmtBitfields::NumStmts not a bit-field
Number of statements in CompoundStmt is kept in a bit-field of the common
part of Stmt. The field has 24 bits for the number. To allocate a new
bit field (as attempted in https://reviews.llvm.org/D123952), this
number must be reduced, maximal number of statements in a compound
statement becomes smaller. It can result in compilation errors of some
programs.

With this change the number of statements is kept in a field of type
'unsigned int' rather than in bit-field. To make room in CompoundStmtBitfields
LBraceLoc is moved to fields of CompoundStmt.

Differential Revision: https://reviews.llvm.org/D125635
2022-05-20 14:20:09 +07:00
Peixin-Qiao 870f4421ac [flang][OpenMP] Fix the types of worksharing-loop variables
The types of lower bound, upper bound, and step are converted into the
type of the loop variable if necessary. OpenMP runtime requires 32-bit
or 64-bit loop variables. OpenMP loop iteration variable cannot have
more than 64 bits size and will be narrowed.

This patch is part of upstreaming code from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project. (#1256)

Co-authored-by: kiranchandramohan <kiranchandramohan@gmail.com>

Reviewed By: kiranchandramohan, shraiysh

Differential Revision: https://reviews.llvm.org/D125740
2022-05-20 15:16:03 +08:00
jacquesguan 8fc4fcecb8 [RISCV] Add VL patterns for vector widening floating-point fused multiply-add instructions.
This patch adds VL patterns for vector widening floating-point fused multiply-add instructions to support fixed length vector type.

Differential Revision: https://reviews.llvm.org/D124505
2022-05-20 06:56:48 +00:00
eopXD da201aa424 [RISCV][NFC] Remove `*=` operator for LMULType
LMULType always manipulate on Log2LMUL, let all manipulations go
through LMULType::MulLog2LMUL.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D126042
2022-05-19 23:47:44 -07:00
Ivan Kosarev 86803008ea [MIR] Provide location of extra instruction operand when diagnosing it.
Also resolves misspelled FileCheck directives caught with D125604.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D125965
2022-05-20 05:56:25 +01:00
Jonas Devlieghere b9a30b69d8
[lldb] Update test_software_breakpoint_set_and_remove_work for AS
On Apple Silicon the platform arch is arm64 rather than AArch64.
2022-05-19 21:40:20 -07:00
Jonas Devlieghere ea4864007c
[lldb] Fix 'ptsname_r' is only available on macOS 10.13.4 or newer
A deployment target less than 10.13.4 causes an error saying that
'ptsname_r' is only available on macOS 10.13.4 or newer. The current
logic only checks if the symbol is available and doesn't account for the
deployment target. This patch fixes that by adding an availability
check.

Differential revision: https://reviews.llvm.org/D125995
2022-05-19 21:39:52 -07:00
Philip Reames 3e5b1e9ccf [RISCV] Add test showing codegen for unaligned loads and stores of scalar types 2022-05-19 21:07:46 -07:00
Julian Lettner ec563c5a90 [ASan] Add sleep_before_init flag
Also do a little bit of refactoring instead of just copy&paste.

Differential Revision: https://reviews.llvm.org/D126037
2022-05-19 20:41:43 -07:00
Chenbing Zheng cf348f6a2c [InstCombine] [NFC] Use a pattern matcher for ExtractElementInst
Reviewed By: RKSimon, rampitec

Differential Revision: https://reviews.llvm.org/D125857
2022-05-20 10:31:40 +08:00
Vitaly Buka d33c36235d [lit] Fix setup of sanitizer environment
Not all options were propageted into tests.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D122869
2022-05-19 19:24:16 -07:00
jacquesguan 0e02bf6358 [mlir][Arithmetic] fold overlapping negf.
This patch folds negf(negf(x)) to x.

Differential Revision: https://reviews.llvm.org/D125955
2022-05-20 01:49:19 +00:00
Bill Wendling 6e00a34cdb [AArch64] Add support for -fzero-call-used-regs
Support the "-fzero-call-used-regs" option on AArch64. This involves much less
specialized code than the X86 version. Most of the checks can be done with
TableGen.

Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D124836
2022-05-19 16:58:28 -07:00
wren romano a9a19f5965 [mlir][sparse] Adding x-macros for OverheadType
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126026
2022-05-19 16:53:15 -07:00
Sam McCall 1dfd8e99f9 [Serialization] Delta encode locations in expansion sloc entries
This is a 1.9% reduction in PCH size in my measurements.

In abbreviated records, VBR6 seems to be slightl better than VBR8 for locations
that may be delta-encoded (i.e. not the first)

Differential Revision: https://reviews.llvm.org/D125952
2022-05-20 01:05:53 +02:00
Alex Brachet c3856cb739 [bazel][libc] Fix bazel build
Differential revision: https://reviews.llvm.org/D126028
2022-05-19 22:58:50 +00:00
wren romano 774674ce9a [mlir][sparse] Factored out a "FATAL" macro for unrecoverable assertion failure
Depends On D126019

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126022
2022-05-19 15:26:20 -07:00
Bill Wendling 88043c1958 [TableGen] Add generation of argument register lists
There are cases, like with -fzero-call-used-regs,  where we need to know
which registers can be used by a certain calling convention. This change
generates a list of registers used by each calling convention defined in
*CallingConv.td.

Calling conventions that use registers conditioned on Swift have those
registers placed in a separate list. This allows us to be flexible about
whether to use the Swift registers or not.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D125421
2022-05-19 15:18:25 -07:00
Bill Wendling db0ea51c83 Revert "[TableGen] Add generation of argument register lists"
There are build bot failures.

This reverts commit 3fa1b6557d.
2022-05-19 15:16:08 -07:00
wren romano aff9c89fab [mlir][sparse] Simplifying closure
By closing over the `rank` itself rather than `this`, we save a method call on each iteration.  A minor optimization, but one that adds up.

Depends On D126016

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126019
2022-05-19 15:15:33 -07:00
wren romano fa6aed2abd [mlir][sparse] Using the name "dimSizes" more consistently
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D126016
2022-05-19 15:12:44 -07:00
Bill Wendling 3fa1b6557d [TableGen] Add generation of argument register lists
There are cases, like with -fzero-call-used-regs,  where we need to know
which registers can be used by a certain calling convention. This change
generates a list of registers used by each calling convention defined in
*CallingConv.td.

Calling conventions that use registers conditioned on Swift have those
registers placed in a separate list. This allows us to be flexible about
whether to use the Swift registers or not.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D125421
2022-05-19 15:03:14 -07:00
python3kgae c6c13d4e5f [DirectX backend] When cleanup module flags only remove unused flags.
Only remove dx.valver from module flags when cleanup module flags in DXILTranslateMetadataPass.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D125842
2022-05-19 14:50:11 -07:00
Alex Brachet b1183305f8 [libc] Add strlcat
Differential Revision: https://reviews.llvm.org/D125978
2022-05-19 21:48:39 +00:00
Med Ismail Bennani 027499a824
[lldb/test] Fix PExpect.launch issue when disabling color support
This patch should fix a bug in PExpect.launch that happened when color
support is not enabled.

In that case, we need to add the `--no-use-colors` flag to lldb's launch
argument list. However, previously, each character to the string was
appended separately to the `args` list. This patch solves that by adding
the whole string to the list.

This should fix the TestIOHandlerResize failure on GreenDragon.

Differential Revision: https://reviews.llvm.org/D126021

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-05-19 14:47:04 -07:00
Craig Topper 35564fff67 Revert "[RISCV] Add test cases showing failure to remove mask on rotate amounts."
This reverts commit e2f410feea.

This exposes a pre-existing bug in type legalization that is failing
expensive checks.
2022-05-19 14:39:38 -07:00
Craig Topper dfe513ae1b Revert "[RISCV] Use selectShiftMaskXLen ComplexPattern for isel of rotates."
This reverts commit 86f7d7074a.

The test cases added for this exposed an pre-existing bug that is failing
the expensive checks bot. Reverting so I can revert that patch.
2022-05-19 14:39:38 -07:00
Alexander Shaposhnikov 6990e7477d [ConstantRange] Improve the implementation of binaryOr
This diff adjusts binaryOr to take advantage of the analysis
based on KnownBits.

Differential revision: https://reviews.llvm.org/D125933

Test plan:
1/ ninja check-llvm
2/ ninja check-llvm-unit
2022-05-19 21:39:19 +00:00
Jorge Gorbe Moya 221b7a4583 [bazel] Add lib/Basic/BuiltinTargetFeatures.h to clang:basic `hdrs`.
This header is included by
clang/unittests/CodeGen/CheckTargetFeaturesTest.cpp
so it needs to be exposed here to make it visible.
2022-05-19 14:20:17 -07:00
Kiran Chandramohan 4202d69d9e [Flang][OpenMP] Upstream the lowering of the parallel do combined construct
When parallel is used in a combined construct, then use a separate
function to create the parallel operation. It handles the parallel
specific clauses and leaves the rest for handling at the inner
operations.

Reviewed By: peixin, shraiysh

Differential Revision: https://reviews.llvm.org/D125465

Co-authored-by: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
Co-authored-by: Nimish Mishra <neelam.nimish@gmail.com>
2022-05-19 21:13:50 +00:00
Nicolas Capens c153c61fad Handle instrumentation of scalar single-precision (_ss) intrinsics
Instrumentation of scalar double-precision intrinsics such as
x86_sse41_round_sd was already handled by https://reviews.llvm.org/D82398,
but not their single-precision counterparts.

https://issuetracker.google.com/172238865

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D124871
2022-05-19 13:56:51 -07:00
Aart Bik 3b13f8805c [mlir][sparse] fix unsigned comparison bug in assert
Reviewed By: bixia, wrengr

Differential Revision: https://reviews.llvm.org/D126007
2022-05-19 13:32:09 -07:00
Jay Foad 9ece051847 [AMDGPU] Mark s_get_waveid_in_workgroup as not reading memory
It is already marked as having side effects, at least in MIR. It does
not interact with anything else that is modelled as a memory access
either in IR or MachineIR.

Differential Revision: https://reviews.llvm.org/D125985
2022-05-19 21:25:46 +01:00
Jay Foad 86b55edab6 [AMDGPU] Mark s_getreg as having side effects instead of reading memory
s_getreg does not interact with anything else that is modelled as a
memory access either in IR or MachineIR.

Differential Revision: https://reviews.llvm.org/D125968
2022-05-19 21:25:46 +01:00
Stella Stamenova 33b7df8c1f [mlir] Remove unused properties from the standalone example's lit configuration
Since these are unused, I've removed them from the configuration, so that it can be easier to read and follow.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D125132
2022-05-19 12:54:28 -07:00
Jennifer Yu 7aa9c39381 [Clang][[OpenMP5.1] Initial parser/sema for default(private) clause
This implements the default(private) clause as defined in OMP5.1

Differential Revision: https://reviews.llvm.org/D125912
2022-05-19 12:43:13 -07:00
Florian Hahn c90235f0ef
[LV] Drop wrap flags for reductions using VP def-use chain.
Update clearReductionWrapFlags to use the VPlan def-use chain from the
reduction phi recipe to drop reduction wrap flags.

This addresses an existing FIXME and fixes a crash when instructions in
the reduction chain are not used and have been removed before VPlan
codegeneration.

Fixes #55540.
2022-05-19 20:36:46 +01:00
Nico Weber e0b98902a2 [gn build] (manually) port 505ddb6b74 (remove Unit/lit.site.cfg.py) 2022-05-19 15:18:56 -04:00
Keith Smiley 505ddb6b74
[lld][test] Delete empty Unit test directory
This became empty when we removed the legacy macho lld. This results in
a warning when running `check-lld`. We can revert this in the future if
we want unit tests.

Differential Revision: https://reviews.llvm.org/D125436
2022-05-19 12:06:42 -07:00
Nico Weber 304a5a7a14 Revert "[ValueTracking] Added support to deduce PHI Nodes values being a power of 2"
This reverts commit d5c130f17e.
Breaks tests, see https://reviews.llvm.org/D125332#3525819
2022-05-19 15:05:30 -04:00
Jonathan Peyton f613e6d19d [OpenMP][libomp] Fix accidental removal of else for core attributes 2022-05-19 14:00:27 -05:00
David Green 80aab0312a [ARM] Cost modelling for scalar fptoi_sat
Similar to D124357, this adds some cost modelling for fptoi_sat for Arm
targets. Where VFP2 is available (and FP64/FP16 for the relevant types),
the operations are legal as the Arm instructions naturally saturate.
Otherwise they will need an extra smin/smax clamp, similar to AArch64.

Differential Revision: https://reviews.llvm.org/D125665
2022-05-19 19:53:21 +01:00