Commit Graph

331535 Commits

Author SHA1 Message Date
Sander de Smalen 84a0c8e3ae [AArch64][SVE] Spilling/filling of SVE callee-saves.
Implement the spills/fills of callee-saved SVE registers using STR and LDR
instructions.

Also adds the `aarch64_sve_vector_pcs` attribute to specify the
callee-saved registers to be used for functions that return SVE vectors or
take SVE vectors as arguments. The callee-saved registers are vector
registers z8-z23 and predicate registers p4-p15.

The overal frame-layout with SVE will be as follows:

   +-------------+
   | stack args  |
   +-------------+
   | Callee Saves|
   |   X29, X30  |
   |-------------| <- FP
   | SVE Callee  | < //////////////
   | saved regs  | < //////////////
   |    z23      | < //////////////
   |     :       | < // SCALABLE //
   |    z8       | < //////////////
   |    p15      | < /// STACK ////
   |     :       | < //////////////
   |    p4       | < //// AREA ////
   +-------------+ < //////////////
   |     :       | < //////////////
   |  SVE locals | < //////////////
   |     :       | < //////////////
   +-------------+
   |/////////////| alignment gap.
   |     :       |
   | Stack objs  |
   |     :       |
   +-------------+ <- SP after call and frame-setup

Reviewers: cameron.mcinally, efriedma, greened, thegameg, ostannard, rengolin

Reviewed By: ostannard

Differential Revision: https://reviews.llvm.org/D68996
2019-11-11 09:03:19 +00:00
Georgii Rymar 06456daa9e [yaml2obj] - Add a way to describe the custom data that is not part of an output section.
Currently there is no way to describe the data that is not a part of an output section.
It can be a data used to align sections or to fill the gaps with something,
or another kind of custom data. In this patch I suggest a way to describe it. It looks like that:

```
Sections:
  - Type:    CustomFiller
    Pattern: "CCDD"
    Size:    4
  - Name:    .bar
    Type:    SHT_PROGBITS
    Content: "FF"
```

I.e. I've added a kind of synthetic section with a synthetic type "CustomFiller".
In the code it is called a "SyntheticFiller", which is "a synthetic section which
might be used to write the custom data around regular output sections. It does
not present in the sections header table, but it might affect the output file size and
program headers produced. Think about it as about piece of data."

`SyntheticFiller` currently has a `Pattern` field and a `Size` field + an optional `Name`.
When written, `Size` of bytes in the output will be filled with a `Pattern`.
It is possible to reference a named filler it by name from the program headers description,
just like any other normal section.

Differential revision: https://reviews.llvm.org/D69709
2019-11-11 11:48:23 +03:00
Ilya Biryukov b4f46a9bb4 [clangd] Fixes colon escaping on Windows
vscode always escapes the colon on the file uri, which causes the semantic highlighting fails on windows.

fixes: https://github.com/clangd/clangd/issues/176
2019-11-11 09:21:25 +01:00
marshall 2f4fb200b6 libc++ status page: New papers and issues adopted in Belfast 2019-11-11 08:13:05 +00:00
QingShan Zhang af5df83671 [NFC] Add one test to verify the dependency brings by Macro-Fusion. 2019-11-11 06:54:26 +00:00
Tsang Whitney W.H 6ef63638cb [DirectedGraph]: Add setTargetNode member function
Summary:Add the setTargetNode member function to class DGEdge.
Authored By:etiotto
Reviewer:bmahjour, Whitney, jdoerfert, Meinersbur, fhahn, kbarton,
dmgreen
Reviewed By:Meinersbur
Subscribers:dexonsmith, kristina, llvm-commits
Tag:LLVM
Differential Revision:https://reviews.llvm.org/D68474
2019-11-11 03:36:23 +00:00
Vladimir Vereschaka 3d3445e3e6 Revert "Fixed a profdata file size detection on Windows system."
This reverts commit bcbb121ff6.

Using 'ls -o' is not compatible way to fix the problem. FreeBSD and OSX
version of 'ls' do not support -o flag and test gets failed on these
platforms.

