Commit Graph

428877 Commits

Author SHA1 Message Date
serge-sans-paille 3897d3cf71 [clang-tidy] By-pass portability issues in confusable-identifiers test 2022-07-05 12:36:00 +02:00
Kazushi (Jam) Marukawa 9ad38e5288 Revert "[VE] Restructure eliminateFrameIndex"
This reverts commit 98e52e8bff.
2022-07-05 19:35:12 +09:00
Kazushi (Jam) Marukawa 98e52e8bff [VE] Restructure eliminateFrameIndex
Restructure the current implementation of eliminateFrameIndex function
in order to support more instructions.

Reviewed By: efocht

Differential Revision: https://reviews.llvm.org/D129034
2022-07-05 19:28:11 +09:00
Jun Zhang f03b876e7e
Reland "Reland "[NFC] Add a missing test for for clang-repl""
This reverts commit 6956840b5c.
Try to use `XFAIL: windows-msvc || ps4` to disable all unsupported targets.

Signed-off-by: Jun Zhang <jun@junz.org>
2022-07-05 18:23:26 +08:00
Muhammad Omair Javaid ba14e4d65c [LLDB] Disable TestGdbRemoteFork* for Arm/AArch64 Linux
This test is causing some trouble with LLDB Arm/AArch64 Linux buildbot.
I am disabling is temporarily to make buildbot green.
2022-07-05 13:45:26 +04:00
Archibald Elliott 1666f09933 [ARM] Add Support for Cortex-M85
This patch adds support for Arm's Cortex-M85 CPU. The Cortex-M85 CPU is
an Arm v8.1m Mainline CPU, with optional support for MVE and PACBTI,
both of which are enabled by default.

Parts have been coauthored by by Mark Murray, Alexandros Lamprineas and
David Green.

Differential Revision: https://reviews.llvm.org/D128415
2022-07-05 10:43:31 +01:00
Yi Kong f6fa998590 Fix tests with non-default CLANG_DEFAULT_LINKER
Force -fuse-ld option, as some other tests in the same file do.
2022-07-05 17:26:34 +08:00
Sven van Haastregt f8e658ec9f [OpenCL] Remove fast_ half geometric builtins
These are not mentioned in the OpenCL C Specification nor in the
OpenCL Extension Specification.

Differential Revision: https://reviews.llvm.org/D128436
2022-07-05 10:22:34 +01:00
Florian Hahn 271b470f3f
[IndVars] Precommit test with redundant FPToSI.
Test for #55505.
2022-07-05 10:21:33 +01:00
Chenbing Zheng b43dd2f6c4 [InstCombine] improve fold for icmp_eq_and to icmp_ult
In D95959, the improve analysis for "C >> X" broken the fold
((%x & C) == 0) --> %x u< (-C) iff (-C) is power of two.

It simplifies C, but fails to satisfy the fold condition.
This patch try to restore C before the fold.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D128790
2022-07-05 17:18:23 +08:00
Peter Waller 220366d5b5 [gn build] (manually) port 6b3956e123
Differential Revision: https://reviews.llvm.org/D129080
2022-07-05 09:12:30 +00:00
Chenbing Zheng b66220f25a [InstCombine] [NFC] use C.isNegatedPowerOf2() instead of (~C + 1).isPowerOf2()
Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D129103
2022-07-05 17:04:59 +08:00
Nico Weber b6ad8cbb35 [gn build] (manually) port dfb77f2e99 2022-07-05 10:59:41 +02:00
Kaining Zhong dc46ae6df5 [lldb] Add support to load object files from thin archives
This fixes https://github.com/llvm/llvm-project/issues/50114 where lldb/mac
can't load object files from thin archives.  This patch allows lldb to identify
thin archives, and load object files contained in them.

Differential Revision: https://reviews.llvm.org/D126464
2022-07-05 10:52:26 +02:00
Chenbing Zheng 00cb1c33ee [InstCombine] add negtive tests for (%x & C) == 0 -> %x u< (-C). nfc 2022-07-05 16:49:20 +08:00
David Sherwood 77b13a57a9 [AArch64][SME] Add SME addha/va intrinsics
This patch adds new the following SME intrinsics:

  @llvm.aarch64.sme.addva
  @llvm.aarch64.sme.addha

