1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

7989 Commits

Author SHA1 Message Date
Djordje Todorovic
daa23ce8ba Revert "Reland "[utils] Implement the llvm-locstats tool""
This reverts commit rL373183.

llvm-svn: 373200
2019-09-30 11:19:11 +00:00
Djordje Todorovic
faafb41cf2 Reland "[utils] Implement the llvm-locstats tool"
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

llvm-svn: 373183
2019-09-30 07:35:17 +00:00
Nico Weber
953858a81d gn build: (manually) merge r373082
llvm-svn: 373086
2019-09-27 13:14:34 +00:00
GN Sync Bot
7ca190b53d gn build: Merge r373083
llvm-svn: 373085
2019-09-27 13:04:46 +00:00
Nico Weber
6a8ef0b7b3 Reland "gn build: (manually) merge r373028"
This relands r373029, reverted in 373033, because r373028 relanded in r373066.

llvm-svn: 373070
2019-09-27 11:37:59 +00:00
Simon Pilgrim
9314ff93e0 [UpdateTestChecks] Fix wildcard support on DOS prompts
D64572 / rL365818 changed the way that the file paths were collected, which meant we lost the file pattern expansion necessary when working with DOS command prompt

llvm-svn: 373062
2019-09-27 10:04:16 +00:00
Dmitri Gribenko
31df45cd54 Revert "gn build: (manually) merge r373028"
This reverts commit r373029, which depends on r373028, which I reverted.

llvm-svn: 373033
2019-09-26 23:30:47 +00:00
Nico Weber
46ae7724f1 gn build: (manually) merge r373028
llvm-svn: 373029
2019-09-26 23:17:25 +00:00
Bob Haarman
1e425c53e9 [NFC][emacs] remove out-of-date comment from tablegen-mode.el
Summary:
The syntax table was originally based on and attributed to
jasmin.el, but was rewritten in r45192, so the comment that
says the code comes from jasmin.el is no longer accurate. This
change removes the comment, shortening the code a bit.

Reviewers: MaskRay, lattner

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373008
2019-09-26 19:36:01 +00:00
Simon Pilgrim
2dfd238c4b DAGISelMatcherOpt - TGParser::ParseOperation - silence static analyzer cast_or_null<CheckTypeMatcher> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, replace with an null/isa assertion and cast<CheckTypeMatcher>.

llvm-svn: 373001
2019-09-26 17:38:47 +00:00
Hans Wennborg
c125ef45d6 build_llvm_package.bat: Bootstrap with VS 2019
llvm-svn: 372984
2019-09-26 14:57:55 +00:00
Bob Haarman
31aa3879e3 [emacs] simplify and improve keyword highlighting in tablegen-mode.el
Summary:
The keyword and type keyword matchers in tablegen-mode.el checked
for space, newline, tab, or open paren after the regular expression
that matches keywords (or type keywords, respectively). This is
unnecessary, because those regular expressions already include word
boundaries. This change removes the extra check. This also causes
"def" in "def:" to be highlighted as a keyword, which was missed
before.

