Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 0903c72

Browse files
authored
Merge pull request #108 from alexcrichton/fix
Merge LLVM's release_60 branch and a cherry-pick
2 parents ba2edd7 + aa5b816 commit 0903c72

File tree

70 files changed

+1925
-1110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1925
-1110
lines changed

bindings/go/README.txt

+8
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,11 @@ CGO_CPPFLAGS, CGO_CXXFLAGS and CGO_LDFLAGS environment variables:
5151
$ export CGO_CXXFLAGS=-std=c++11
5252
$ export CGO_LDFLAGS="`/path/to/llvm-build/bin/llvm-config --ldflags --libs --system-libs all`"
5353
$ go build -tags byollvm
54+
55+
If you see a compilation error while compiling your code with Go 1.9.4 or later as follows,
56+
57+
go build llvm.org/llvm/bindings/go/llvm: invalid flag in #cgo LDFLAGS: -Wl,-headerpad_max_install_names
58+
59+
you need to setup $CGO_LDFLAGS_ALLOW to allow a compiler to specify some linker options:
60+
61+
$ export CGO_LDFLAGS_ALLOW='-Wl,(-search_paths_first|-headerpad_max_install_names)'

docs/ReleaseNotes.rst

+104-69
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ LLVM 6.0.0 Release Notes
55
.. contents::
66
:local:
77

8-
.. warning::
9-
These are in-progress notes for the upcoming LLVM 6 release.
10-
Release notes for previous releases can be found on
11-
`the Download Page <http://releases.llvm.org/download.html>`_.
12-
13-
148
Introduction
159
============
1610

@@ -26,19 +20,14 @@ have questions or comments, the `LLVM Developer's Mailing List
2620
<http://lists.llvm.org/mailman/listinfo/llvm-dev>`_ is a good place to send
2721
them.
2822

