Commit Graph

419043 Commits

Author SHA1 Message Date
Daniil Kovalev 828b63c309 [NVPTX] Enhance vectorization of ld.param & st.param
Since function parameters and return values are passed via param space, we
can force special alignment for values hold in it which will add vectorization
options. This change may be done if the function has private or internal
linkage. Special alignment is forced during 2 phases.

1) Instruction selection lowering. Here we use special alignment for function
   prototypes (changing both own return value and parameters alignment), call
   lowering (changing both callee's return value and parameters alignment).

2) IR pass nvptx-lower-args. Here we change alignment of byval parameters that
   belong to param space (or are casted to it). We only handle cases when all
   uses of such parameters are loads from it. For such loads, we can change the
   alignment according to special type alignment and the load offset. Then,
   load-store-vectorizer IR pass will perform vectorization where alignment
   allows it.

Special alignment calculated as maximum from default ABI type alignment and
alignment 16. Alignment 16 is chosen because it's the maximum size of
vectorized ld.param & st.param.

Before specifying such special alignment, we should check if it is a multiple
of the alignment that the type already has. For example, if a value has an
enforced alignment of 64, default ABI alignment of 4 and special alignment
of 16, we should preserve 64.

This patch will be followed by a refactoring patch that removes duplicating
code in handling byval and non-byval arguments.

Differential Revision: https://reviews.llvm.org/D120129
2022-03-24 12:36:52 +03:00
Dávid Bolvanský 2af845a651 Relands "[Clang] -Wunused-but-set-variable warning - handle also pre/post unary operators" 2022-03-24 10:34:44 +01:00
Daniil Kovalev a034878564 Revert "[NVPTX] Enhance vectorization of ld.param & st.param"
This reverts commit f854434f0f.

Placed URL to wrong differential revision in commit message.
2022-03-24 12:32:06 +03:00
Dávid Bolvanský 3642baf5dd [NFCI] Fix set-but-unused warning in X86DisassemblerTables.cpp 2022-03-24 10:31:29 +01:00
Daniil Kovalev f854434f0f [NVPTX] Enhance vectorization of ld.param & st.param
Since function parameters and return values are passed via param space, we
can force special alignment for values hold in it which will add vectorization
options. This change may be done if the function has private or internal
linkage. Special alignment is forced during 2 phases.

1) Instruction selection lowering. Here we use special alignment for function
   prototypes (changing both own return value and parameters alignment), call
   lowering (changing both callee's return value and parameters alignment).

2) IR pass nvptx-lower-args. Here we change alignment of byval parameters that
   belong to param space (or are casted to it). We only handle cases when all
   uses of such parameters are loads from it. For such loads, we can change the
   alignment according to special type alignment and the load offset. Then,
   load-store-vectorizer IR pass will perform vectorization where alignment
   allows it.

Special alignment calculated as maximum from default ABI type alignment and
alignment 16. Alignment 16 is chosen because it's the maximum size of
vectorized ld.param & st.param.

Before specifying such special alignment, we should check if it is a multiple
of the alignment that the type already has. For example, if a value has an
enforced alignment of 64, default ABI alignment of 4 and special alignment
of 16, we should preserve 64.

This patch will be followed by a refactoring patch that removes duplicating
code in handling byval and non-byval arguments.

Differential Revision: https://reviews.llvm.org/D121549
2022-03-24 12:25:36 +03:00
Krasimir Georgiev be5c3ca7fb Revert "[clang-format] Correctly recognize arrays in template parameter list."
This reverts commit 126b37a713.

Regressed some ObjC patterns, see comments on https://reviews.llvm.org/D121584.
2022-03-24 10:14:13 +01:00
Qiu Chaofan d00e8400e2 [Clang] Add option to set alternative toolchain path
In some cases, we need to set alternative toolchain path other than the
default with system (headers, libraries, dynamic linker prefix, ld path,
etc.), e.g., to pick up newer components, but keep sysroot at the same
time (to pick up extra packages).

