Commit Graph

7928 Commits

Author SHA1 Message Date
Nico Weber fb3e023000 gn build: Merge r371134
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371135 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 22:40:47 +00:00
Nico Weber db80ca313b gn build: Merge r371121
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371123 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 20:58:38 +00:00
Nico Weber 7ebdaff1b8 gn build: Merge r371117
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371119 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 20:38:24 +00:00
Nico Weber 7bede80a68 gn build: Merge r371103
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371105 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 18:15:50 +00:00
Nico Weber 1eed8c70c1 gn build: (manually) merge r358706
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371102 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 18:03:18 +00:00
Nico Weber 88d9a2d543 gn build: (manually) merge r371003
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371091 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 17:22:55 +00:00
Nico Weber f24949cb9d gn build: Merge r370985
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370988 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 21:34:21 +00:00
Matt Arsenault e2d7eae297 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370920 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 16:19:34 +00:00
Nico Weber af19fb6bfc gn build: Merge r370862
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370876 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 11:08:09 +00:00
Roman Lebedev 4bc8111959 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370874 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 10:57:06 +00:00
Nico Weber 69dde116f1 gn build: Merge r370843
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370844 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 07:40:03 +00:00
Nandor Licker 358cb2c3f3 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370839 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 05:49:41 +00:00
Nico Weber fcc73175f5 gn build: (manually) merge r370499
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370752 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 13:17:16 +00:00
Nico Weber 16856f1d12 gn build: Merge r370746
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370749 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-03 13:01:17 +00:00
Nandor Licker ded593f579 Revert [Clang Interpreter] Initial patch for the constexpr interpreter
This reverts r370636 (git commit 8327fed9475a14c3376b4860c75370c730e08f33)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370642 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-02 11:34:47 +00:00
Nandor Licker 0ee50837eb [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-02 10:38:08 +00:00
Nandor Licker 023a00e02d Revert [Clang Interpreter] Initial patch for the constexpr interpreter
This reverts r370584 (git commit afcb3de117265a69d21e5673356e925a454d7d02)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370588 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-31 15:15:39 +00:00
Nandor Licker 5ab8476e20 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370584 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-31 15:00:38 +00:00
Nico Weber 952e2009ec gn build: Merge r370512
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370516 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 20:06:44 +00:00
James Molloy 505261e164 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370508 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 19:50:49 +00:00
Nico Weber 173f4ded85 gn build: Merge r370500
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370501 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 18:55:11 +00:00
Craig Topper 7adbcdcc55 [ValueTypes] Add v16f16 and v32f16 to EVT::getEVTString and Tablegen's getEnumName
Missed these when I hadded the enum entries

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370494 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 17:34:29 +00:00
Nico Weber 7c7f9d6e96 gn build: Merge r370490
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370492 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 17:30:08 +00:00
Sven van Haastregt 0bb362cc41 vim: add immarg keyword
The `immarg` attribute was added in r355981.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370443 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 08:52:55 +00:00
Nico Weber efda83b804 gn build: Merge r370441
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370442 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-30 08:26:37 +00:00
Matt Arsenault cef7580a71 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370280 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-29 01:13:41 +00:00
Jessica Paquette f28b6a50e6 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370267 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-28 22:03:05 +00:00
Jessica Paquette c6ee9a1aee [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370254 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-28 20:12:31 +00:00
Nico Weber 37f2296ec9 gn build: Merge r370249
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370251 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-28 19:38:59 +00:00
Nico Weber 69da3cb516 gn build: Merge r370187
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370188 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-28 11:42:20 +00:00
Jessica Paquette 9834453be7 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370084 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 17:47:06 +00:00
Jessica Paquette 165c379346 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370080 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 17:26:44 +00:00
Cullen Rhodes 2033d5f034 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370053 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-27 12:57:09 +00:00
Jessica Paquette ebaaf65942 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369973 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 21:38:57 +00:00
Nico Weber 4de1ebe64b gn build: Merge r369918
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369953 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 19:27:26 +00:00
Nico Weber cc8ba4d2b7 gn build: color linker errors when using lld
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369951 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 19:22:41 +00:00
Nico Weber db629c0a59 gn build: (manually) merge r369741
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369950 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 19:22:39 +00:00
Nico Weber 9d300e8c8b gn build: (manually) merge r369940
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369948 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-26 19:08:43 +00:00
Bjorn Pettersson 5bfe63103b [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369865 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-25 10:47:30 +00:00
Benjamin Kramer 4acc3db23f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369847 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-24 15:02:44 +00:00
Peter Collingbourne 4c91463616 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369721 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-23 01:28:44 +00:00
Jonas Devlieghere a9c1e3400a [utils] Update shebang to use the environment.
This changes the shebang to launch bash through /usr/bin/env.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369717 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 23:42:31 +00:00
Nico Weber 1bbce5cc30 gn build: Merge r369680
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369682 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 18:22:05 +00:00
Nico Weber 58fb3bff7c gn build: Merge r369677
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369678 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 17:53:18 +00:00
Benjamin Kramer 413649c62f Retire llvm::less_ptr. llvm::deref is much more flexible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369675 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 17:32:16 +00:00
Benjamin Kramer 3c473322ac Retire llvm::less/equal in favor of C++14 std::less<>/equal_to<>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369674 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 17:31:59 +00:00
Joel E. Denny 55c65a7a9a [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369620 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 03:42:01 +00:00
Nico Weber 548e855265 gn build: Merge r369605
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369608 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 00:40:55 +00:00
Nico Weber d0f2dcdf4e gn build: Merge r369600
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369603 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 00:01:59 +00:00
Nico Weber cfe81ce44b gn build: Merge r369591
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369594 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 22:26:02 +00:00