Differential Revision: https://reviews.llvm.org/D69317
2019-11-10 18:05:24 -08:00
Craig Topper aafde063aa [InstCombine] Turn (extractelement <1 x i64/double> (bitcast (x86_mmx))) into a single bitcast from x86_mmx to i64/double.
The _m64 type is represented in IR as <1 x i64>. The x86-64 ABI
on Linux passes <1 x i64> as a double. MMX intrinsics use x86_mmx
type in IR.These things result in a lot of bitcasts in mmx code.
There's another instcombine that tries to turn bitcast <1 x i64>
to double into extractelement and a bitcast.

The combine here tries to reverse this extractelement conversion
if we see an mmx type.
2019-11-10 16:25:25 -08:00
Craig Topper d37db750c2 [InstCombine] Add a test case for suboptimal handling of (double (bitcast (<1 x i64> (bitcast (x86_mmx)))))
The outer bitcast gets turned into an extractelement and another
bitcast rather than combining away to a single bitcast from mmx
to double.
2019-11-10 16:25:25 -08:00
Sanjay Patel d115b9fd4a Revert "[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723) (2nd try)"
This reverts commit 56b2aee187.
Still causes a use-after-free on sanitizer bots.
2019-11-10 18:47:49 -05:00
Sanjay Patel 56b2aee187 [InstCombine] avoid crash from deleting an instruction that still has uses (PR43723) (2nd try)
Re-try rGef02831f0a4e (reverted due to use-after-free), but bail out completely
if we encounter an unexpected llvm.invariant.start.

We gather a set of white-listed instructions in isAllocSiteRemovable() and then
replace/erase them. But we don't know in general if the instructions in the set
have uses amongst themselves, so order of deletion makes a difference.

There's already a special-case for the llvm.objectsize intrinsic, so add another
for llvm.invariant.end.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=43723

Differential Revision: https://reviews.llvm.org/D69977
2019-11-10 17:26:36 -05:00
Stefan Stipanovic c250ebf7bc getArgOperandNo helper function.
Summary: A helper function to get argument number of a arg operand Use.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66844
2019-11-10 21:45:11 +01:00
Duncan P. N. Exon Smith 8e9e433a2a clang/Modules: Remove unused parameter from ModuleManager::removeModules
The other paremeters appear to be sufficient to determine which modules
have just been loaded and need to be removed, so stop collecting and
sending in that set explicitly.
2019-11-10 11:18:33 -08:00
Roman Lebedev 7874db75ef
[NFC][Codegen] Add `x u% C1 == C2` with C1 u> C2 non-tautological tests 2019-11-10 19:44:46 +03:00
drichards-87 bcca123bd0 Docs: Updates Sphinx Quickstart template for new contributors 2019-11-10 09:27:32 -07:00
Sanjay Patel b0ac26a632 Revert "[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723)"
This reverts commit ef02831f0a.
Sanitizer bots fail with this change.
2019-11-10 11:18:05 -05:00
Luís Marques 1c737f54be [RISCV] Fix CFA when doing split sp adjustment with fp
Summary: When using the split sp adjustment and using the frame-pointer
we were still emitting CFI CFA directives based on the sp value. The
final sp-based offset also didn't reflect the two-stage sp adjust. There
remain CFI issues that aren't related to the split sp adjustment, and
thus will be addressed in a separate patch.

Reviewers: asb, lenary, shiva0217
Reviewed By: lenary, shiva0217
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69385
2019-11-10 16:09:14 +00:00
Luís Marques be0fead7bf [RISCV][NFC] Add CFI-related tests
Summary: Adds tests necessary to properly show the impact of other
patches that affect the emission of CFI directives.

Reviewers: asb, lenary
Reviewed By: lenary
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69721
2019-11-10 16:00:07 +00:00
Sanjay Patel ef02831f0a [InstCombine] avoid crash from deleting an instruction that still has uses (PR43723)
We gather a set of white-listed instructions in isAllocSiteRemovable() and then
replace/erase them. But we don't know in general if the instructions in the set
have uses amongst themselves, so order of deletion makes a difference.

There's already a special-case for the llvm.objectsize intrinsic, so add another
for llvm.invariant.end.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=43723

