Skip to content

Commit 7430f17

Browse files
AutomergerAutomerger
Automerger
authored and
Automerger
committed
Propagating prior merge from 'llvm.org/master'.
apple-llvm-split-commit: b83a7fdac29ae7bd66a1477529de128fa638c2c7 apple-llvm-split-dir: llvm/
2 parents 4f2e0eb + 9ad917c commit 7430f17

23 files changed

+610
-491
lines changed

llvm/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if(POLICY CMP0077)
1616
endif()
1717

1818
if(NOT DEFINED LLVM_VERSION_MAJOR)
19-
set(LLVM_VERSION_MAJOR 9)
19+
set(LLVM_VERSION_MAJOR 10)
2020
endif()
2121
if(NOT DEFINED LLVM_VERSION_MINOR)
2222
set(LLVM_VERSION_MINOR 0)
@@ -642,8 +642,6 @@ option(LLVM_ENABLE_PLUGINS "Enable plugin support" ${LLVM_ENABLE_PLUGINS_default
642642

643643
include(HandleLLVMOptions)
644644

645-
# We support both Python 2 and 3.
646-
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 2.7)
647645
include(FindPythonInterp)
648646
if( NOT PYTHONINTERP_FOUND )
649647
message(FATAL_ERROR

llvm/docs/GettingStarted.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,11 @@ used by people developing LLVM.
598598
| CMAKE_INSTALL_PREFIX | Specifies the install directory to target when |
599599
| | running the install action of the build files. |
600600
+-------------------------+----------------------------------------------------+
601+
| PYTHON_EXECUTABLE | Forces CMake to use a specific Python version by |
602+
| | passing a path to a Python interpreter. By default |
603+
| | the Python version of the interpreter in your PATH |
604+
| | is used. |
605+
+-------------------------+----------------------------------------------------+
601606
| LLVM_TARGETS_TO_BUILD | A semicolon delimited list controlling which |
602607
| | targets will be built and linked into llvm. |
603608
| | The default list is defined as |

llvm/docs/ReleaseNotes.rst

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
========================
2-
LLVM 9.0.0 Release Notes
3-
========================
1+
=========================
2+
LLVM 10.0.0 Release Notes
3+
=========================
44

55
.. contents::
66
:local:
77

88
.. warning::
9-
These are in-progress notes for the upcoming LLVM 9 release.
9+
These are in-progress notes for the upcoming LLVM 10 release.
1010
Release notes for previous releases can be found on
1111
`the Download Page <https://releases.llvm.org/download.html>`_.
1212

@@ -15,7 +15,7 @@ Introduction
1515
============
1616

1717
This document contains the release notes for the LLVM Compiler Infrastructure,
18-
release 9.0.0. Here we describe the status of LLVM, including major improvements
18+
release 10.0.0. Here we describe the status of LLVM, including major improvements
1919
from the previous release, improvements in various subprojects of LLVM, and
2020
some of the current users of the code. All LLVM releases may be downloaded
2121
from the `LLVM releases web site <https://llvm.org/releases/>`_.
@@ -40,15 +40,6 @@ Non-comprehensive list of changes in this release
4040
functionality, or simply have a lot to talk about), see the `NOTE` below
4141
for adding a new subsection.
4242
43-
* The optimizer will now convert calls to ``memcmp`` into a calls to ``bcmp`` in
44-
some circumstances. Users who are building freestanding code (not depending on
45-
the platform's libc) without specifying ``-ffreestanding`` may need to either
46-
pass ``-fno-builtin-bcmp``, or provide a ``bcmp`` function.
47-
48-
* Two new extension points, namely ``EP_FullLinkTimeOptimizationEarly`` and
49-
``EP_FullLinkTimeOptimizationLast`` are available for plugins to specialize
50-
the legacy pass manager full LTO pipeline.
51-
5243
.. NOTE
5344
If you would like to document a larger change, then you can add a
5445
subsection about it right here. You can copy the following boilerplate
@@ -62,30 +53,9 @@ Non-comprehensive list of changes in this release
6253
Changes to the LLVM IR
6354
----------------------
6455

65-
* Added ``immarg`` parameter attribute. This indicates an intrinsic
66-
parameter is required to be a simple constant. This annotation must
67-
be accurate to avoid possible miscompiles.
68-
69-
* The 2-field form of global variables ``@llvm.global_ctors`` and
70-
``@llvm.global_dtors`` has been deleted. The third field of their element
71-
type is now mandatory. Specify `i8* null` to migrate from the obsoleted
72-
2-field form.
73-
74-
* The ``byval`` attribute can now take a type parameter:
75-
``byval(<ty>)``. If present it must be identical to the argument's
76-
pointee type. In the next release we intend to make this parameter
77-
mandatory in preparation for opaque pointer types.
78-
79-
* ``atomicrmw xchg`` now allows floating point types
80-
81-
* ``atomicrmw`` now supports ``fadd`` and ``fsub``
82-
8356
Changes to building LLVM
8457
------------------------
8558

86-
* Building LLVM with Visual Studio now requires version 2017 or later.
87-
88-
8959
Changes to the ARM Backend
9060
--------------------------
9161

@@ -111,14 +81,6 @@ Changes to the X86 Target
11181
Changes to the AMDGPU Target
11282
-----------------------------
11383

114-
* Function call support is now enabled by default
115-
116-
* Improved support for 96-bit loads and stores
117-
118-
* DPP combiner pass is now enabled by default
119-
120-
* Support for gfx10
121-
12284
Changes to the AVR Target
12385
-----------------------------
12486

@@ -145,16 +107,8 @@ Changes to the DAG infrastructure
145107
Changes to LLDB
146108
===============
147109

148-
* Backtraces are now color highlighting in the terminal.
149-
150-
* DWARF4 (debug_types) and DWARF5 (debug_info) type units are now supported.
151-
152-
* This release will be the last where ``lldb-mi`` is shipped as part of LLDB.
153-
The tool will still be available in a `downstream repository on GitHub
154-
<https://github.com/lldb-tools/lldb-mi>`_.
155-
156-
External Open Source Projects Using LLVM 9
157-
==========================================
110+
External Open Source Projects Using LLVM 10
111+
===========================================
158112

159113
* A project...
160114

llvm/docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
# built documents.
5252
#
5353
# The short version.
54-
version = '9'
54+
version = '10'
5555
# The full version, including alpha/beta/rc tags.
56-
release = '9'
56+
release = '10'
5757

5858
# The language for content autogenerated by Sphinx. Refer to documentation
5959
# for a list of supported languages.

llvm/include/llvm/Support/FileCheck.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,12 @@ class FileCheckNumericVariable {
115115
/// \returns this variable's value.
116116
Optional<uint64_t> getValue() const { return Value; }
117117

118-
/// Sets value of this numeric variable, if undefined. Triggers an assertion
119-
/// failure if the variable is actually defined.
120-
void setValue(uint64_t Value);
118+
/// Sets value of this numeric variable to \p NewValue.
119+
void setValue(uint64_t NewValue) { Value = NewValue; }
121120

122121
/// Clears value of this numeric variable, regardless of whether it is
123122
/// currently defined or not.
124-
void clearValue();
123+
void clearValue() { Value = None; }
125124

126125
/// \returns the line number where this variable is defined, if any, or None
127126
/// if defined before input is parsed.

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18002,6 +18002,23 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
1800218002
return SDValue();
1800318003
}
1800418004

18005+
// Helper that peeks through INSERT_SUBVECTOR/CONCAT_VECTORS to find
18006+
// if the subvector can be sourced for free.
18007+
static SDValue getSubVectorSrc(SDValue V, SDValue Index, EVT SubVT) {
18008+
if (V.getOpcode() == ISD::INSERT_SUBVECTOR &&
18009+
V.getOperand(1).getValueType() == SubVT && V.getOperand(2) == Index) {
18010+
return V.getOperand(1);
18011+
}
18012+
auto *IndexC = dyn_cast<ConstantSDNode>(Index);
18013+
if (IndexC && V.getOpcode() == ISD::CONCAT_VECTORS &&
18014+
V.getOperand(0).getValueType() == SubVT &&
18015+
(IndexC->getZExtValue() % SubVT.getVectorNumElements()) == 0) {
18016+
uint64_t SubIdx = IndexC->getZExtValue() / SubVT.getVectorNumElements();
18017+
return V.getOperand(SubIdx);
18018+
}
18019+
return SDValue();
18020+
}
18021+
1800518022
static SDValue narrowInsertExtractVectorBinOp(SDNode *Extract,
1800618023
SelectionDAG &DAG) {
1800718024
const TargetLowering &TLI = DAG.getTargetLoweringInfo();
@@ -18012,37 +18029,20 @@ static SDValue narrowInsertExtractVectorBinOp(SDNode *Extract,
1801218029

1801318030
SDValue Bop0 = BinOp.getOperand(0), Bop1 = BinOp.getOperand(1);
1801418031
SDValue Index = Extract->getOperand(1);
18015-
EVT VT = Extract->getValueType(0);
18016-
18017-
// Helper that peeks through INSERT_SUBVECTOR/CONCAT_VECTORS to find
18018-
// if the source subvector is the same type as the one being extracted.
18019-
auto GetSubVector = [VT, Index](SDValue V) -> SDValue {
18020-
if (V.getOpcode() == ISD::INSERT_SUBVECTOR &&
18021-
V.getOperand(1).getValueType() == VT && V.getOperand(2) == Index) {
18022-
return V.getOperand(1);
18023-
}
18024-
auto *IndexC = dyn_cast<ConstantSDNode>(Index);
18025-
if (IndexC && V.getOpcode() == ISD::CONCAT_VECTORS &&
18026-
V.getOperand(0).getValueType() == VT &&
18027-
(IndexC->getZExtValue() % VT.getVectorNumElements()) == 0) {
18028-
uint64_t SubIdx = IndexC->getZExtValue() / VT.getVectorNumElements();
18029-
return V.getOperand(SubIdx);
18030-
}
18031-
return SDValue();
18032-
};
18033-
SDValue Sub0 = GetSubVector(Bop0);
18034-
SDValue Sub1 = GetSubVector(Bop1);
18032+
EVT SubVT = Extract->getValueType(0);
18033+
SDValue Sub0 = getSubVectorSrc(Bop0, Index, SubVT);
18034+
SDValue Sub1 = getSubVectorSrc(Bop1, Index, SubVT);
1803518035

1803618036
// TODO: We could handle the case where only 1 operand is being inserted by
1803718037
// creating an extract of the other operand, but that requires checking
1803818038
// number of uses and/or costs.
18039-
if (!Sub0 || !Sub1 || !TLI.isOperationLegalOrCustom(BinOpcode, VT))
18039+
if (!Sub0 || !Sub1 || !TLI.isOperationLegalOrCustom(BinOpcode, SubVT))
1804018040
return SDValue();
1804118041

1804218042
// We are inserting both operands of the wide binop only to extract back
1804318043
// to the narrow vector size. Eliminate all of the insert/extract:
1804418044
// ext (binop (ins ?, X, Index), (ins ?, Y, Index)), Index --> binop X, Y
18045-
return DAG.getNode(BinOpcode, SDLoc(Extract), VT, Sub0, Sub1,
18045+
return DAG.getNode(BinOpcode, SDLoc(Extract), SubVT, Sub0, Sub1,
1804618046
BinOp->getFlags());
1804718047
}
1804818048

llvm/lib/Support/FileCheck.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@
2424

2525
using namespace llvm;
2626

27-
void FileCheckNumericVariable::setValue(uint64_t NewValue) {
28-
assert(!Value && "Overwriting numeric variable's value is not allowed");
29-
Value = NewValue;
30-
}
31-
32-
void FileCheckNumericVariable::clearValue() {
33-
if (!Value)
34-
return;
35-
Value = None;
36-
}
37-
3827
Expected<uint64_t> FileCheckNumericVariableUse::eval() const {
3928
Optional<uint64_t> Value = NumericVariable->getValue();
4029
if (Value)
@@ -631,10 +620,8 @@ Expected<size_t> FileCheckPattern::match(StringRef Buffer, size_t &MatchLen,
631620
for (const auto &Substitution : Substitutions) {
632621
// Substitute and check for failure (e.g. use of undefined variable).
633622
Expected<std::string> Value = Substitution->getResult();
634-
if (!Value) {
635-
Context->LineVariable->clearValue();
623+
if (!Value)
636624
return Value.takeError();
637-
}
638625

639626
// Plop it into the regex at the adjusted offset.
640627
TmpStr.insert(TmpStr.begin() + Substitution->getIndex() + InsertOffset,
@@ -644,7 +631,6 @@ Expected<size_t> FileCheckPattern::match(StringRef Buffer, size_t &MatchLen,
644631

645632
// Match the newly constructed regex.
646633
RegExToMatch = TmpStr;
647-
Context->LineVariable->clearValue();
648634
}
649635

650636
SmallVector<StringRef, 4> MatchInfo;

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11748,9 +11748,11 @@ static SDValue PerformVMOVRRDCombine(SDNode *N,
1174811748

1174911749
SDValue OffsetPtr = DAG.getNode(ISD::ADD, DL, MVT::i32, BasePtr,
1175011750
DAG.getConstant(4, DL, MVT::i32));
11751-
SDValue NewLD2 = DAG.getLoad(
11752-
MVT::i32, DL, NewLD1.getValue(1), OffsetPtr, LD->getPointerInfo(),
11753-
std::min(4U, LD->getAlignment() / 2), LD->getMemOperand()->getFlags());
11751+
11752+
SDValue NewLD2 = DAG.getLoad(MVT::i32, DL, LD->getChain(), OffsetPtr,
11753+
LD->getPointerInfo().getWithOffset(4),
11754+
std::min(4U, LD->getAlignment()),
11755+
LD->getMemOperand()->getFlags());
1175411756

1175511757
DAG.ReplaceAllUsesOfValueWith(SDValue(LD, 1), NewLD2.getValue(1));
1175611758
if (DCI.DAG.getDataLayout().isBigEndian())

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,6 +2464,37 @@ bool X86DAGToDAGISel::selectLEAAddr(SDValue N,
24642464
Complexity += 2;
24652465
}
24662466

2467+
// Heuristic: try harder to form an LEA from ADD if the operands set flags.
2468+
// Unlike ADD, LEA does not affect flags, so we will be less likely to require
2469+
// duplicating flag-producing instructions later in the pipeline.
2470+
if (N.getOpcode() == ISD::ADD) {
2471+
auto isMathWithFlags = [](SDValue V) {
2472+
switch (V.getOpcode()) {
2473+
case X86ISD::ADD:
2474+
case X86ISD::SUB:
2475+
case X86ISD::ADC:
2476+
case X86ISD::SBB:
2477+
/* TODO: These opcodes can be added safely, but we may want to justify
2478+
their inclusion for different reasons (better for reg-alloc).
2479+
case X86ISD::SMUL:
2480+
case X86ISD::UMUL:
2481+
case X86ISD::OR:
2482+
case X86ISD::XOR:
2483+
case X86ISD::AND:
2484+
*/
2485+
// Value 1 is the flag output of the node - verify it's not dead.
2486+
return !SDValue(V.getNode(), 1).use_empty();
2487+
default:
2488+
return false;
2489+
}
2490+
};
2491+
// TODO: This could be an 'or' rather than 'and' to make the transform more
2492+
// likely to happen. We might want to factor in whether there's a
2493+
// load folding opportunity for the math op that disappears with LEA.
2494+
if (isMathWithFlags(N.getOperand(0)) && isMathWithFlags(N.getOperand(1)))
2495+
Complexity++;
2496+
}
2497+
24672498
if (AM.Disp)
24682499
Complexity++;
24692500

0 commit comments

Comments
 (0)