Reviewers: lattner, MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 372904
2019-09-25 18:16:02 +00:00
Marco Antognini
0945fbe7ba [gn build] Fix Python DeprecationWarning
Summary:
This fixes two issues:
 - DeprecationWarning: invalid escape sequence \`
 - ResourceWarning: unclosed file

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 372876
2019-09-25 14:15:34 +00:00
Nico Weber
6d7b00e04c gn build: (manually) merge r372843
llvm-svn: 372850
2019-09-25 12:02:00 +00:00
GN Sync Bot
5ffc6aad2a gn build: Merge r372841
llvm-svn: 372842
2019-09-25 10:35:03 +00:00
Kamil Rytarowski
26b5adf664 [tblgen] Disable Leak detection for ASan/GCC and LSan/LLVM
Summary: Add support for sanitizing TableGen.cpp with ASan/GCC and LSan/LLVM.

Reviewers: fjricci, kcc, aaron.ballman, mgorny

Reviewed By: fjricci

Subscribers: jakubjelinek, llvm-commits, #llvm

Tags: #llvm

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

llvm-svn: 372731
2019-09-24 11:22:34 +00:00
GN Sync Bot
3c12c27b87 gn build: Merge r372712
llvm-svn: 372713
2019-09-24 09:43:29 +00:00
GN Sync Bot
22c609ddfb gn build: Merge r372706
llvm-svn: 372707
2019-09-24 09:11:31 +00:00
Jan Korous
48308d5c8b Revert "[lit] Add -D__clang_analyzer__ to clang_analyze_cc1"
This reverts commit 4185460f758b98ea5b898c04c179704756ca8f53.

llvm-svn: 372686
2019-09-24 03:20:59 +00:00
Jan Korous
7c127f4e9b [lit] Add -D__clang_analyzer__ to clang_analyze_cc1
Fixup after fbd13570b0d

llvm-svn: 372682
2019-09-24 01:59:20 +00:00
Aditya Nandakumar
41a90454e6 [TableGen] Emit OperandType enums for RegisterOperands/RegisterClasses
https://reviews.llvm.org/D66773

The OpTypes::OperandType was creating an enum for all records that
inherit from Operand, but in reality there are operands for instructions
that inherit from other types too. In particular, RegisterOperand and
RegisterClass. This commit adds those types to the list of operand types
that are tracked by the OperandType enum.

Patch by: nlguillemot

llvm-svn: 372641
2019-09-23 18:51:00 +00:00
Mark Murray
5ef3341e20 Cosmetic; don't use the magic constant 35 when HASH is more readable. This matches other MCK__<THING>_* usage better.
Summary: No functional change. This fixes a magic constant in MCK__*_... macros only.

Reviewers: ostannard

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 372599
2019-09-23 12:52:42 +00:00
GN Sync Bot
8fb0d2d34f gn build: Merge r372595
llvm-svn: 372597
2019-09-23 12:44:45 +00:00
GN Sync Bot
146a81711a gn build: Merge r372564
llvm-svn: 372581
2019-09-23 11:08:25 +00:00
Djordje Todorovic
c4d5e78650 Revert "Reland "[utils] Implement the llvm-locstats tool""
This reverts commit rL372554.

llvm-svn: 372580
2019-09-23 11:04:11 +00:00
Djordje Todorovic
1249d7b040 Reland "[utils] Implement the llvm-locstats tool"
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

llvm-svn: 372554
2019-09-23 07:57:53 +00:00
Craig Topper
e9c90270ed [X86][TableGen] Allow timm to appear in output patterns. Use it to remove ConvertToTarget opcodes from the X86 isel table.
We're now using a lot more TargetConstant nodes in SelectionDAG.
But we were still telling isel to convert some of them
to TargetConstants even though they already are. This is because
isel emits a conversion anytime the output pattern has a an 'imm'.
I guess for patterns in instructions we take the 'timm' from the
'set' pattern, but for Pat patterns with explcicit output we
previously had to say 'imm' since 'timm' wasn't allowed in outputs.

llvm-svn: 372525
2019-09-22 19:49:39 +00:00
Nico Weber
9df9caa257 gn build: Friendlier error on invalid entries in llvm_targets_to_build
llvm-svn: 372515
2019-09-22 16:48:20 +00:00
Nico Weber
59bad4765c gn build: consolidate "Nothing to do" branches in targets.gni
No behavior change.

llvm-svn: 372512
2019-09-22 15:42:40 +00:00
Nico Weber
20005fe441 gn build: Add missing RISCV to llvm_targets_to_build="all"
llvm-svn: 372506
2019-09-22 13:41:38 +00:00
Nico Weber
23f929a310 gn build: Add build files for llvm/lib/Target/AVR
Differential Revision: https://reviews.llvm.org/D67872

llvm-svn: 372505
2019-09-22 13:17:38 +00:00
GN Sync Bot
40ff3514b8 gn build: Merge r372445
llvm-svn: 372446
2019-09-21 01:27:09 +00:00
GN Sync Bot
a174c99253 gn build: Merge r372396
llvm-svn: 372397
2019-09-20 14:39:52 +00:00
Kerry McLaughlin
7b577a403e [IntrinsicEmitter] Add overloaded types for SVE intrinsics (Subdivide2 & Subdivide4)
Summary:
Both match the type of another intrinsic parameter of a vector type, but where each element is subdivided to form a vector with more elements of a smaller type.

Subdivide2Argument allows intrinsics such as the following to be defined:
 - declare <vscale x 4 x i32> @llvm.something.nxv4i32(<vscale x 8 x i16>)

Subdivide4Argument allows intrinsics such as:
 - declare <vscale x 4 x i32> @llvm.something.nxv4i32(<vscale x 16 x i8>)

Tests are included in follow up patches which add intrinsics using these types.

Reviewers: sdesmalen, SjoerdMeijer, greened, rovka

Reviewed By: sdesmalen

Subscribers: rovka, tschuett, jdoerfert, cfe-commits, llvm-commits

Tags: #llvm

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

llvm-svn: 372380
2019-09-20 09:48:21 +00:00
GN Sync Bot
0d2758f267 gn build: Merge r372343
llvm-svn: 372344
2019-09-19 17:53:03 +00:00
Matt Arsenault
c204981f6f Reapply r372285 "GlobalISel: Don't materialize immarg arguments to intrinsics"
This reverts r372314, reapplying r372285 and the commits which depend
on it (r372286-r372293, and r372296-r372297)

This was missing one switch to getTargetConstant in an untested case.

llvm-svn: 372338
2019-09-19 16:26:14 +00:00
James Molloy
7fff32705f [TableGen] Support encoding per-HwMode
Much like ValueTypeByHwMode/RegInfoByHwMode, this patch allows targets
to modify an instruction's encoding based on HwMode. When the
EncodingInfos field is non-empty the Inst and Size fields of the Instruction
are ignored and taken from EncodingInfos instead.

As part of this promote getHwMode() from TargetSubtargetInfo to MCSubtargetInfo.

This is NFC for all existing targets - new code is generated only if targets
use EncodingByHwMode.

llvm-svn: 372320
2019-09-19 13:39:54 +00:00
Hans Wennborg
230a0cd001 Revert r372285 "GlobalISel: Don't materialize immarg arguments to intrinsics"
This broke the Chromium build, causing it to fail with e.g.

  fatal error: error in backend: Cannot select: t362: v4i32 = X86ISD::VSHLI t392, Constant:i8<15>

See llvm-commits thread of r372285 for details.

This also reverts r372286, r372287, r372288, r372289, r372290, r372291,
r372292, r372293, r372296, and r372297, which seemed to depend on the
main commit.

> Encode them directly as an imm argument to G_INTRINSIC*.
>
> Since now intrinsics can now define what parameters are required to be
> immediates, avoid using registers for them. Intrinsics could
> potentially want a constant that isn't a legal register type. Also,
> since G_CONSTANT is subject to CSE and legalization, transforms could
> potentially obscure the value (and create extra work for the
> selector). The register bank of a G_CONSTANT is also meaningful, so
> this could throw off future folding and legalization logic for AMDGPU.
>
> This will be much more convenient to work with than needing to call
> getConstantVRegVal and checking if it may have failed for every
> constant intrinsic parameter. AMDGPU has quite a lot of intrinsics wth
> immarg operands, many of which need inspection during lowering. Having
> to find the value in a register is going to add a lot of boilerplate
> and waste compile time.
>
> SelectionDAG has always provided TargetConstant for constants which
> should not be legalized or materialized in a register. The distinction
> between Constant and TargetConstant was somewhat fuzzy, and there was
> no automatic way to force usage of TargetConstant for certain
> intrinsic parameters. They were both ultimately ConstantSDNode, and it
> was inconsistently used. It was quite easy to mis-select an
> instruction requiring an immediate. For SelectionDAG, start emitting
> TargetConstant for these arguments, and using timm to match them.
>
> Most of the work here is to cleanup target handling of constants. Some
> targets process intrinsics through intermediate custom nodes, which
> need to preserve TargetConstant usage to match the intrinsic
> expectation. Pattern inputs now need to distinguish whether a constant
> is merely compatible with an operand or whether it is mandatory.
>
> The GlobalISelEmitter needs to treat timm as a special case of a leaf
> node, simlar to MachineBasicBlock operands. This should also enable
> handling of patterns for some G_* instructions with immediates, like
> G_FENCE or G_EXTRACT.
>
> This does include a workaround for a crash in GlobalISelEmitter when
> ARM tries to uses "imm" in an output with a "timm" pattern source.

llvm-svn: 372314
2019-09-19 12:33:07 +00:00
Matt Arsenault
6df65c514b GlobalISel: Don't materialize immarg arguments to intrinsics
Encode them directly as an imm argument to G_INTRINSIC*.

Since now intrinsics can now define what parameters are required to be
immediates, avoid using registers for them. Intrinsics could
potentially want a constant that isn't a legal register type. Also,
since G_CONSTANT is subject to CSE and legalization, transforms could
potentially obscure the value (and create extra work for the
selector). The register bank of a G_CONSTANT is also meaningful, so
this could throw off future folding and legalization logic for AMDGPU.

This will be much more convenient to work with than needing to call
getConstantVRegVal and checking if it may have failed for every
constant intrinsic parameter. AMDGPU has quite a lot of intrinsics wth
immarg operands, many of which need inspection during lowering. Having
to find the value in a register is going to add a lot of boilerplate
and waste compile time.

SelectionDAG has always provided TargetConstant for constants which
should not be legalized or materialized in a register. The distinction
between Constant and TargetConstant was somewhat fuzzy, and there was
no automatic way to force usage of TargetConstant for certain
intrinsic parameters. They were both ultimately ConstantSDNode, and it
was inconsistently used. It was quite easy to mis-select an
instruction requiring an immediate. For SelectionDAG, start emitting
TargetConstant for these arguments, and using timm to match them.

Most of the work here is to cleanup target handling of constants. Some
targets process intrinsics through intermediate custom nodes, which
need to preserve TargetConstant usage to match the intrinsic
expectation. Pattern inputs now need to distinguish whether a constant
is merely compatible with an operand or whether it is mandatory.

The GlobalISelEmitter needs to treat timm as a special case of a leaf
node, simlar to MachineBasicBlock operands. This should also enable
handling of patterns for some G_* instructions with immediates, like
G_FENCE or G_EXTRACT.

This does include a workaround for a crash in GlobalISelEmitter when
ARM tries to uses "imm" in an output with a "timm" pattern source.

llvm-svn: 372285
2019-09-19 01:33:14 +00:00
GN Sync Bot
4007f026b5 gn build: Merge r372282
llvm-svn: 372283
2019-09-19 01:03:39 +00:00
Roman Tereshin
af808a61d7 [utils] Add minimal support for MIR inputs to update_llc_test_checks.py
update_{llc,mir}_test_checks.py applicability is determined by the
output (assembly or MIR), not the input, which makes
update_llc_test_checks.py the right tool to generate tests that start at
MIR and stop at the final assembly.

This commit adds the minimal support for this path. Main limitation that
remains:

- MIR has to have LLVM IR section, and the CHECK lines will be inserted
  into the LLVM IR functions that correspond to the MIR functions.

Running
  ../utils/update_llc_test_checks.py --llc-binary ./bin/llc
on a slightly modified  ../test/CodeGen/X86/bad-tls-fold.mir

produces the following diff:

+# NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+# RUN: llc %s -o - | FileCheck %s
 --- |
   target triple = "x86_64-unknown-linux-gnu"

@@ -6,17 +7,31 @@
   @i = external thread_local global i32

   define i32 @or() {
+  ; CHECK-LABEL: or:
+  ; CHECK:       # %bb.0: # %entry
+  ; CHECK-NEXT:    movq {{.*}}(%rip), %rax
+  ; CHECK-NEXT:    orq $7, %rax
+  ; CHECK-NEXT:    movq i@{{.*}}(%rip), %rcx
+  ; CHECK-NEXT:    orq %rax, %rcx
+  ; CHECK-NEXT:    movl %fs:(%rcx), %eax
+  ; CHECK-NEXT:    retq
   entry:
     ret i32 undef
   }
-
   define i32 @and() {
+  ; CHECK-LABEL: and:
+  ; CHECK:       # %bb.0: # %entry
+  ; CHECK-NEXT:    movq {{.*}}(%rip), %rax
+  ; CHECK-NEXT:    orq $7, %rax
+  ; CHECK-NEXT:    movq i@{{.*}}(%rip), %rcx
+  ; CHECK-NEXT:    andq %rax, %rcx
+  ; CHECK-NEXT:    movl %fs:(%rcx), %eax
+  ; CHECK-NEXT:    retq
   entry:
     ret i32 undef
   }
 ...

(not applied)

llvm-svn: 372277
2019-09-18 23:44:17 +00:00
Roman Tereshin
143b0add01 [utils] Amend update_llc_test_checks.py to non-llc tooling, NFC
Very minor change aiming to make it easier to extend the script
downstream to support non-llc, but llc-like tools. The main objective is
to decrease the probability of merge conflicts.

llvm-svn: 372276
2019-09-18 23:44:16 +00:00
GN Sync Bot
424d18eccd gn build: Merge r372267
llvm-svn: 372268
2019-09-18 22:21:52 +00:00
GN Sync Bot
f6173ffe7d gn build: Merge r372264
llvm-svn: 372265
2019-09-18 21:49:36 +00:00
Daniel Sanders
1c646a78c0 Fix compile-time regression caused by rL371928
Summary:
Also fixup rL371928 for cases that occur on our out-of-tree backend

There were still quite a few intermediate APInts and this caused the
compile time of MCCodeEmitter for our target to jump from 16s up to
~5m40s. This patch, brings it back down to ~17s by eliminating pretty
much all of them using two new APInt functions (extractBitsAsZExtValue(),
insertBits() but with a uint64_t). The exact conditions for eliminating
them is that the field extracted/inserted must be <=64-bit which is
almost always true.

Note: The two new APInt API's assume that APInt::WordSize is at least
64-bit because that means they touch at most 2 APInt words. They
statically assert that's true. It seems very unlikely that someone
is patching it to be smaller so this should be fine.

Reviewers: jmolloy

Reviewed By: jmolloy

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 372243
2019-09-18 18:14:42 +00:00
GN Sync Bot
e732605b38 gn build: Merge r372238
llvm-svn: 372239
2019-09-18 17:48:49 +00:00
GN Sync Bot
02bf2ff5f8 gn build: Merge r372168
llvm-svn: 372173
2019-09-17 19:41:36 +00:00
GN Sync Bot
88acb8cbf4 gn build: Merge r372162
llvm-svn: 372163
2019-09-17 19:00:41 +00:00
GN Sync Bot
194feb7c63 gn build: Merge r372149
llvm-svn: 372150
2019-09-17 17:51:27 +00:00
Simon Pilgrim
0ca68847de [TableGen] CodeGenMapTable - Don't dereference a dyn_cast result. NFCI.
The static analyzer is warning about potential null dereferences of dyn_cast<> results - in these cases we can safely use cast<> directly as we know that these cases should all be the correct type, which is why its working atm and anyway cast<> will assert if they aren't.

llvm-svn: 372146
2019-09-17 17:32:15 +00:00
Nico Weber
d4a4e641eb gn build: (manually) merge r372076
llvm-svn: 372123
2019-09-17 14:06:05 +00:00
Graham Hunter
15543f7650 [SVE][MVT] Fixed-length vector MVT ranges
* Reordered MVT simple types to group scalable vector types
    together.
  * New range functions in MachineValueType.h to only iterate over
    the fixed-length int/fp vector types.
  * Stopped backends which don't support scalable vector types from
    iterating over scalable types.

Reviewers: sdesmalen, greened

Reviewed By: greened

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

llvm-svn: 372099
2019-09-17 10:19:23 +00:00
David Zarzycki
a2114177f9 [git-llvm] Do not reinvent @{upstream} (take 2)
This makes git-llvm more of a thin wrapper around git while temporarily
maintaining backwards compatibility with past git-llvm behavior.

Using @{upstream} makes git-llvm more robust when used with a nontrivial
local repository.

https://reviews.llvm.org/D67389

llvm-svn: 372070
2019-09-17 04:44:13 +00:00
Joel E. Denny
f04bbad688 Revert r372035: "[lit] Make internal diff work in pipelines"
This breaks a Windows bot.

llvm-svn: 372051
2019-09-16 23:47:46 +00:00
David L. Jones
51503f4f31 Add libc to path mappings in git-llvm.
llvm-svn: 372048
2019-09-16 23:36:35 +00:00
Joel E. Denny
4878f8e5d6 [lit] Make internal diff work in pipelines
When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
 # RUN: not diff file1 file2 | FileCheck %s
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.

To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation.  A
follow-up patch will implement `-` to mean stdin.

Reviewed By: probinson, stella.stamenova

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

llvm-svn: 372035
2019-09-16 21:22:29 +00:00
Nico Weber
e650a1bca0 gn build: Merge r371976
llvm-svn: 371977
2019-09-16 11:33:54 +00:00
Nico Weber
659c871c2e gn build: Merge r371965
llvm-svn: 371966
2019-09-16 09:43:26 +00:00
Nico Weber
1d97a74aa0 gn build: Merge r371959
llvm-svn: 371961
2019-09-16 07:34:23 +00:00
James Molloy
852739ecc8 [CodeEmitter] Support instruction widths > 64 bits
Some VLIW instruction sets are Very Long Indeed. Using uint64_t constricts the Inst encoding to 64 bits (naturally).

This change switches CodeEmitter to a mode that uses APInts when Inst's bitwidth is > 64 bits (NFC for existing targets).

When Inst.BitWidth > 64 the prototype changes to:

  void TargetMCCodeEmitter::getBinaryCodeForInstr(const MCInst &MI,
                                                  SmallVectorImpl<MCFixup> &Fixups,
                                                  APInt &Inst,
                                                  APInt &Scratch,
                                                  const MCSubtargetInfo &STI);

The Inst parameter returns the encoded instruction, the Scratch parameter is used internally for manipulating operands and is exposed so that the underlying storage can be reused between calls to getBinaryCodeForInstr. The goal is to elide any APInt constructions that we can.

Similarly the operand encoding prototype changes to:

  getMachineOpValue(const MCInst &MI, const MCOperand &MO, APInt &op, SmallVectorImpl<MCFixup> &Fixups, const MCSubtargetInfo &STI);

That is, the operand is passed by reference as APInt rather than returned as uint64_t.

To reiterate, this APInt mode is enabled only when Inst.BitWidth > 64, so this change is NFC for existing targets.

llvm-svn: 371928
2019-09-15 08:35:08 +00:00
Nico Weber
dd0d908417 gn build: pacify "gn format" after 371102
llvm-svn: 371858
2019-09-13 14:35:20 +00:00
Nico Weber
c19d943856 gn build: (manually) merge r371834, take 2
llvm-svn: 371851
2019-09-13 13:07:54 +00:00
Nico Weber
3457b3fd67 Revert "gn build: (manually) merge r371834"
This reverts commit abc7e2b6004cd693cf3b6dedbc7908e099c7ac6a.
The commit was incomplete. I'll revert and reland the full commit,
so that the correct change is a single commit.

llvm-svn: 371850
2019-09-13 13:04:59 +00:00
Nico Weber
0f67698ab7 gn build: (manually) merge r371834
llvm-svn: 371849
2019-09-13 12:59:06 +00:00
Nico Weber
edfaf8ee25 gn build: Merge r371822
llvm-svn: 371848
2019-09-13 12:58:58 +00:00
Nico Weber
df5359a92f gn build: (manually) merge r371787
llvm-svn: 371847
2019-09-13 12:58:52 +00:00
Nandor Licker
d08de3dbd0 [Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 371834
2019-09-13 09:46:16 +00:00
Rainer Orth
7d740f416b test-release.sh: Don't use chrpath on Solaris
When trying to run test-release.sh on Solaris 11.4 for 9.0.0 rc4, I failed initially
because Solaris lacks chrpath.  This patch accounts for that and allowed the run to
continue.

Tested on amd64-pc-solaris2.11 and sparcv9-sun-solaris2.11.

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

llvm-svn: 371741
2019-09-12 14:50:32 +00:00
Tim Northover
1bb14916f2 AArch64: support arm64_32, an ILP32 slice for watchOS.
This is the main CodeGen patch to support the arm64_32 watchOS ABI in LLVM.
FastISel is mostly disabled for now since it would generate incorrect code for
ILP32.

llvm-svn: 371722
2019-09-12 10:22:23 +00:00
Nico Weber
224c35980e gn build: Merge r371700
llvm-svn: 371701
2019-09-12 01:25:34 +00:00
Nico Weber
2145166934 gn build: Merge r371661
llvm-svn: 371670
2019-09-11 21:24:15 +00:00
Nico Weber
ac978cacf9 gn build: Merge r371657
llvm-svn: 371669
2019-09-11 21:24:11 +00:00
Nico Weber
944e7c848d gn build: Merge r371635
llvm-svn: 371636
2019-09-11 16:26:59 +00:00
Nico Weber
481cef9453 gn build: Merge r371562
llvm-svn: 371626
2019-09-11 14:40:16 +00:00
Nico Weber
b298a437ae gn build: add include_dir that's necessary after r371564
llvm-svn: 371611
2019-09-11 12:21:09 +00:00
Eric Christopher
24de559445 Move LLVM_ENABLE_ABI_BREAKING_CHECKS variables to their own file
so that you don't have to link Error.o and all of its dependencies.

In more detail: global initializers in Error.o can't be elided with
-ffunction-sections/-gc-sections since they always need to be run
causing a fairly significant binary bloat if all you want is the
ABI breaking checks code.

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

llvm-svn: 371561
2019-09-10 22:05:01 +00:00
Matt Arsenault
2c4cefbd49 GlobalISel/TableGen: Handle REG_SEQUENCE patterns
The scalar f64 patterns don't work yet because they fail on multiple
results from the unused implicit def of scc in the result bit
operation.

llvm-svn: 371542
2019-09-10 17:57:33 +00:00
Djordje Todorovic
0dec37607c Revert "[utils] Implement the llvm-locstats tool"
This reverts commit rL371520.

llvm-svn: 371527
2019-09-10 14:48:52 +00:00
Djordje Todorovic
64810143df [utils] Implement the llvm-locstats tool
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

The tool will be very useful for tracking improvements regarding the
"debugging optimized code" support with LLVM ecosystem.

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

llvm-svn: 371520
2019-09-10 13:47:03 +00:00
Dmitri Gribenko
8560522aac Revert "Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline.""
This reverts commit r371502, it broke tests
(clang/test/CodeGenCXX/auto-var-init.cpp).

llvm-svn: 371507
2019-09-10 10:39:09 +00:00
Clement Courbet
29890c92af Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline."
With a fix for sanitizer breakage (see explanation in D60318).

llvm-svn: 371502
2019-09-10 09:18:00 +00:00
Nico Weber
43169359b2 gn build: Merge r371488
llvm-svn: 371489
2019-09-10 06:31:59 +00:00
Nico Weber
795dd43f08 gn build: Merge r371484
llvm-svn: 371485
2019-09-10 03:18:25 +00:00
Mehdi Amini
6ea70ba5d0 Revert [git-llvm] Do not reinvent @{upstream}
This reverts r371290 (git commit 7faffd544b16f851a632d6b8f93e3c8485ff34bb)

The change wasnt NFC and broke some users' workflow. Reverting while figuring
out the best alternative to move forward.

llvm-svn: 371480
2019-09-10 01:26:36 +00:00
Nico Weber
26b0dc2c31 gn build: Merge r371466
llvm-svn: 371479
2019-09-10 01:11:30 +00:00
Nico Weber
fd82eee3fd gn build: (manually) merge r371429
llvm-svn: 371477
2019-09-10 00:48:20 +00:00
Matt Arsenault
4ec23178ea AMDGPU/GlobalISel: Select atomic loads
A new check for an explicitly atomic MMO is needed to avoid
incorrectly matching pattern for non-atomic loads

llvm-svn: 371418
2019-09-09 16:18:07 +00:00
Matt Arsenault
44317511dd AMDGPU: Remove code address space predicates
Fixes 8-byte, 8-byte aligned LDS loads. 16-byte case still broken due
to not be reported as legal.

llvm-svn: 371413
2019-09-09 16:02:07 +00:00
James Molloy
aecd6e19a2 [DFAPacketizer] Reapply: Track resources for packetized instructions
Reapply with fix to reduce resources required by the compiler - use
unsigned[2] instead of std::pair. This causes clang and gcc to compile
the generated file multiple times faster, and hopefully will reduce
the resource requirements on Visual Studio also. This fix is a little
ugly but it's clearly the same issue the previous author of
DFAPacketizer faced (the previous tables use unsigned[2] rather uglily
too).

This patch allows the DFAPacketizer to be queried after a packet is formed to work out which
resources were allocated to the packetized instructions.

This is particularly important for targets that do their own bundle packing - it's not
sufficient to know simply that instructions can share a packet; which slots are used is
also required for encoding.

This extends the emitter to emit a side-table containing resource usage diffs for each
state transition. The packetizer maintains a set of all possible resource states in its
current state. After packetization is complete, all remaining resource states are
possible packetization strategies.

The sidetable is only ~500K for Hexagon, but the extra tracking is disabled by default
(most uses of the packetizer like MachinePipeliner don't care and don't need the extra
maintained state).

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

llvm-svn: 371399
2019-09-09 13:17:55 +00:00
Simon Pilgrim
1c0d839652 Revert rL371198 from llvm/trunk: [DFAPacketizer] Track resources for packetized instructions
This patch allows the DFAPacketizer to be queried after a packet is formed to work out which
resources were allocated to the packetized instructions.

This is particularly important for targets that do their own bundle packing - it's not
sufficient to know simply that instructions can share a packet; which slots are used is
also required for encoding.

This extends the emitter to emit a side-table containing resource usage diffs for each
state transition. The packetizer maintains a set of all possible resource states in its
current state. After packetization is complete, all remaining resource states are
possible packetization strategies.

The sidetable is only ~500K for Hexagon, but the extra tracking is disabled by default
(most uses of the packetizer like MachinePipeliner don't care and don't need the extra
maintained state).

Differential Revision: https://reviews.llvm.org/D66936
........
Reverted as this is causing "compiler out of heap space" errors on MSVC 2017/19 NDEBUG builds

llvm-svn: 371393
2019-09-09 12:33:22 +00:00
David Zarzycki
a734b4b36f [git-llvm] Do not reinvent @{upstream}
Make `git-llvm` more robust when used with a nontrivial repository.

https://reviews.llvm.org/D67262

llvm-svn: 371290
2019-09-07 06:44:52 +00:00
Matt Arsenault
0f15b35531 GlobalISel: Support physical register inputs in patterns
llvm-svn: 371253
2019-09-06 20:32:37 +00:00
James Molloy
bd5b6d09b9 [DFAPacketizer] Track resources for packetized instructions
This patch allows the DFAPacketizer to be queried after a packet is formed to work out which
resources were allocated to the packetized instructions.

This is particularly important for targets that do their own bundle packing - it's not
sufficient to know simply that instructions can share a packet; which slots are used is
also required for encoding.

This extends the emitter to emit a side-table containing resource usage diffs for each
state transition. The packetizer maintains a set of all possible resource states in its
current state. After packetization is complete, all remaining resource states are
possible packetization strategies.

The sidetable is only ~500K for Hexagon, but the extra tracking is disabled by default
(most uses of the packetizer like MachinePipeliner don't care and don't need the extra
maintained state).

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

llvm-svn: 371198
2019-09-06 12:20:08 +00:00
Nico Weber
a1ed6b84eb gn build: Merge r371182
llvm-svn: 371191
2019-09-06 09:44:13 +00:00
Nico Weber
94d1e484fb gn build: Merge r371179
llvm-svn: 371190
2019-09-06 09:44:10 +00:00
Nico Weber
c5822be200 gn build: Merge r371159
llvm-svn: 371161
2019-09-06 01:22:13 +00:00
Matt Arsenault
fe20e32ba0 GlobalISel/TableGen: Fix handling of EXTRACT_SUBREG constraints
This was only using the correct register constraints if this was the
final result instruction. If the extract was a sub instruction of the
result, it would attempt to use GIR_ConstrainSelectedInstOperands on a
COPY, which won't work. Move the handling to
createAndImportSubInstructionRenderer so it works correctly.

I don't fully understand why runOnPattern and
createAndImportSubInstructionRenderer both need to handle these
special cases, and constrain them with slightly different methods. If
I remove the runOnPattern handling, it does break the constraint when
the final result instruction is EXTRACT_SUBREG.

llvm-svn: 371150
2019-09-06 00:05:58 +00:00
Nico Weber
2bc897e1bd gn build: Merge r371134
llvm-svn: 371135
2019-09-05 22:40:47 +00:00
Nico Weber
57ffd0059f gn build: Merge r371121
llvm-svn: 371123
2019-09-05 20:58:38 +00:00
Nico Weber
370c784789 gn build: Merge r371117
llvm-svn: 371119
2019-09-05 20:38:24 +00:00
Nico Weber
da0c5a3e78 gn build: Merge r371103
llvm-svn: 371105
2019-09-05 18:15:50 +00:00
Nico Weber
46a38628ea gn build: (manually) merge r358706
llvm-svn: 371102
2019-09-05 18:03:18 +00:00
Nico Weber
91683fcaf2 gn build: (manually) merge r371003
llvm-svn: 371091
2019-09-05 17:22:55 +00:00
Nico Weber
329dea1715 gn build: Merge r370985
llvm-svn: 370988
2019-09-04 21:34:21 +00:00
Matt Arsenault
8c03368633 GlobalISel/TableGen: Don't skip REG_SEQUENCE based on patterns
This partially adds support for patterns with REG_SEQUENCE. The source
patterns are now accepted, but the pattern is still rejected due to
missing support for the instruction renderer.

llvm-svn: 370920
2019-09-04 16:19:34 +00:00
Nico Weber
8295707d08 gn build: Merge r370862
llvm-svn: 370876
2019-09-04 11:08:09 +00:00
Roman Lebedev
9a23f88f70 Revert "[Clang Interpreter] Initial patch for the constexpr interpreter"
Breaks BUILD_SHARED_LIBS build, introduces cycles in library dependency
graphs. (clangInterp depends on clangAST which depends on clangInterp)

This reverts r370839, which is an yet another recommit of D64146.

llvm-svn: 370874
2019-09-04 10:57:06 +00:00
Nico Weber
b9a47b01a4 gn build: Merge r370843
llvm-svn: 370844
2019-09-04 07:40:03 +00:00
Nandor Licker
e802dcb601 [Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 370839
2019-09-04 05:49:41 +00:00
Nico Weber
eb0560e066 gn build: (manually) merge r370499
llvm-svn: 370752
2019-09-03 13:17:16 +00:00
Nico Weber
bc0e7d950e gn build: Merge r370746
llvm-svn: 370749
2019-09-03 13:01:17 +00:00
Nandor Licker
bd1a6d1125 Revert [Clang Interpreter] Initial patch for the constexpr interpreter
This reverts r370636 (git commit 8327fed9475a14c3376b4860c75370c730e08f33)

llvm-svn: 370642
2019-09-02 11:34:47 +00:00
Nandor Licker
aec22e274e [Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 370636
2019-09-02 10:38:08 +00:00
Nandor Licker
750799df1e Revert [Clang Interpreter] Initial patch for the constexpr interpreter
This reverts r370584 (git commit afcb3de117265a69d21e5673356e925a454d7d02)

llvm-svn: 370588
2019-08-31 15:15:39 +00:00
Nandor Licker
6918fd5dcf [Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.

Reviewers: Bigcheese, jfb, rsmith

Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 370584
2019-08-31 15:00:38 +00:00
Nico Weber
d452d2ab8b gn build: Merge r370512
llvm-svn: 370516
2019-08-30 20:06:44 +00:00
James Molloy
74fb57df4f [DFAPacketizer] Allow namespacing of automata per-itinerary
The Hexagon itineraries are cunningly crafted such that functional units between
itineraries do not clash. Because all itineraries are bundled into the same DFA,
a functional unit index clash would cause an incorrect DFA to be generated.

A workaround for this is to ensure all itineraries declare the universe of all
possible functional units, but this isn't ideal for three reasons:
  1) We only have a limited number of FUs we can encode in the packetizer, and
     using the universe causes us to hit the limit without care.
  2) Silent codegen faults are bad, and careful triage of the FU list shouldn't
     be required.
  3) Smooshing all itineraries into the same automaton allows combinations of
     instruction classes that cannot exist, which bloats the table.

A simple solution is to allow "namespacing" packetizers.

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

llvm-svn: 370508
2019-08-30 19:50:49 +00:00
Nico Weber
99225dd97f gn build: Merge r370500
llvm-svn: 370501
2019-08-30 18:55:11 +00:00
Craig Topper
89128644b0 [ValueTypes] Add v16f16 and v32f16 to EVT::getEVTString and Tablegen's getEnumName
Missed these when I hadded the enum entries

llvm-svn: 370494
2019-08-30 17:34:29 +00:00
Nico Weber
2bd08cce34 gn build: Merge r370490
llvm-svn: 370492
2019-08-30 17:30:08 +00:00
Sven van Haastregt
5474afbc05 vim: add immarg keyword
The `immarg` attribute was added in r355981.

llvm-svn: 370443
2019-08-30 08:52:55 +00:00
Nico Weber
4418525d36 gn build: Merge r370441
llvm-svn: 370442
2019-08-30 08:26:37 +00:00
Matt Arsenault
5bfe49f2ac GlobalISel/TableGen: Handle setcc patterns
This is a special case because one node maps to two different G_
instructions, and the operand order is changed.

This mostly enables G_FCMP for AMDPGPU. G_ICMP is still manually
selected for now since it has the SALU and VALU complication to deal
with.

llvm-svn: 370280
2019-08-29 01:13:41 +00:00
Jessica Paquette
9c177a174f Add tie-breaker for register class sorting in getSuperRegForSubReg
llvm::stable_sort is apparently not sufficient.

Use the same tie-breaker/sorting style as TopoOrderRC fix bot failures.

E.g.

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/19401/steps/test-check-all/logs/stdio

llvm-svn: 370267
2019-08-28 22:03:05 +00:00
Jessica Paquette
4ebd240de7 [GlobalISel] Import patterns containing SUBREG_TO_REG
Reuse the logic for INSERT_SUBREG to also import SUBREG_TO_REG patterns.

- Split `inferSuperRegisterClass` into two functions, one which tries to use
  an existing TreePatternNode (`inferSuperRegisterClassForNode`), and one that
  doesn't. SUBREG_TO_REG doesn't have a node to leverage, which is the cause
  for the split.

- Rename GlobalISelEmitterInsertSubreg.td to GlobalISelEmitterSubreg.td and
  update it.

- Update impacted tests in the AArch64 and X86 backends.

This is kind of a hit/miss for code size improvements/regressions. E.g. in
add-ext.ll, we now get some identity copies. This isn't really anything the
importer can handle, since it's caused by a later pass introducing the copy for
the sake of correctness.

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

llvm-svn: 370254
2019-08-28 20:12:31 +00:00
Nico Weber
fca6217502 gn build: Merge r370249
llvm-svn: 370251
2019-08-28 19:38:59 +00:00
Nico Weber
ffe94e8e3f gn build: Merge r370187
llvm-svn: 370188
2019-08-28 11:42:20 +00:00
Jessica Paquette
2f041a67b9 Recommit "[GlobalISel] Import patterns containing INSERT_SUBREG"
I thought `llvm::sort` was stable for some reason but it's not.

Use `llvm::stable_sort` in `CodeGenTarget::getSuperRegForSubReg`.

Original patch: https://reviews.llvm.org/D66498

llvm-svn: 370084
2019-08-27 17:47:06 +00:00
Jessica Paquette
baa3b0c80e Revert "[GlobalISel] Import patterns containing INSERT_SUBREG"
When EXPENSIVE_CHECKS are enabled, GlobalISelEmitterSubreg.td doesn't get
stable output.

Reverting while I debug it.

See: https://reviews.llvm.org/D66498
llvm-svn: 370080
2019-08-27 17:26:44 +00:00
Cullen Rhodes
b3e8c4675d [IntrinsicEmitter] Support scalable vectors in intrinsics
Summary:
This patch adds support for scalable vectors in intrinsics, enabling
intrinsics such as the following to be defined:

    declare <vscale x 4 x i32> @llvm.something.nxv4i32(<vscale x 4 x i32>)

Support for this is implemented by defining a new type descriptor for
scalable vectors and adding mangling support for scalable vector types
in the name mangling scheme used by 'any' types in intrinsic signatures.

Tests have been added for IRBuilder to test scalable vectors work as
expected when using intrinsics through this interface. This required
implementing an intrinsic that is explicitly defined with scalable
vectors, e.g.  LLVMType<nxv4i32>, an SVE floating-point convert
intrinsic was used for this.  The behaviour of the overloaded type
LLVMScalarOrSameVectorWidth with scalable vectors is tested using the
existing masked load intrinsic. Also added an .ll test to test the
Verifier catches a bad intrinsic argument when passing a fixed-width
predicate (mask) to the masked.load intrinsic where a scalable is
expected.

Patch by Paul Walker

Reviewed By: sdesmalen

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

llvm-svn: 370053
2019-08-27 12:57:09 +00:00
Jessica Paquette
131412fdfc [GlobalISel] Import patterns containing INSERT_SUBREG
This teaches the importer to handle INSERT_SUBREG instructions.

We were missing patterns involving INSERT_SUBREG in AArch64. It appears in
AArch64InstrInfo.td 107 times, and 14 times in AArch64InstrFormats.td.

To meaningfully import it, the GlobalISelEmitter needs to know how to infer a
super register class for a given register class.

This patch introduces the following:

- `getSuperRegForSubReg`, a function which finds the largest register class
which supports a value type and subregister index

- `inferSuperRegisterClass`, a function which finds the appropriate super
register class for an INSERT_SUBREG'

- `inferRegClassFromPattern`, a function which allows for some trivial
lookthrough into instructions

- `getRegClassFromLeaf`, a helper function which returns the register class for
a leaf `TreePatternNode`

- Support for subregister index operands in `importExplicitUseRenderer`

It also

- Updates tests in each backend which are impacted by the change

- Adds GlobalISelEmitterSubreg.td to test that we import and skip the expected
patterns

As a result of this patch, INSERT_SUBREG patterns in X86 may use the
LOW32_ADDR_ACCESS_RBP register class instead of GR32. This is correct, since the
register class contains the same registers as GR32 (except with the addition of
RBP). So, this also teaches X86 to handle that register class. This is in line
with X86ISelLowering, which treats this as a GR class.

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

llvm-svn: 369973
2019-08-26 21:38:57 +00:00
Nico Weber
a3bec823a0 gn build: Merge r369918
llvm-svn: 369953
2019-08-26 19:27:26 +00:00
Nico Weber
595b0b9782 gn build: color linker errors when using lld
llvm-svn: 369951
2019-08-26 19:22:41 +00:00
Nico Weber
a390fff954 gn build: (manually) merge r369741
llvm-svn: 369950
2019-08-26 19:22:39 +00:00
Nico Weber
de31ce816c gn build: (manually) merge r369940
llvm-svn: 369948
2019-08-26 19:08:43 +00:00
Bjorn Pettersson
22afe8331c [TableGen] Correct comments for end of namespace. NFC
Summary:
Update end-of-namespace comments generated by
tablegen emitters to fulfill the rules setup by
clang-tidy's llvm-namespace-comment checker.

Fixed a few end-of-namespace comments in the
tablegen source code as well.

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: craig.topper, stoklund, dschuff, sbc100, jgravelle-google, aheejin, llvm-commits

Tags: #llvm

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

llvm-svn: 369865
2019-08-25 10:47:30 +00:00
Benjamin Kramer
2e5598037b Use a bit of relaxed constexpr to make FeatureBitset costant intializable
This requires std::intializer_list to be a literal type, which it is
starting with C++14. The downside is that std::bitset is still not
constexpr-friendly so this change contains a re-implementation of most
of it.

Shrinks clang by ~60k.

llvm-svn: 369847
2019-08-24 15:02:44 +00:00
Peter Collingbourne
590e5e5ec0 hwasan: Untag unwound stack frames by wrapping personality functions.
One problem with untagging memory in landing pads is that it only works
correctly if the function that catches the exception is instrumented.
If the function is uninstrumented, we have no opportunity to untag the
memory.

To address this, replace landing pad instrumentation with personality function
wrapping. Each function with an instrumented stack has its personality function
replaced with a wrapper provided by the runtime. Functions that did not have
a personality function to begin with also get wrappers if they may be unwound
past. As the unwinder calls personality functions during stack unwinding,
the original personality function is called and the function's stack frame is
untagged by the wrapper if the personality function instructs the unwinder
to keep unwinding. If unwinding stops at a landing pad, the function is
still responsible for untagging its stack frame if it resumes unwinding.

The old landing pad mechanism is preserved for compatibility with old runtimes.

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

llvm-svn: 369721
2019-08-23 01:28:44 +00:00
Jonas Devlieghere
e17deae810 [utils] Update shebang to use the environment.
This changes the shebang to launch bash through /usr/bin/env.

llvm-svn: 369717
2019-08-22 23:42:31 +00:00
Nico Weber
a47fd93967 gn build: Merge r369680
llvm-svn: 369682
2019-08-22 18:22:05 +00:00
Nico Weber
c18c601e28 gn build: Merge r369677
llvm-svn: 369678
2019-08-22 17:53:18 +00:00
Benjamin Kramer
74e9ad1a9d Retire llvm::less_ptr. llvm::deref is much more flexible.
llvm-svn: 369675
2019-08-22 17:32:16 +00:00
Benjamin Kramer
db09140c2c Retire llvm::less/equal in favor of C++14 std::less<>/equal_to<>.
llvm-svn: 369674
2019-08-22 17:31:59 +00:00
Joel E. Denny
6a358c4b85 [lit] Diagnose insufficient args to internal env
Without this patch, failing to provide a subcommand to lit's internal
`env` results in either a python `IndexError` or an attempt to execute
the final `env` argument, such as `FOO=1`, as a command.  This patch
diagnoses those cases with a more helpful message.

Reviewed By: stella.stamenova

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

llvm-svn: 369620
2019-08-22 03:42:01 +00:00
Nico Weber
82b7ef8a9f gn build: Merge r369605
llvm-svn: 369608
2019-08-22 00:40:55 +00:00
Nico Weber
d6b30e4ae4 gn build: Merge r369600
llvm-svn: 369603
2019-08-22 00:01:59 +00:00
Nico Weber
aea7e97755 gn build: Merge r369591
llvm-svn: 369594
2019-08-21 22:26:02 +00:00
Nico Weber
fa43483d7c gn build: Merge r369587
llvm-svn: 369593
2019-08-21 22:25:57 +00:00
Nico Weber
de13687e6d gn build: Merge r369568
llvm-svn: 369572
2019-08-21 20:20:36 +00:00
Nico Weber
3e007d1b92 gn build: Make sync script not exit 1 if it writes changes
llvm-svn: 369571
2019-08-21 20:13:00 +00:00
Nico Weber
5e59422976 git-llvm: Make push --force suppress error on nothing to commit as well
llvm-svn: 369544
2019-08-21 16:03:34 +00:00
Nico Weber
e291923878 git-llvm: Give "push" a --force flag to disable confirm prompt on multiple commits
llvm-svn: 369538
2019-08-21 15:41:20 +00:00
Sam McCall
5c34df512c reland [gtest] Fix printing of StringRef and SmallString in assert messages.
Renames GTEST_NO_LLVM_RAW_OSTREAM -> GTEST_NO_LLVM_SUPPORT and guards
the new features behind it.

This reverts commit a063bcf3ef5a879adbe9639a3c187d876eee0e66.

llvm-svn: 369527
2019-08-21 13:56:29 +00:00
Simon Atanasyan
0b79ce4e56 Add 9.0 release bug to merge request script
llvm-svn: 369526
2019-08-21 13:42:10 +00:00
Sam McCall
19ee72937d Revert "[gtest] Fix printing of StringRef and SmallString in assert messages."
This reverts commit 4becb2ab4e9f52ce98272d1f5930d6942af5172b.

llvm-svn: 369525
2019-08-21 13:31:44 +00:00
Sam McCall
0221b8e200 [gtest] Fix printing of StringRef and SmallString in assert messages.
Summary:
These are detected by gtest as containers, and so previously printed as e.g.
  { '.' (46, 0x2E), 's' (115, 0x73), 'e' (101, 0x65), 'c' (99, 0x63), '0' (48, 0x30) },

gtest itself overloads PrintTo for std::string and friends, we use the same mechanism.

Reviewers: labath

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 369518
2019-08-21 11:37:06 +00:00
Nico Weber
c84945036c Remove llvm/utils/git/find-rev
It assumes git-svn, hasn't been touched in ages, and it's replaced
by llvm-git in llvm/utils/git-svn.

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

llvm-svn: 369478
2019-08-20 23:59:07 +00:00
Nico Weber
7247cd5cf7 gn build: Merge r369467
llvm-svn: 369476
2019-08-20 23:49:12 +00:00
Jessica Paquette
defcf6aa12 Teach GlobalISelEmitter to treat used iPTRAny operands as pointer operands
Overloaded intrinsics can use iPTRAny in used/input operands.

The GlobalISelEmitter doesn't know that these are pointers, so it treats them
as scalars. As a result, these intrinsics can't be imported.

This teaches the GlobalISelEmitter to recognize these as pointers rather than
scalars.

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

llvm-svn: 369455
2019-08-20 22:04:10 +00:00
Nico Weber
ec4fa0e154 gn build: Merge r369298
llvm-svn: 369401
2019-08-20 16:19:50 +00:00
Joel E. Denny
eaf7cad4eb [lit] Check for accidental external command calls
This patch extends lit's test suite to check that lit's internal shell
doesn't accidentally execute internal commands as external commands.
It does so by putting fake failing versions of those commands in
`PATH` while the entire lit test suite is running.  Without the fixes
in D65697 but with its tests, this approach catches accidental
external `env` calls.

Reviewed By: probinson

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

llvm-svn: 369309
2019-08-19 22:59:37 +00:00
Matt Arsenault
09382185bf TableGen: Revert changes from r369038
These aren't needed for a specific use yet, and I meant to not commit
these.

llvm-svn: 369201
2019-08-18 00:20:42 +00:00
Adrian Prantl
9683aa52f0 Add LLDB dataformatters for llvm::StringRef and lldb_private::ConstString
These data formatters make the string value appear in Xcode's
variables view (and on the command line) without having to expand the
data structure.

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

llvm-svn: 369175
2019-08-16 23:47:57 +00:00
Nico Weber
4475276f7e gn build: Merge r369064
llvm-svn: 369074
2019-08-16 00:04:48 +00:00
Nico Weber
3ada940abc gn build: Merge r369061
llvm-svn: 369073
2019-08-16 00:04:42 +00:00
Jinsong Ji
1bcb6d2dd5 [Utils][NFC] Copy bisect usage documents from commit msg into script.
Copy the message into script, so that new users won't need to dig into
commit messages to figure out how to use.

The message are copied directly from Michael's commit message in
https://reviews.llvm.org/rL214610.

llvm-svn: 369054
2019-08-15 22:07:59 +00:00
Nico Weber
693ececc82 gn build: Merge r369039
llvm-svn: 369047
2019-08-15 21:00:33 +00:00
Nico Weber
0562fc402f gn build: Merge r369018
llvm-svn: 369046
2019-08-15 21:00:26 +00:00
Matt Arsenault
4c5716bea1 MVT: Add v3i16/v3f16 vectors
AMDGPU has some buffer intrinsics which theoretically could use
this. Some of the generated tables include the 3 and 4 element vector
versions of these rounded to 64-bits, which is ambiguous. Add these to
help the table disambiguate these.

Assertion change is for the path odd sized vectors now take for R600.
v3i16 is widened to v4i16, which then needs to be promoted to v4i32.

llvm-svn: 369038
2019-08-15 18:58:25 +00:00
Jonas Devlieghere
2c693415b7 [llvm] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

llvm-svn: 369013
2019-08-15 15:54:37 +00:00
Vitaly Buka
6cf81dca9f gn build: Merge r368918
llvm-svn: 368951
2019-08-15 01:38:30 +00:00
Nico Weber
e13b75e160 gn build: Pre-merge https://reviews.llvm.org/D66195
llvm-svn: 368840
2019-08-14 12:38:43 +00:00
David Bolvansky
a9fd1c29b8 [Intrinsics] Add a 'NoAlias' intrinsic property; annotate llvm.memcpy
Reviewers: jdoerfert

Reviewed By: jdoerfert

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

llvm-svn: 368810
2019-08-14 08:33:07 +00:00
Joel E. Denny
5944e43c94 [FileCheck] Document FILECHECK_OPTS in -help
Reviewed By: thopre

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

llvm-svn: 368787
2019-08-14 02:56:20 +00:00
Joel E. Denny
86f2b361a4 [FileCheck] Move -dump-input diagnostic to first line
Without this patch, `-dump-input` prints a diagnostic at the end of
its marker range.  For example:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~ error: no match found
```