Differential Revision: https://reviews.llvm.org/D69977
2019-11-10 09:18:11 -05:00
Simon Pilgrim 4ff246fef2 Remove unused variable (which allows us to remove vector include). NFC. 2019-11-10 12:16:23 +00:00
Benjamin Kramer 6c94068da9 [Driver] Remove unused variable. NFC. 2019-11-10 12:53:19 +01:00
Roman Lebedev 446581a300
[NFC][Codegen] Add `x u% C1 == C2` with C1 u<= C2 tautological tests 2019-11-10 14:22:57 +03:00
Simon Pilgrim a3c715e978 Twine - fix uninitialized variable warnings. NFCI. 2019-11-10 11:21:43 +00:00
Simon Pilgrim 616a7f6ca0 TableGen - fix uninitialized variable warnings. NFCI. 2019-11-10 11:19:50 +00:00
Simon Pilgrim b96ebc0a42 PODSmallVector - fix MSVC uninitialized variable warnings. NFCI. 2019-11-10 11:18:15 +00:00
Simon Pilgrim eb79d2da8a Path - fix uninitialized variable warnings. NFCI. 2019-11-10 11:15:39 +00:00
Simon Pilgrim 811a031c36 CodeGenRegBank - make functions const to fix cppcheck warnings. 2019-11-10 11:14:58 +00:00
Fangrui Song d890620fb2 [MC] Clean up MacroInstantiation. NFC 2019-11-09 23:27:15 -08:00
Tsang Whitney W.H 89453d186d [NFC]: Fix PVS Studio warning in LoopNestAnalysis
Summary:This patch fixes the following warnings uncovered by PVS
Studio:

/home/xbolva00/LLVM/llvm-project/llvm/lib/Analysis/LoopCacheAnalysis.cpp
353 warn V612 An unconditional 'return' within a loop.
/home/xbolva00/LLVM/llvm-project/llvm/lib/Analysis/LoopCacheAnalysis.cpp
456 err V502 Perhaps the '?:' operator works in a different way than it
was expected. The '?:' operator has a lower priority than the '=='
operator.
Authored By:etiotto
Reviewer:Meinersbur, kbarton, bmahjour, Whitney, xbolva00
Reviewed By:xbolva00
Subscribers:hiraditya, llvm-commits
Tag:LLVM
Differential Revision:https://reviews.llvm.org/D69821
2019-11-10 05:39:40 +00:00
Craig Topper c2751737e5 [X86] Handle MO_ConstantPoolIndex in X86AsmPrinter::PrintOperand
Fixes PR43952
2019-11-09 18:01:26 -08:00
Simon Pilgrim 1dbcf8ba8a Try to fix sphinx "Could not lex literal_block as "llvm"" warning.
Code block isn't IR - so treat it as "none" instead.
2019-11-09 22:15:26 +00:00
Simon Pilgrim b0d0928241 YAMLParser - fix SimpleKey uninitialized variable warnings. NFCI. 2019-11-09 22:11:50 +00:00
Simon Pilgrim 58236e6fa6 Reduce scope of variable to silence cppcheck warning. NFC 2019-11-09 22:10:09 +00:00
Simon Pilgrim 6976a0e826 RegisterCoalescer - remove duplicate variable to fix Wshadow warning. NFCI. 2019-11-09 20:10:12 +00:00
Simon Pilgrim f092e80939 RegisterCoalescer - fix uninitialized variables. NFCI. 2019-11-09 20:10:11 +00:00
Gil Rapaport 7f152543e4 [LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)
This recommits 11ed1c0239 (reverted in
9f08ce0d21 for failing an assert) with a fix:
tryToWidenMemory() now first checks if the widening decision is to interleave,
thus maintaining previous behavior where tryToInterleaveMemory() was called
first, giving priority to interleave decisions over widening/scalarization. This
commit adds the test case that exposed this bug as a LIT.
2019-11-09 20:52:25 +02:00
Michał Górny 0ac296322f [lldb] [test] Un-XFAIL tests that work on NetBSD 9 2019-11-09 19:40:31 +01:00
Simon Pilgrim c2fca2d9af Fix variable ‘LookedUpGetterSetter’ set but not used warning. NFCI. 2019-11-09 17:40:49 +00:00
Dávid Bolvanský e24e6ae7a0 Fixed dia file 2019-11-09 18:31:17 +01:00
Dávid Bolvanský 5deb289f49 Fixed c-index test 2019-11-09 18:26:21 +01:00
Dávid Bolvanský 5c50109bb5 Fixed more -Wreturn-type tests 2019-11-09 18:13:51 +01:00
Simon Pilgrim 612810e333 Fix uninitialized variable warnings. NFCI. 2019-11-09 17:03:21 +00:00
Simon Pilgrim 3c37981bb3 Fix shadow variable warning with llvm::SrcMgr. NFCI. 2019-11-09 17:03:21 +00:00
Simon Pilgrim 7f8488eeb4 Fix operator precedence warning. NFC. 2019-11-09 17:03:21 +00:00
Dávid Bolvanský 1da13237a4 [Diagnostics] Try to improve warning message for -Wreturn-type
Summary: I agree with https://easyaspi314.github.io/gcc-vs-clang.html?fbclid=IwAR1VA0qxiWVUusOQUv5z7JESS7ZpeJy-UqAI5mnJscofGLqXcqeErIUB2gU, current warning message is not very good. We should try to improve it..