Differential Revision: https://reviews.llvm.org/D127861
2022-07-05 09:47:17 +01:00
Ben Dunbobbin dfb77f2e99 [LLD][ELF] Add FORCE_LLD_DIAGNOSTICS_CRASH to force LLD to crash
Add FORCE_LLD_DIAGNOSTICS_CRASH inspired by the existing
FORCE_CLANG_DIAGNOSTICS_CRASH.

This is particularly useful for people customizing LLD as they may
want to modify the crash reporting behavior.

Differential Revision: https://reviews.llvm.org/D128195
2022-07-05 09:43:09 +01:00
Florian Hahn 774fc63490
[LV] Consider minimum vscale assmuption for RT check cost.
For scalable VFs, the minimum assumed vscale needs to be included in the
cost-computation, otherwise a smaller VF may be used for RT check cost
computation than was used for earlier cost computations.

Fixes a RISCV test failing with UBSan due to both scalar and vector
loops having the same cost.
2022-07-05 09:41:58 +01:00
Nicolas Vasilache df5c981be3 [mlir][Linalg] Add DropUnitDims support for tensor::ParallelInsertSliceOp.
ParallelInsertSlice behaves similarly to tensor::InsertSliceOp in its
rank-reducing properties.
This revision extends rank-reducing rewrite behavior and reuses most of the
existing implementation.

Differential Revision: https://reviews.llvm.org/D129091
2022-07-05 01:36:13 -07:00
Manuel Klimek 4de0680fbf Fix use of pointer arithmetic instead of iterators. 2022-07-05 08:23:42 +00:00
Nikolas Klauser 0d0bd17fcf [libc++] Fix __split_buffer::__construct_at_end definition to match declaration 2022-07-05 10:19:21 +02:00
Nikolas Klauser 00927334df [libc++] Use __is_exactly_{input, forward}_iterator
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D128646
2022-07-05 10:06:27 +02:00
Nikita Popov b69c75d53f Revert "[VectorCombine] Improve shuffle select shuffle-of-shuffles"
This reverts commit 19a1e20b8a.

Clang crashes while linking bullet from llvm-test-suite in
ReleaseLTO-g cmake configuration.
2022-07-05 09:31:20 +02:00
Jean Perier b094c737cd [flang] Avoid opaque pointer issue with character array substring addressing
When addressing a substring of a character array, codegen emits two
GEPs: one for to compute the address of the base element, and a second
one to address the first characters from that element.

The first GEP still returns the LLVM array type (if the FIR array type could be
translated to an array type. Therefore) so zero
indexes must be added to the second GEP in this case to cover for the
Fortran array dimensions before inserting the susbtring offset index.

Surprisingly, the previous code worked ok when MLIR emits none opaque
pointers. But with opaque pointers, the two GEPs are folded in an
invalid GEP where the substring offset becomes an offset for the outer
array dimension.

Note that I tried to fix the issue by modifying the first GEP to return the
element type, but this still gave bad results (here something might be
wrong with opaque pointer in MLIR or LLVM).

Differential Revision: https://reviews.llvm.org/D129079
2022-07-05 09:13:54 +02:00
serge-sans-paille 7a550212e8 [clang-tidy] Fix confusable identifiers interaction with DeclContext
Properly checks enclosing DeclContext, and add the related test case.
It would be great to be able to use Sema to check conflicting scopes, but that's
not something clang-tidy seems to be able to do :-/

Fix #56221

Differential Revision: https://reviews.llvm.org/D128715
2022-07-05 08:56:26 +02:00
Craig Topper f27672924e [RISCV] Replace an explicit check with an assert.
Shift amounts should never be 0 or more than bitwidth - 1.
2022-07-04 23:21:54 -07:00
Craig Topper 66790b70ea [RISCV] Rename some variables for clarity. NFC 2022-07-04 23:21:54 -07:00
Stephan Bergmann 4996e3f683 [test] Check for more -fsanitize=array-bounds behavior
...that had temporarily regressed with (since reverted)
<886715af96>
"[clang] Introduce -fstrict-flex-arrays=<n> for stricter handling of flexible
arrays", and had then been seen to cause issues in the wild:

For one, the HarfBuzz project has various "fake" flexible array members of the
form

> Type                arrayZ[HB_VAR_ARRAY];

in <https://github.com/harfbuzz/harfbuzz/blob/main/src/hb-open-type.hh>, where
HB_VAR_ARRAY is a macro defined as

> #ifndef HB_VAR_ARRAY
> #define HB_VAR_ARRAY 1
> #endif