This change introduces a new option --overlay-platform-toolchain to set
up such alternative toolchain path.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D121992
2022-03-24 17:01:35 +08:00
Raphael Isemann 1104d79261 Revert "[ELF] Enable new passmanager plugin support for LTO"
This reverts commit 32012eb11b.

Broke CMake configuration.
2022-03-24 09:57:15 +01:00
Kristof Beyls 51d9aaf4e5 Update my office hours
Adding LLVM security group as another topic I can talk about.
2022-03-24 09:56:43 +01:00
David Green 54bc9ad2e8 [AArch64] Make some methods static. NFC 2022-03-24 08:55:27 +00:00
Peixin-Qiao 6ce82eae1f [NFC][flang] Remove unused code in lowerExplicitLowerBounds
There is no need to lower the implicit lower bounds for assumed-shape
array in lowerExplicitLowerBounds. Remove the unused code.

Reviewed By: Jean Perier

Differential Revision: https://reviews.llvm.org/D122280
2022-03-24 16:50:38 +08:00
Tobias Hieta 67d9276b16 [clang-cl] Ignore /Wv and /Wv:17 flags
MSVC supports passing /Wv and /Wv:17 to ignore warnings added
since that version. Clang doesn't have a option like this - but
we can ignore this flag instead of error.

MSVC documentation: https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level

Reviewed By: hans, mstorsjo

Differential Revision: https://reviews.llvm.org/D122298
2022-03-24 09:42:34 +01:00
Jean Perier ca46521a4d [flang] UBOUND() edge case: empty dimension
Similarly to LBOUND in https://reviews.llvm.org/D121488, UBOUND must
return zero for an empty dimension, no matter the specification
expression.

Add a GetUBOUND method to be used in expression rewrite that prevents
folding UBOUND to a bound specification expression if the extent is
not a compile time constant.

Fold the case where the extents is known to be zero (and also deal with
this case in LBOUND since we can and should to comply with constant
expression requirements).

Differential Revision: https://reviews.llvm.org/D122242
2022-03-24 09:07:15 +01:00
Nimish Mishra 88d5289fc6 [flang][OpenMP] Added lowering support for sections construct
This patch adds lowering support (from PFT to FIR) for sections construct

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D122302
2022-03-24 13:29:38 +05:30
Dávid Bolvanský 431c14248b [NFCI] Fix set-but-unused warning in SPIRVUtilsGen.cpp 2022-03-24 08:53:42 +01:00
Dávid Bolvanský 4397504c2d [NFCI] Fix set-but-unused warning in InstCombineAddSub.cpp 2022-03-24 08:33:40 +01:00
Dávid Bolvanský 9a738c477e [NFCI] Fix set-but-unused warning in RISCVAsmParser.cpp 2022-03-24 08:33:40 +01:00
Dávid Bolvanský 03e7fb9d53 [NFCI] Fix set-but-unused warning in X86LoadValueInjectionLoadHardening.cpp 2022-03-24 08:33:40 +01:00
jacquesguan 8910ac400c [RISCV] Add patterns for vector widening integer multiply
Add patterns for vector widening integer multiply instructions

Differential Revision: https://reviews.llvm.org/D117385
2022-03-24 15:26:08 +08:00
Dávid Bolvanský 1c13bbdde6 [NFCI] Fix set-but-unused warning in UnwrappedLineParser.cpp 2022-03-24 08:13:29 +01:00
Dávid Bolvanský 630ea7e58f [NFCI] Fix set-but-unused warning in GlobalsStream.cpp 2022-03-24 08:13:29 +01:00
Dávid Bolvanský 470e1d9584 [NFCI] Fix set-but-unused warning in AddressSanitizer.cpp 2022-03-24 08:13:29 +01:00
Dávid Bolvanský 44572be295 [NFCI] Fix set-but-unused warning in X86AsmBackend.cpp 2022-03-24 08:13:28 +01:00
Dávid Bolvanský 48285c20eb [NFCI] Fix set-but-unused warning in ClangAttrEmitter.cpp 2022-03-24 08:13:28 +01:00
Timm Bäder 711e3a5691 [clang][parse] Move source range into ParsedAttibutesView
Move the SourceRange from the old ParsedAttributesWithRange into
ParsedAttributesView, so we have source range information available
everywhere we use attributes.