29-
Note that if you are reading this file from a Subversion checkout or the main
30-
LLVM web page, this document applies to the *next* release, not the current
31-
one. To see the release notes for a specific release, please see the `releases
32-
page <http://llvm.org/releases/>`_.
33-
3423
Non-comprehensive list of changes in this release
3524
=================================================
36-
.. NOTE
37-
For small 1-3 sentence descriptions, just add an entry at the end of
38-
this list. If your description won't fit comfortably in one bullet
39-
point (e.g. maybe you would like to give an example of the
40-
functionality, or simply have a lot to talk about), see the `NOTE` below
41-
for adding a new subsection.
25+
26+
* Support for `retpolines <https://support.google.com/faqs/answer/7625886>`_
27+
was added to help mitigate "branch target injection" (variant #2) of the
28+
"Spectre" speculative side channels described by `Project Zero
29+
<https://googleprojectzero.blogspot.com/2018/01/reading-privileged-memory-with-side.html>`_
30+
and the `Spectre paper <https://spectreattack.com/spectre.pdf>`_.
4231

4332
* The ``Redirects`` argument of ``llvm::sys::ExecuteAndWait`` and
4433
``llvm::sys::ExecuteNoWait`` was changed to an ``ArrayRef`` of optional
@@ -56,34 +45,33 @@ Non-comprehensive list of changes in this release
5645

5746
* Significantly improved quality of CodeView debug info for Windows.
5847

59-
* Note..
48+
* Preliminary support for Sanitizers and sibling features on X86(_64) NetBSD
49+
(ASan, UBsan, TSan, MSan, SafeStack, libFuzzer).
6050

61-
.. NOTE
62-
If you would like to document a larger change, then you can add a
63-
subsection about it right here. You can copy the following boilerplate
64-
and un-indent it (the indentation causes it to be inside this comment).
65-
66-
Special New Feature
67-
-------------------
68-
69-
Makes programs 10x faster by doing Special New Thing.
7051

7152
Changes to the LLVM IR
7253
----------------------
7354

55+
* The fast-math-flags (FMF) have been updated. Previously, the 'fast' flag
56+
indicated that floating-point reassociation was allowed and all other flags
57+
were set too. The 'fast' flag still exists, but there is a new flag called
58+
'reassoc' to indicate specifically that reassociation is allowed. A new bit
59+
called 'afn' was also added to selectively allow approximations for common
60+
mathlib functions like square-root. The new flags provide more flexibility
61+
to enable/disable specific floating-point optimizations. Making the
62+
optimizer respond appropriately to these flags is an ongoing effort.
63+
64+
7465
Changes to the AArch64 Target
7566
-----------------------------
7667

77-
During this release:
68+
* Enabled the new GlobalISel instruction selection framework by default at ``-O0``.
7869

79-
* Enabled the new GlobalISel instruction selection framework by default at ``-O0``.
8070

8171
Changes to the ARM Target
8272
-------------------------
8373

84-
During this release the ARM target has:
85-
86-
* Got support for enabling SjLj exception handling on platforms where it
74+
* Support for enabling SjLj exception handling on platforms where it
8775
isn't the default.
8876

8977

@@ -92,12 +80,12 @@ Changes to the Hexagon Target
9280

9381
* The Hexagon backend now supports V65 ISA.
9482

95-
* The ``-mhvx`` option now takes an optional value that specified the ISA
83+
* The ``-mhvx`` option now takes an optional value that specifies the ISA
9684
version of the HVX coprocessor. The available values are v60, v62 and v65.
9785
By default, the value is set to be the same as the CPU version.
9886

9987
* The compiler option ``-mhvx-double`` is deprecated and will be removed in
100-
the next release of the compiler. Programmers should use ``-mhvx-length``
88+
the next release of the compiler. Programmers should use the ``-mhvx-length``
10189
option to specify the desired vector length: ``-mhvx-length=64b`` for
10290
64-byte vectors and ``-mhvx-length=128b`` for 128-byte vectors. While the
10391
current default vector length is 64 bytes, users should always specify the
@@ -112,14 +100,46 @@ Changes to the Hexagon Target
112100
Changes to the MIPS Target
113101
--------------------------
114102

115-
During this release ...
103+
Fixed numerous bugs:
104+
105+
* fpowi on MIPS64 giving incorrect results when used with a negative integer.
106+
* Usage of the asm 'c' constraint with the wrong datatype causing an
107+
assert/crash.
108+
* Fixed a conversion bug when using the DSP ASE.
109+
* Fixed an inconsistency where objects were not marked as using the microMIPS as
110+
when the micromips function attribute or the ".set micromips" directive was
111+
used.
112+
* Reordered the MIPSR6 specific hazard scheduler pass to after the delay slot
113+
filler, fixing a class of rare edge case bugs where the delay slot filler
114+
would violate ISA restrictions.
115+
* Fixed a crash when using a type of unknown size with gp relative addressing.
116+
* Corrected the j macro for microMIPS.
117+
* Corrected the encoding of movep for microMIPS32r6.
118+
* Fixed an issue with the usage of insert instructions having an invalid set of
119+
operands.
120+
* Fixed an issue where TLS symbols were not marked as such.
121+
* Enabled the usage of register scavenging with MSA, due to its shorter offsets
122+
for loads and stores.
123+
* Corrected the ELF headers when using the DSP ASE.
124+
125+
New features:
126+
127+
* The long branch pass now generates some R6 specific instructions when
128+
targeting MIPSR6.
129+
* The delay slot filler now performs more branch conversions if delay slots
130+
cannot be filled.
131+
* The MIPS MT ASE is now fully supported.
132+
* Added support for the ``lapc`` pseudo instruction.
133+
* Improved the selection of multiple instructions (``dext``, ``nmadd``,
134+
``nmsub``).
135+
* Further improved microMIPS codesize reduction.
136+
137+
Deprecation notices:
138+
139+
* microMIPS64R6 support was been deprecated since 5.0, and has now been
140+
completely removed.
116141

117142

118-
Changes to the PowerPC Target
119-
-----------------------------
120-
121-
During this release ...
122-
123143
Changes to the SystemZ Target
124144
-----------------------------
125145

@@ -132,36 +152,66 @@ During this release the SystemZ target has:
132152
Changes to the X86 Target
133153
-------------------------
134154

135-
During this release ...
155+
During this release the X86 target has:
136156

137-
* Got support for enabling SjLj exception handling on platforms where it
157+
* Added support for enabling SjLj exception handling on platforms where it
138158
isn't the default.
139159

140-
Changes to the AMDGPU Target
141-
-----------------------------
160+
* Added intrinsics for Intel Extensions: VAES, GFNI, VPCLMULQDQ, AVX512VBMI2, AVX512BITALG, AVX512VNNI.
142161

143-
During this release ...
162+
* Added support for Intel Icelake CPU.
144163

145-
Changes to the AVR Target
146-
-----------------------------
164+
* Fixed some X87 codegen bugs.
147165

148-
During this release ...
166+
* Added instruction scheduling information for Intel Sandy Bridge, Ivy Bridge, Haswell, Broadwell, and Skylake CPUs.
149167

150-
Changes to the OCaml bindings
151-
-----------------------------
168+
* Improved scheduler model for AMD Jaguar CPUs.
169+
170+
* Improved llvm-mc's disassembler for some EVEX encoded instructions.
171+
172+
* Add support for i8 and i16 vector signed/unsigned min/max horizontal reductions.
173+
174+
* Improved codegen for memory comparisons
175+
176+
* Improved codegen for i32 vector multiplies
177+
178+
* Improved codegen for scalar integer absolute values
179+
180+
* Improved codegen for vector integer rotations (XOP and AVX512)
152181

153-
During this release ...
182+
* Improved codegen of data being transferred between GPRs and K-registers.
154183

184+
* Improved codegen for vector truncations.
155185

156-
Changes to the C API
157-
--------------------
186+
* Improved folding of address computations into gather/scatter instructions.
158187

159-
During this release ...
188+
* Gained initial support recognizing variable shuffles from vector element extracts and inserts.
189+
190+
* Improved documentation for SSE/AVX intrinsics in intrin.h header files.
191+
192+
* Gained support for emitting `retpolines
193+
<https://support.google.com/faqs/answer/7625886>`_, including automatic
194+
insertion of the necessary thunks or using external thunks.
160195

161196

162197
External Open Source Projects Using LLVM 6
163198
==========================================
164199

200+
LDC - the LLVM-based D compiler
201+
-------------------------------
202+
203+
`D <http://dlang.org>`_ is a language with C-like syntax and static typing. It
204+
pragmatically combines efficiency, control, and modeling power, with safety and
205+
programmer productivity. D supports powerful concepts like Compile-Time Function
206+
Execution (CTFE) and Template Meta-Programming, provides an innovative approach
207+
to concurrency and offers many classical paradigms.
208+
209+
`LDC <http://wiki.dlang.org/LDC>`_ uses the frontend from the reference compiler
210+
combined with LLVM as backend to produce efficient native code. LDC targets
211+
x86/x86_64 systems like Linux, OS X, FreeBSD and Windows and also Linux on ARM
212+
and PowerPC (32/64 bit). Ports to other architectures like AArch64 and MIPS64
213+
are underway.
214+
165215
JFS - JIT Fuzzing Solver
166216
------------------------
167217

@@ -188,21 +238,6 @@ import of .h symbols - even inline functions and macros. Zig uses LLD combined
188238
with lazily building compiler-rt to provide out-of-the-box cross-compiling for
189239
all supported targets.
190240

191-
LDC - the LLVM-based D compiler
192-
-------------------------------
193-
194-
`D <http://dlang.org>`_ is a language with C-like syntax and static typing. It
195-
pragmatically combines efficiency, control, and modeling power, with safety and
196-
programmer productivity. D supports powerful concepts like Compile-Time Function
197-
Execution (CTFE) and Template Meta-Programming, provides an innovative approach
198-
to concurrency and offers many classical paradigms.
199-
200-
`LDC <http://wiki.dlang.org/LDC>`_ uses the frontend from the reference compiler
201-
combined with LLVM as backend to produce efficient native code. LDC targets
202-
x86/x86_64 systems like Linux, OS X, FreeBSD and Windows and also Linux on ARM
203-
and PowerPC (32/64 bit). Ports to other architectures like AArch64 and MIPS64
204-
are underway.
205-
206241
Additional Information
207242
======================
208243

docs/index.rst

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
Overview
22
========
33

4-
.. warning::
5-
6-
If you are using a released version of LLVM, see `the download page
7-
<http://llvm.org/releases/>`_ to find your documentation.
8-
94
The LLVM compiler infrastructure supports a wide range of projects, from
105
industrial strength compilers to specialized JIT applications to small
116
research projects.

include/llvm/Bitcode/LLVMBitCodes.h

+14
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,20 @@ enum OverflowingBinaryOperatorOptionalFlags {
395395
OBO_NO_SIGNED_WRAP = 1
396396
};
397397

398+
/// FastMath Flags
399+
/// This is a fixed layout derived from the bitcode emitted by LLVM 5.0
400+
/// intended to decouple the in-memory representation from the serialization.
401+
enum FastMathMap {
402+
UnsafeAlgebra = (1 << 0), // Legacy
403+
NoNaNs = (1 << 1),
404+
NoInfs = (1 << 2),
405+
NoSignedZeros = (1 << 3),
406+
AllowReciprocal = (1 << 4),
407+
AllowContract = (1 << 5),
408+
ApproxFunc = (1 << 6),
409+
AllowReassoc = (1 << 7)
410+
};
411+
398412
/// PossiblyExactOperatorOptionalFlags - Flags for serializing
399413
/// PossiblyExactOperator's SubclassOptionalData contents.
400414
enum PossiblyExactOperatorOptionalFlags { PEO_EXACT = 0 };

include/llvm/IR/IntrinsicsX86.td

+9
Original file line numberDiff line numberDiff line change
@@ -3738,6 +3738,15 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
37383738
def int_x86_avx512_kxnor_w : // TODO: remove this intrinsic
37393739
Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty],
37403740
[IntrNoMem]>;
3741+
def int_x86_avx512_kunpck_bw : GCCBuiltin<"__builtin_ia32_kunpckhi">,
3742+
Intrinsic<[llvm_i16_ty], [llvm_i16_ty, llvm_i16_ty],
3743+
[IntrNoMem]>;
3744+
def int_x86_avx512_kunpck_wd : GCCBuiltin<"__builtin_ia32_kunpcksi">,
3745+
Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
3746+
[IntrNoMem]>;
3747+
def int_x86_avx512_kunpck_dq : GCCBuiltin<"__builtin_ia32_kunpckdi">,
3748+
Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty],
3749+
[IntrNoMem]>;
37413750
def int_x86_avx512_kortestz_w : GCCBuiltin<"__builtin_ia32_kortestzhi">,
37423751
Intrinsic<[llvm_i32_ty], [llvm_i16_ty, llvm_i16_ty],
37433752
[IntrNoMem]>;