in <https://github.com/harfbuzz/harfbuzz/blob/main/src/hb-machinery.hh>.

For another, the Firebird project in
<https://github.com/FirebirdSQL/firebird/blob/master/src/lock/lock_proto.h> uses
a trailing member

>         srq lhb_hash[1];                        // Hash table

as a "fake" flexible array, but declared in a

> struct lhb : public Firebird::MemoryHeader

that is not a standard-layout class (because the Firebird::MemoryHeader base
class also declares non-static data members).

(The second case is specific to C++.  Extend the test setup so that all the
other tests are now run for both C and C++, just in case the behavior could ever
start to diverge for those two languages.)

A third case where -fsanitize=array-bounds differs from -Warray-bounds (and
which is also specific to C++, but which doesn't appear to have been encountered
in the wild) is when the "fake" flexible array member's size results from
template argument substitution.

Differential Revision: https://reviews.llvm.org/D128783
2022-07-05 08:12:53 +02:00
Daniel Bertalan 2028fe6fbc [lld-macho] Handle LOH_ARM64_ADRP_LDR_GOT optimization hints
This hint instructs the linker to perform the AdrpLdr or AdrpAdd
transformation depending on whether the GOT load has been relaxed to
load a local symbol's address.

Differential Revision: https://reviews.llvm.org/D129059
2022-07-05 07:33:13 +02:00
Christian Sigg 3e01af093f [mlir] Add InferIntRangeInterface to gpu.launch
Infers block/grid dimensions/indices or ranges of such dimensions/indices.

Reviewed By: krzysz00

Differential Revision: https://reviews.llvm.org/D129036
2022-07-05 07:14:54 +02:00
Fangrui Song 0c01f42fad [llvm-objcopy] -O binary: align sh_offset for section changed from SHT_NOBITS
For a SHT_NOBITS section like .bss, its sh_offset is typically not
aligned by sh_addralign. If it is converted to SHT_PROGBITS by
`--set-section-flags .bss=alloc,contents`, we should conceptually align
it when computing the output size for -O binary. Otherwise the output
size may be smaller than GNU objcopy produced output.

* binary-no-paddr.test has a case with non-sensical p_paddr=1 which has
  a changed behavior. Update it.

Close https://github.com/llvm/llvm-project/issues/55246

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D128961
2022-07-04 21:45:19 -07:00
wanglei 3610d5f5d4 [LoongArch] Add initial support for function calls
Note that this is just enough for simple function call examples to
generate working code.

A good portion of this patch is the extra functions that needed to be
implemented to support the test case. e.g. storeRegToStackSlot,
loadRegFromStackSlot, eliminateFrameIndex.

Differential Revision: https://reviews.llvm.org/D128429
2022-07-05 12:02:14 +08:00
wanglei b940fe6fe2 [LoongArch] Add codegen support for conditional branches
Setting ISD::BR_CC to Expand makes it much easier to deal with
matching the expanded form.

Differential Revision: https://reviews.llvm.org/D128428
2022-07-05 11:59:58 +08:00
wanglei 5b4851ed91 [LoongArch] Add codegen support for load/store operations
This patch also support lowering global addresses.

Differential Revision: https://reviews.llvm.org/D128427
2022-07-05 11:58:20 +08:00
Yeting Kuo 939352b6ec [RISCV][Clang] Teach RISCVEmitter to generate BitCast for pointer operands.
RVV C intrinsics use pointers to scalar for base address and their corresponding
IR intrinsics but use pointers to vector. It makes some vector load intrinsics
need specific ManualCodegen and MaskedManualCodegen to just add bitcast for
transforming to IR.

For simplifying riscv_vector.td, the patch make RISCVEmitter detect pointer
operands and bitcast them.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D129043
2022-07-05 11:02:44 +08:00
Chuanqi Xu 85318d3281 [NFC] Remove unused test inputs 2022-07-05 10:55:24 +08:00
phyBrackets 98c6a3c0c2 [NFC][ASTImporter] remove the unnecessary condition checks in ASTImporter.cpp
I think that these conditions are unnecessary because in VisitClassTemplateDecl we import the definition via the templated CXXRecordDecl and in VisitVarTemplateDecl via the templated VarDecl. These are named ToTemplted and DTemplated respectively.

Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D128608
2022-07-05 08:12:01 +05:30
jacquesguan 063500afc0 [RISCV][NFC] Merge the isolated decleration into foreach.
Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D129063
2022-07-05 10:17:45 +08:00
zhongyunde b2b4c8721d [InstCombine] Make use of low zero bits to determine exact int->fp cast
According the comment https://reviews.llvm.org/D127854#inline-1226805,
We could also make use of these low zero bits, https://alive2.llvm.org/ce/z/GYxTRu