This also removes ParsedAttributesWithRange (replaced by simply using
ParsedAttributes) and ParsedAttributesVieWithRange (replaced by using
ParsedAttributesView).

Differential Revision: https://reviews.llvm.org/D121201
2022-03-24 08:11:57 +01:00
Jakob Koschel 32012eb11b [ELF] Enable new passmanager plugin support for LTO
Add cli options for new passmanager plugin support to lld.

Currently it is not possible to load dynamic NewPM plugins with lld. This is an
incremental update to D76866. While that patch only added cli options for
llvm-lto2, this adds them for lld as well. This is especially useful for running
dynamic plugins on the linux kernel with LTO.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D120490
2022-03-24 08:08:54 +01:00
Siva Chandra Reddy 107ce71849 [libc] Use real objects and archives in integration tests.
Previously, we used empty, non-ELF crti.o, crtn.o, libm.a and libc++.a
files. Instead, we now still use dummies but they are real ELF object
files and archives.
2022-03-24 07:02:33 +00:00
gysit b257dba58e [mlir][linalg] Create AffineMinOp map in canoncial form.
Create the AffineMinOp used to compute the padding width in canonical form and update the tests.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D122311
2022-03-24 06:55:59 +00:00
Dávid Bolvanský a683ba4ff5 [NFCI] Fix set-but-unused warning in CGOpenMPRuntime.cpp 2022-03-24 07:49:21 +01:00
Dávid Bolvanský dc46fa41d4 [NFCI] Fix set-but-unused warning in ExprConstant.cpp 2022-03-24 07:47:50 +01:00
Dávid Bolvanský 5b6b840531 Revert "[Clang] -Wunused-but-set-variable warning - handle also pre/post unary operators"
This reverts commit 460fc440ad.
2022-03-24 07:44:51 +01:00
Shraiysh Vaishay cd28353e3f [flang] Single construct translation from PFT to FIR
This patch adds translation for single construct along with nowait
clause from PFT to FIR.

Allocate clause is added as a TODO as handleAllocateClause is added in
D122302.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D122324
2022-03-24 12:00:44 +05:30
Zi Xuan Wu 582836faaf [CSKY] Enhance asm parser and relocation fixup for some special symbol address instruction
Add processing of parsing and emiting lrw/jsri/jmpi instruction, including related fixup and relocation.
Add relax support about pseudo instructions such as jbr/jbsr.
Add objdump format support like arm in llvm-objdump.
2022-03-24 14:14:04 +08:00
Kai Luo b8388fa319 [clang][NFC] Fix warning of integer comparison
```
warning: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Wsign-compare]
```

Fix https://lab.llvm.org/buildbot/#/builders/57/builds/16220.
2022-03-24 14:06:45 +08:00
Shraiysh Vaishay 86f156a49b [mlir][OpenMP][NFC] Remove unnecessary attributes
These attributes were added because of oilist required them earlier. It
no longer requires them and so these attributes can be safely removed
from the operations.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D122289
2022-03-24 10:13:06 +05:30
Shraiysh Vaishay 3c0d470865 [mlir][OpenMP] omp.single translation to LLVM IR
This patch adds translation from omp.single to LLVM IR.

Depends on D122288

Reviewed By: ftynse, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D122297
2022-03-24 10:07:30 +05:30
Kai Luo 77cc68b049 [X86][NFC] Fix missing `override` in `isMemUseUpRegs`
Fix warning
```
warning: 'isMemUseUpRegs' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
```
2022-03-24 12:35:15 +08:00
Siva Chandra Reddy 441606f5ff [libc] Add implementations of fopen, flose, fread, fwrite and fseek.
A follow up patch will add feof and ferror.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D122327
2022-03-24 04:20:12 +00:00
Jonas Devlieghere 4ad19b80ea
[lldb] Test parsing the symtab with indirect symbols from the shared cache
This patch adds a test for b0dc2fae60. That commit fixed a bug where
we could increment the indirect symbol offset every time we parsed the
symbol table.
2022-03-23 21:13:55 -07:00
Ben Shi 86c1d075bb [clang][AVR] Implement standard calling convention for AVR and AVRTiny
This patch implements avr-gcc's calling convention:
https://gcc.gnu.org/wiki/avr-gcc#Calling_Convention