include/llvm/MC/MCAsmMacro.h

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===//
2+
//
3+
// The LLVM Compiler Infrastructure
4+
//
5+
// This file is distributed under the University of Illinois Open Source
6+
// License. See LICENSE.TXT for details.
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_MC_MCASMMACRO_H
11+
#define LLVM_MC_MCASMMACRO_H
12+
13+
#include "llvm/MC/MCParser/MCAsmLexer.h"
14+
15+
namespace llvm {
16+
17+
struct MCAsmMacroParameter {
18+
StringRef Name;
19+
std::vector<AsmToken> Value;
20+
bool Required = false;
21+
bool Vararg = false;
22+
23+
MCAsmMacroParameter() = default;
24+
};
25+
26+
typedef std::vector<MCAsmMacroParameter> MCAsmMacroParameters;
27+
struct MCAsmMacro {
28+
StringRef Name;
29+
StringRef Body;
30+
MCAsmMacroParameters Parameters;
31+
32+
public:
33+
MCAsmMacro(StringRef N, StringRef B, MCAsmMacroParameters P)
34+
: Name(N), Body(B), Parameters(std::move(P)) {}
35+
};
36+
} // namespace llvm
37+
38+
#endif

include/llvm/MC/MCContext.h

+15
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "llvm/ADT/StringRef.h"
1919
#include "llvm/ADT/Twine.h"
2020
#include "llvm/BinaryFormat/Dwarf.h"
21+
#include "llvm/MC/MCAsmMacro.h"
2122
#include "llvm/MC/MCDwarf.h"
2223
#include "llvm/MC/MCSubtargetInfo.h"
2324
#include "llvm/MC/SectionKind.h"
@@ -268,6 +269,9 @@ namespace llvm {
268269
unsigned UniqueID,
269270
const MCSymbolELF *Associated);
270271

272+
/// \brief Map of currently defined macros.
273+
StringMap<MCAsmMacro> MacroMap;
274+
271275
public:
272276
explicit MCContext(const MCAsmInfo *MAI, const MCRegisterInfo *MRI,
273277
const MCObjectFileInfo *MOFI,
@@ -618,6 +622,17 @@ namespace llvm {
618622
// FIXME: We should really do something about that.
619623
LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L,
620624
const Twine &Msg);
625+
626+
const MCAsmMacro *lookupMacro(StringRef Name) {
627+
StringMap<MCAsmMacro>::iterator I = MacroMap.find(Name);
628+
return (I == MacroMap.end()) ? nullptr : &I->getValue();
629+
}
630+
631+
void defineMacro(StringRef Name, MCAsmMacro Macro) {
632+
MacroMap.insert(std::make_pair(Name, std::move(Macro)));
633+
}
634+
635+
void undefineMacro(StringRef Name) { MacroMap.erase(Name); }
621636
};
622637

623638
} // end namespace llvm

0 commit comments

Comments
 (0)