This patch moves it to the beginning like this:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~ error: no match found
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~
```

The former somehow looks nicer because the diagnostic doesn't appear
to be somewhere within the marker range.  However, the latter is more
practical, especially when the marker range includes the remainder of
a very long dump.  First, in the case of an error, this patch enables
me to search the dump for `error:` and usually immediately land where
the detected error began.  Second, when trying to follow FileCheck's
logic, it's best to read top down, so this patch enables me to see
each diagnostic as soon as I encounter its marker.

Reviewed By: thopre

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

llvm-svn: 368786
2019-08-14 02:56:09 +00:00
Jordan Rupprecht
465368d786 [util] Allow callsigns when running git llvm revert
llvm-svn: 368726
2019-08-13 17:19:53 +00:00
Nico Weber
94809595b4 gn build: Extract git() and git_out() functions in sync script
llvm-svn: 368671
2019-08-13 11:48:15 +00:00
Nico Weber
0c4a5b4fb3 gn build: Merge r368630
llvm-svn: 368668
2019-08-13 11:32:54 +00:00
Nico Weber
9f1b5e2f87 gn build: Give cmake sync script an opt-in --write flag
Differential Revision: https://reviews.llvm.org/D66101

llvm-svn: 368667
2019-08-13 11:32:45 +00:00
Nico Weber
5b33b4788c gn build: Make sync script group output by revision
Differential Revision: https://reviews.llvm.org/D66090

llvm-svn: 368665
2019-08-13 11:24:20 +00:00
Nico Weber
d62cc7d7eb gn build: Merge r368592
llvm-svn: 368601
2019-08-12 18:33:10 +00:00
Michael Liao
b0f9c14a99 [TableGen] Correct the shift to the proper bit width.
- Replace the previous 32-bit shift with 64-bit one matching `OpInit`.

llvm-svn: 368513
2019-08-10 16:15:06 +00:00
Peter Collingbourne
90930e7653 gn build: Merge r368432.
llvm-svn: 368470
2019-08-09 19:28:53 +00:00
Peter Collingbourne
db8f871348 gn build: Merge r368439.
llvm-svn: 368469
2019-08-09 19:28:44 +00:00
Peter Collingbourne
804d13f741 gn build: Merge r368402.
llvm-svn: 368468
2019-08-09 19:28:35 +00:00
Peter Collingbourne
5d016b9fba gn build: Merge r368392.
llvm-svn: 368467
2019-08-09 19:28:26 +00:00
Peter Collingbourne
442486b0ef gn build: Merge r368358.
llvm-svn: 368466
2019-08-09 19:28:17 +00:00
Daniel Sanders
91b87f212b [TableGen] Add "InitValue": Handle operands with set bit values in decoder methods
Summary:
The problem:
  When an operand had bits explicitly set to "1" (as in the InitValue.td test case attached), the decoder was ignoring those bits, and the DecoderMethod was receiving an input where the bits were still zero.

The solution:
  We added an "InitValue" variable that stores the initial value of the operand based on what bits were explicitly initialized to 1 in TableGen code. The generated decoder code then uses that initial value to initialize the "tmp" variable, then calls fieldFromInstruction to read the values for the remaining bits that were left unknown in TableGen.

This is mainly useful when there are variations of an instruction that differ based on what bits are set in the operands, since this change makes it possible to access those bits in a DecoderMethod. The DecoderMethod can use those bits to know how to handle the input.

Patch by Nicolas Guillemot

Reviewers: craig.topper, dsanders, fhahn

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 368458
2019-08-09 17:30:33 +00:00
Peter Collingbourne
26f161bd79 gn build: Merge r368331.
llvm-svn: 368333
2019-08-08 20:11:23 +00:00
Tom Stellard
002fbdec62 lit: Bump version to 0.10.0
Reviewers: hans

Subscribers: hans, delcypher, llvm-commits

Tags: #llvm

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

llvm-svn: 368329
2019-08-08 19:22:23 +00:00
Tom Stellard
7c9c0e003e lit: Use a License classifier that pypi will accept
Summary:
'OSI Approved :: Apache-2.0 with LLVM exception' is not a valid
classifier.  'OSI Approved :: Apache Software License' is the closest
fit for the new license, so we've decided to use this one.

The classifiers seem to only be used for searching on the pypi website,
so this does not actually change the license of the code.
We still pass 'Apache-2.0 with LLVM exception' as the license to setup(),
and this appears alongside the classifier on the pypi webpage for lit.

Reviewers: chandlerc, ddunbar, joerg

Reviewed By: joerg

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

llvm-svn: 368315
2019-08-08 17:23:33 +00:00
Nico Weber
0ddc85d9b7 gn build: Merge r368158
llvm-svn: 368179
2019-08-07 15:30:44 +00:00
Nico Weber
d47ea92928 gn build: Merge r368119
llvm-svn: 368178
2019-08-07 15:29:01 +00:00
David Bolvansky
0ca0595e45 [UpdateTestChecks] Update tests option
Summary:
Port of new feature introduced https://reviews.llvm.org/D65610 to other update scripts.

- update_*_checks.py: add an alias -u for --update-only
- port --update-only to other update_*_test_checks.py scripts
- update script aborts if the test file was generated by another update_*_test_checks.py utility

Reviewers: lebedev.ri, RKSimon, MaskRay, reames, gbedwell

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368174
2019-08-07 14:44:50 +00:00
Ilya Biryukov
aca1d6ae8a [unittests] Mark private gmock headers with IWYU pragmas. NFC
Summary: To prevent clangd from adding #include of those headers.

Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: kadircet, llvm-commits, cfe-commits

Tags: #llvm

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

llvm-svn: 368135
2019-08-07 08:45:38 +00:00
Craig Topper
7b7ab0396a [X86] Limit vpermil2pd/vpermil2ps immediates to 4 bits in the assembly parser.
The upper 4 bits of the immediate byte are used to encode a
register. We need to limit the explicit immediate to fit in the
remaining 4 bits.

Fixes PR42899.

llvm-svn: 368123
2019-08-07 05:34:27 +00:00
Peter Collingbourne
d3aa443a82 gn build: Merge r368065.
llvm-svn: 368099
2019-08-06 21:48:06 +00:00
Peter Collingbourne
1c58420d1f gn build: Merge r368052.
llvm-svn: 368098
2019-08-06 21:47:55 +00:00
Peter Collingbourne
139186c8d3 gn build: Merge r368054.
llvm-svn: 368097
2019-08-06 21:47:46 +00:00
Peter Collingbourne
6c55a16a1a gn build: Merge r368086.
llvm-svn: 368096
2019-08-06 21:47:37 +00:00