Commit Graph

7734 Commits

Author SHA1 Message Date
Nico Weber e7befecc42 gn build: Merge r370862
llvm-svn: 370876
2019-09-04 11:08:09 +00:00
Roman Lebedev 2c9f83cfab 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 5bfe8b562f gn build: Merge r370843
llvm-svn: 370844
2019-09-04 07:40:03 +00:00
Nandor Licker 32f82c9cba [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 600f5c5727 gn build: (manually) merge r370499
llvm-svn: 370752
2019-09-03 13:17:16 +00:00
Nico Weber 5f9aea72d6 gn build: Merge r370746
llvm-svn: 370749
2019-09-03 13:01:17 +00:00
Nandor Licker c3bdad8c1e Revert [Clang Interpreter] Initial patch for the constexpr interpreter
This reverts r370636 (git commit 8327fed947)

llvm-svn: 370642
2019-09-02 11:34:47 +00:00
Nandor Licker 8327fed947 [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 a6bef738bf Revert [Clang Interpreter] Initial patch for the constexpr interpreter
This reverts r370584 (git commit afcb3de117)

llvm-svn: 370588
2019-08-31 15:15:39 +00:00
Nandor Licker afcb3de117 [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 b83b4e9405 gn build: Merge r370512
llvm-svn: 370516
2019-08-30 20:06:44 +00:00
James Molloy 6ccd673206 [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 7b832322df gn build: Merge r370500
llvm-svn: 370501
2019-08-30 18:55:11 +00:00
Craig Topper 30ddd2ab6c [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 9976a5bc1d gn build: Merge r370490
llvm-svn: 370492
2019-08-30 17:30:08 +00:00
Sven van Haastregt fd66c8bf07 vim: add `immarg` keyword
The `immarg` attribute was added in r355981.

llvm-svn: 370443
2019-08-30 08:52:55 +00:00
Nico Weber 629f921568 gn build: Merge r370441
llvm-svn: 370442
2019-08-30 08:26:37 +00:00
Matt Arsenault 8ec5c10042 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 01cd91aaea 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 7080ffa21a [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 6acfc7c587 gn build: Merge r370249
llvm-svn: 370251
2019-08-28 19:38:59 +00:00
Nico Weber d2f5854567 gn build: Merge r370187
llvm-svn: 370188
2019-08-28 11:42:20 +00:00
Jessica Paquette a2ea8a1eca 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 3d9b39b733 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 2ba5d64a80 [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 69400f867d [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 09df43ca4b gn build: Merge r369918
llvm-svn: 369953
2019-08-26 19:27:26 +00:00
Nico Weber b7046859c7 gn build: color linker errors when using lld
llvm-svn: 369951
2019-08-26 19:22:41 +00:00
Nico Weber d9117e4e84 gn build: (manually) merge r369741
llvm-svn: 369950
2019-08-26 19:22:39 +00:00
Nico Weber 7e3d043459 gn build: (manually) merge r369940
llvm-svn: 369948
2019-08-26 19:08:43 +00:00
Bjorn Pettersson 6bd3a9eaa6 [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 16b322914a 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 21a1814417 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 dd323c3507 [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 ed184b03d2 gn build: Merge r369680
llvm-svn: 369682
2019-08-22 18:22:05 +00:00
Nico Weber f12d56f263 gn build: Merge r369677
llvm-svn: 369678
2019-08-22 17:53:18 +00:00
Benjamin Kramer cd2bae3bd7 Retire llvm::less_ptr. llvm::deref is much more flexible.
llvm-svn: 369675
2019-08-22 17:32:16 +00:00
Benjamin Kramer d5aecb9486 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 3c577bb415 [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 6e8b79e308 gn build: Merge r369605
llvm-svn: 369608
2019-08-22 00:40:55 +00:00
Nico Weber edb08da450 gn build: Merge r369600
llvm-svn: 369603
2019-08-22 00:01:59 +00:00
Nico Weber 40902b48dd gn build: Merge r369591
llvm-svn: 369594
2019-08-21 22:26:02 +00:00
Nico Weber e1f27e4ad1 gn build: Merge r369587
llvm-svn: 369593
2019-08-21 22:25:57 +00:00
Nico Weber d7887cf849 gn build: Merge r369568
llvm-svn: 369572
2019-08-21 20:20:36 +00:00
Nico Weber fe7eca239b 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 f3b179589e 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 862c94297c 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 a451156bb6 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 4d668a1f07 Add 9.0 release bug to merge request script
llvm-svn: 369526
2019-08-21 13:42:10 +00:00
Sam McCall e7c0356b69 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