Reviewed By: spatel, nikic, xbolva00

Differential Revision: https://reviews.llvm.org/D128895
2022-07-05 09:15:12 +08:00
Sanjay Patel 142aca7741 [InstCombine] fold sub of min/max of sub with common operand
x - max(x - y, 0) --> min(x, y)
  x - min(x - y, 0) --> max(x, y)

https://alive2.llvm.org/ce/z/2YkqFe

issue #55470
2022-07-04 18:55:24 -04:00
Sanjay Patel 8ef053273a [InstCombine] add tests for sub of smin/smax; NFC
issue #55470
2022-07-04 18:46:40 -04:00
Sanjay Patel 4276d00b12 [InstCombine] add helper function for sub-of-min/max folds; NFC
The test diffs are cosmetic -- but improvements -- because we
let instcombine handle replacement. Instead of dropping the
old value name, it propagates to the new instruction.
2022-07-04 17:43:18 -04:00
Joseph Huber b6178ccfe8 [OffloadPackager] Use appropriate kind for LTO bitcode
Summary:
Currently we just check the extension to set the image kind. This
incorrectly labels the `.o` files created during LTO as object files.
This patch simply adds a check for the bitcode magic bytes instead.
2022-07-04 17:34:14 -04:00
Jonas Hahnfeld a4e2c1f762 [Orc][LLJIT] Use JITLink on RISC-V
RuntimeDyld does not support RISC-V, so it makes sense to enable
JITLink by default. This also makes relocations work without support
for a large code model.

Differential Revision: https://reviews.llvm.org/D129092
2022-07-04 23:09:38 +02:00
Simon Pilgrim 623250b511 [X86] Regenerate fold-tied-op.ll test checks 2022-07-04 21:43:46 +01:00
Florian Hahn 2a82c15f63
[LV] Consider runtime checks profitable if scalar cost is zero.
This fixes an UBSan failure after 644a965c1e. When using
user-provided VFs/ICs (via the force-vector-width /
force-vector-interleave options) the scalar cost is zero, which would
cause divide-by-zero.

When forcing vectorization using the options, the cost of the runtime
checks should not block vectorization.
2022-07-04 21:37:16 +01:00
Nico Weber 1ab37d996c [clang-format] Update documentation
- Update `clang-format --help` output after b1f0efc06a.
- Update `clang-format-diff.py` help text, which apparently hasn't
  been updated in a while. Since git and svn examples are now part
  of the help text, remove them in the text following the help text.

Differential Revision: https://reviews.llvm.org/D129050
2022-07-04 21:42:08 +02:00
owenca 47bdf53a5d [clang-format] Break on AfterColon only if not followed by comment
Break after a constructor initializer colon only if it's not followed by a
comment on the same line.

Fixes #41128.
Fixes #43246.

Differential Revision: https://reviews.llvm.org/D129057
2022-07-04 12:34:19 -07:00
Valentin Clement 12d26ce9b0
[flang] Make code more homogenous in CodeGen
This patch just make the code more similar
in each conversion.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D129071
2022-07-04 21:16:29 +02:00
Sam McCall b37dafd5dc [pseudo] Store shift and goto actions in a compact structure with faster lookup.
The actions table is very compact but the binary search to find the
correct action is relatively expensive.
A hashtable is faster but pretty large (64 bits per value, plus empty
slots, and lookup is constant time but not trivial due to collisions).

The structure in this patch uses 1.25 bits per entry (whether present or absent)
plus the size of the values, and lookup is trivial.

The Shift table is 119KB = 27KB values + 92KB keys.
The Goto table is 86KB = 30KB values + 57KB keys.
(Goto has a smaller keyspace as #nonterminals < #terminals, and more entries).

This patch improves glrParse speed by 28%: 4.69 => 5.99 MB/s
Overall the table grows by 60%: 142 => 228KB.

By comparison, DenseMap<unsigned, StateID> is "only" 16% faster (5.43 MB/s),
and results in a 285% larger table (547 KB) vs the baseline.

Differential Revision: https://reviews.llvm.org/D128485
2022-07-04 19:40:04 +02:00