Reviewers: rsmith, aaron.ballman, easyaspi314

Reviewed By: aaron.ballman

Subscribers: arphaman, Quuxplusone, mehdi_amini, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D69762
2019-11-09 17:54:58 +01:00
Yonghong Song 9434360401 Revert "[BPF] Add preserve_access_index attribute for record definition"
This reverts commit 4a5aa1a7bf.

There are some other test failures. Investigate them first.
2019-11-09 08:32:44 -08:00
Yonghong Song 4a5aa1a7bf [BPF] Add preserve_access_index attribute for record definition
This patch introduced a new bpf specific attribute which can
be added to struct or union definition. For example,
  struct s { ... } __attribute__((preserve_access_index));
  union u { ... } __attribute__((preserve_access_index));
The goal is to simplify user codes for cases
where preserve access index happens for certain struct/union,
so user does not need to use clang __builtin_preserve_access_index
for every members.

The attribute has no effect if -g is not specified.

When the attribute is specified and -g is specified, any member
access defined by that structure or union, including array subscript
access and inner records, will be preserved through
  __builtin_preserve_{array,struct,union}_access_index()
IR intrinsics, which will enable relocation generation
in bpf backend.

The following is an example to illustrate the usage:
  -bash-4.4$ cat t.c
  #define __reloc__ __attribute__((preserve_access_index))
  struct s1 {
    int c;
  } __reloc__;

  struct s2 {
    union {
      struct s1 b[3];
    };
  } __reloc__;

  struct s3 {
    struct s2 a;
  } __reloc__;

  int test(struct s3 *arg) {
    return arg->a.b[2].c;
  }
  -bash-4.4$ clang -target bpf -g -S -O2 t.c

A relocation with access string "0:0:0:0:2:0" will be generated
representing access offset of arg->a.b[2].c.

forward declaration with attribute is also handled properly such
that the attribute is copied and populated in real record definition.

Differential Revision: https://reviews.llvm.org/D69759
2019-11-09 08:17:12 -08:00
Mark de Wever 27c4eaac8c [libc++] Validate the entire regex is consumed
This change would have warned about the bug found in D62451.
No unit tests since the exception should never throw.

Differential Revision: https://reviews.llvm.org/D62452
2019-11-09 17:01:37 +01:00
Mark de Wever b9be5ce8f3 [Parser] Warn when ScopeDepthOrObjCQuals overflows
Before when the overflow occured an assertion was triggered. Now check
whether the maximum has been reached and warn properly.

This patch fixes the original submission of PR19607.

Differential Revision: https://reviews.llvm.org/D63975
2019-11-09 15:33:01 +01:00
Richard Smith 56b5eab129 [NFC] Supress GCC "Bitfield too small to hold all values of enum" warning.
Patch by Wang Tianqing!

Differential Revision: https://reviews.llvm.org/D69792
2019-11-09 05:56:51 -08:00