Reviewed By: aykevl

Differential Revision: https://reviews.llvm.org/D120720
2022-03-24 03:41:01 +00:00
Joseph Huber d912232741 [CUDA][FIX] Fix name conflict in getNVPTXTargetFeatures
Summary:
There was a naming conflict in the getNVPTXTargetFeatures function that
prevented some compilers from correctly disambiguating between the
enumeration and variable of the same name. Rename the variable to avoid
this.
2022-03-23 23:07:51 -04:00
owenca f74413d163 [clang-format] Fix invalid code generation with comments in lambda
Fixes #51234 and #54496

Differential Revision: https://reviews.llvm.org/D122301
2022-03-23 19:40:24 -07:00
Ben Shi f319c24570 [AVR] Reject/Reserve R0~R15 on AVRTiny.
Reviewed By: aykevl, dylanmckay

Differential Revision: https://reviews.llvm.org/D121672
2022-03-24 02:33:51 +00:00
Chuanqi Xu 8474668608 [C++20] [Modules] Make the linkage consistent for template and its
specialization

Before the patch, the compiler would crash for the test due to
inconsistent linkage.

This patch tries to avoid it by make the linkage consistent for template
and its specialization. After the patch, the behavior of compiler would
be partially correct for the case.
The correct one is:

```
export template<class T>
void f() {}

template<>
void f<int>() {}
```

In this case, the linkage for both declaration should be external (the
wording I get by consulting in WG21 is "the linkage for name f should be
external").

And for the case:
```
template<class T>
void f() {}

export template<>
void f<int>() {}
```

Compiler should reject it. This isn't done now. After all, this patch would
stop a crash.

Reviewed By: iains, aaron.ballman, dblaikie

Differential Revision: https://reviews.llvm.org/D120397
2022-03-24 10:24:14 +08:00
Ben Shi d7afea9eb8 [AVR][MC] Emit some aliases for GPRs and IO registers
Emit the following aliases (if available):

.set __tmp_reg__, [0|16]
.set __zero_reg__, [1|17]
.set __SREG__, 63
.set __SP_H__, 62
.set __SP_L__, 61
.set __EIND__, 60
.set __RAMPZ__, 59

Reviewed By: aykevl

Differential Revision: https://reviews.llvm.org/D119807
2022-03-24 02:08:22 +00:00
Ben Shi 51585aa240 [clang][AVR] Implement standard calling convention for AVR and AVRTiny
This patch implements avr-gcc's calling convention:
https://gcc.gnu.org/wiki/avr-gcc#Calling_Convention

Reviewed By: aykevl

Differential Revision: https://reviews.llvm.org/D120720
2022-03-24 02:08:22 +00:00
Kiran Chandramohan cf198e927d [Flang][NFC] Rearrange intrinsic generator functions
This patch rearranges the generator functions for various intrinsics.
The rearrangement will help to identify any missing functionality.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D122334
2022-03-24 02:03:12 +00:00
LLVM GN Syncbot bf6f5113bc [gn build] Port 64902d335c 2022-03-24 01:49:33 +00:00
Xiang1 Zhang 9566405020 [Inline asm] Fix mangle problem when variable used in inline asm.
(Correct 'Mem symbol + IntelExpr' output in PIC model)

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D121785
2022-03-24 09:41:23 +08:00
Xiang1 Zhang 287dad13ab [InlineAsm] Fix mangle problem when global variable used in inline asm
(Add modifier P for ARR[BaseReg+IndexReg+..])

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D120887
2022-03-24 09:41:23 +08:00