OSDN Git Service
Sanjay Patel [Thu, 8 Dec 2016 23:44:58 +0000 (23:44 +0000)]
[InstCombine] add tests for umin+icmp; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289157
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 8 Dec 2016 23:36:57 +0000 (23:36 +0000)]
[InstCombine] add tests for umax+icmp; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289156
91177308-0d34-0410-b5e6-
96231b3b80d8
Zia Ansari [Thu, 8 Dec 2016 23:27:40 +0000 (23:27 +0000)]
[InstSimplify] Add "X / 1.0" to SimplifyFDivInst.
Differential Revision: https://reviews.llvm.org/D27587
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289153
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 8 Dec 2016 23:16:06 +0000 (23:16 +0000)]
[InstCombine] add tests for smax+icmp; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289151
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 8 Dec 2016 22:44:13 +0000 (22:44 +0000)]
GlobalISel: fall back gracefully for debug intrinsics.
Supporting them properly is a reasonably complex chunk of work, so to allow bot
testing before then we should at least be able to fall back to DAG ISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289150
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 8 Dec 2016 22:44:00 +0000 (22:44 +0000)]
GlobalISel: factor overflow handling into separate function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289149
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Thu, 8 Dec 2016 22:28:53 +0000 (22:28 +0000)]
[SCCP] Make sure SCCP and ConstantFolding agree on undef >> a.
Currently SCCP folds the value to -1, while ConstantProp folds to
0. This changes SCCP to do what ConstantFolding does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289147
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Thu, 8 Dec 2016 22:10:52 +0000 (22:10 +0000)]
[mips] Make the test case more specific and provide OS component of a triple. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289117
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Thu, 8 Dec 2016 22:10:48 +0000 (22:10 +0000)]
[mips] Change instruction s/daddiu/addiu/ since O32 prohibits the use of 64-bit GPRs. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289115
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Thu, 8 Dec 2016 22:10:44 +0000 (22:10 +0000)]
[mips] Change gnueabi to gnu in the triple because EABI has been removed recently. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289114
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Thu, 8 Dec 2016 22:10:38 +0000 (22:10 +0000)]
[mips] Remove N32 Android test because Android does not support N32 ABI. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289113
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 8 Dec 2016 20:38:46 +0000 (20:38 +0000)]
Don't emit .seh_handler directives for any cleanup funclets
We were falsely claiming that we had an LSDA for the relevant EH
personality before this change, which could lead to the EH machinery
interpreting random adjacent data as an LSDA.
Fixes PR31317
This change is safe because cleanups can't contain exception handlers
today. We do these things to maintain that invariant:
- C++ destructors are naturally out-of-line
- __finally blocks are outlined in clang
- LLVM's inliner will not inline EH constructs into cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289101
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 8 Dec 2016 20:33:45 +0000 (20:33 +0000)]
[RDF] Fix incorrect lane mask calculation
This was exposed by some code that used more than one level of sub-
registers. There is no testcase, because there is no such code in the
Hexagon backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289099
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 8 Dec 2016 20:23:56 +0000 (20:23 +0000)]
[InstSimplify] add fdiv x/1.0 test and update checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289098
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 8 Dec 2016 20:14:46 +0000 (20:14 +0000)]
AMDGPU: Make f16 ConstantFP legal
Not having this legal led to combine failures, resulting
in dumb things like bitcasts of constants not being folded
away.
The only reason I'm leaving the v_mov_b32 hack that f32
already uses is to avoid madak formation test regressions.
PeepholeOptimizer has an ordering issue where the immediate
fold attempt is into the sgpr->vgpr copy instead of the actual
use. Running it twice avoids that problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289096
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Thu, 8 Dec 2016 20:07:23 +0000 (20:07 +0000)]
[AMDGPU] Fix number of reserved SGPRs on CI to reflect flat scratch use
Differential Revision: https://reviews.llvm.org/D27225
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289095
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 8 Dec 2016 19:52:38 +0000 (19:52 +0000)]
AMDGPU: Fix commuting v_sub_u16
The correct commutable opcode was set to itself, so this
was simply swapping the operands to commute instead of also
changing the opcode to v_subrev_u16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289093
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Thu, 8 Dec 2016 19:46:04 +0000 (19:46 +0000)]
[AMDGPU] Add amdgpu-unify-metadata pass
Multiple metadata values for records such as opencl.ocl.version, llvm.ident
and similar are created after linking several modules. For some of them, notably
opencl.ocl.version, this creates semantic problem because we cannot tell which
version of OpenCL the composite module conforms.
Moreover, such repetitions of identical values often create a huge list of
unneeded metadata, which grows bitcode size both in memory and stored on disk.
It can go up to several Mb when linked against our OpenCL library. Lastly, such
long lists obscure reading of dumped IR.
The pass unifies metadata after linking.
Differential Revision: https://reviews.llvm.org/D25381
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289092
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 8 Dec 2016 19:01:00 +0000 (19:01 +0000)]
IR, X86: Understand !absolute_symbol metadata on global variables.
Summary:
Attaching !absolute_symbol to a global variable does two things:
1) Marks it as an absolute symbol reference.
2) Specifies the value range of that symbol's address.
Teach the X86 backend to allow absolute symbols to appear in place of
immediates by extending the relocImm and mov64imm32 matchers. Start using
relocImm in more places where it is legal.
As previously proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html
Differential Revision: https://reviews.llvm.org/D25878
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289087
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 8 Dec 2016 17:46:57 +0000 (17:46 +0000)]
[ObjectYAML] Remove DWARF from class names
Since all the DWARF classes are in a DWARFYAML namespace having every class start with DWARF seems like a bit of overkill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289080
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Timofeev [Thu, 8 Dec 2016 17:28:47 +0000 (17:28 +0000)]
[AMDGPU] Scalarization of global uniform loads.
Summary:
LC can currently select scalar load for uniform memory access
basing on readonly memory address space only. This restriction
originated from the fact that in HW prior to VI vector and scalar caches
are not coherent. With MemoryDependenceAnalysis we can check that the
memory location corresponding to the memory operand of the LOAD is not
clobbered along the all paths from the function entry.
Reviewers: rampitec, tstellarAMD, arsenm
Subscribers: wdng, arsenm, nhaehnle
Differential Revision: https://reviews.llvm.org/D26917
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289076
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Thu, 8 Dec 2016 17:22:35 +0000 (17:22 +0000)]
ConstantFolding: Don't crash when encountering vector GEP
ConstantFolding tried to cast one of the scalar indices to a vector
type. Instead, use the vector type only for the first index (which
is the only one allowed to be a vector) and use its scalar type
otherwise.
Fixes PR31250.
Reviewers: majnemer
Differential Revision: https://reviews.llvm.org/D27389
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289073
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 8 Dec 2016 16:57:04 +0000 (16:57 +0000)]
Fix ASAN buildbots by fixing a double free crash.
The dwarfgen::Generator::StringPool was in a unique_ptr but it was owned by the Allocator member variable so it was being free twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289070
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 8 Dec 2016 15:28:02 +0000 (15:28 +0000)]
Prune unused libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289060
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 8 Dec 2016 15:00:12 +0000 (15:00 +0000)]
Prune unused \param(s) in r289050. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289057
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 8 Dec 2016 15:00:07 +0000 (15:00 +0000)]
DIE::addAttribute(): Prune a redundant \param. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289056
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 8 Dec 2016 14:26:30 +0000 (14:26 +0000)]
LanaiInstPrinter: Prune unused libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289054
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 8 Dec 2016 14:26:23 +0000 (14:26 +0000)]
DebugInfoDWARFTests: Prune unused libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289053
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 8 Dec 2016 14:11:02 +0000 (14:11 +0000)]
DebugInfoDWARFTests: Add missing deps, AsmPrinter and Object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289052
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 8 Dec 2016 14:10:57 +0000 (14:10 +0000)]
DebugInfoDWARFTests: Reorder LLVM_LINK_COMPONENTS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289051
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 8 Dec 2016 14:08:14 +0000 (14:08 +0000)]
[SelectionDAG] Add expansion and promotion of [US]MUL_LOHI
Summary:
Most targets set the action for these nodes to Expand even though there
isn't actually any code for them in ExpandNode. Instead, targets simply
relied on the fact that no code generates these nodes as long as the
nodes aren't legal or custom.
However, generating these nodes can be useful e.g. for divide-by-constant
in wider integer types.
Expand of [US]MUL_LOHI will use MULH[US] when legal or custom, and
a sequence of half-width multiplications otherwise. Promote uses a wider
multiply.
This patch intends to not change the generated code, but indirect effects
are possible since expansions/promotions that were previously done in
DAGCombine may now be done in LegalizeDAG.
See D24822 for a change that actually uses the new expansion.
Reviewers: spatel, bkramer, venkatra, efriedma, hfinkel, ast, nadav, tstellarAMD
Subscribers: arsenm, jyknight, nemanjai, wdng, nhaehnle, llvm-commits
Differential Revision: https://reviews.llvm.org/D24956
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289050
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 8 Dec 2016 14:08:08 +0000 (14:08 +0000)]
X86: Add checks for fma_patterns[_wide].ll with -enable-no-infs-fp-math
This re-adds checks for the patterns that were disabled with r288506.
Reviewers: spatel, delena, craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27346
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289049
91177308-0d34-0410-b5e6-
96231b3b80d8
Nicolai Haehnle [Thu, 8 Dec 2016 14:08:02 +0000 (14:08 +0000)]
AMDGPU: Properly implement SIRegisterInfo::isFrameOffsetLegal and needsFrameBaseReg
Summary:
Without the fix to isFrameOffsetLegal to consider the instruction's
immediate offset, the new test case hits the corresponding assertion in
resolveFrameIndex, because the LocalStackSlotAllocation pass re-uses a
different base register.
With only the fix to isFrameOffsetLegal, code quality reduces in a bunch of
places because frame base registers are added where they're not needed.
This is addressed by properly implementing needsFrameBaseReg, which also
helps to avoid unnecessary zero frame indices in a bunch of other places.
Fixes piglit glsl-1.50/execution/variable-indexing/gs-output-array-vec4-index-wr.shader_test
Reviewers: arsenm, tstellarAMD
Subscribers: qcolombet, kzhuravl, wdng, yaxunl, tony-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D27344
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289048
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 8 Dec 2016 12:45:29 +0000 (12:45 +0000)]
Move DwarfGenerator.cpp to unittests
So far it creates a test helper and so it should be moved there. It also
create a layering cycle between CodeGen and CodeGen/AsmPrinter, which
should be avoided.
Review: https://reviews.llvm.org/D27570
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289044
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 8 Dec 2016 11:57:51 +0000 (11:57 +0000)]
[SLP] Fix for PR6246: vectorization for scalar ops on vector elements.
When trying to vectorize trees that start at insertelement instructions
function tryToVectorizeList() uses vectorization factor calculated as
MinVecRegSize/ScalarTypeSize. But sometimes it does not work as tree
cost for this fixed vectorization factor is too high.
Patch tries to improve the situation. It tries different vectorization
factors from max(PowerOf2Floor(NumberOfVectorizedValues),
MinVecRegSize/ScalarTypeSize) to MinVecRegSize/ScalarTypeSize and tries
to choose the best one.
Differential Revision: https://reviews.llvm.org/D27215
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289043
91177308-0d34-0410-b5e6-
96231b3b80d8
Pavel Labath [Thu, 8 Dec 2016 11:45:38 +0000 (11:45 +0000)]
Fix MSCV compilation broken by r289040
I wanted to use the "not" keyword to make sure it does not get lost in between
other checks. MSVC does not like that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289041
91177308-0d34-0410-b5e6-
96231b3b80d8
Pavel Labath [Thu, 8 Dec 2016 11:31:19 +0000 (11:31 +0000)]
Improve format member detection in llvm::formatv
Summary:
The existing detection of a format member function has a couple of deficiencies:
- the member function does not get detected if one calls formatv with an lvalue,
because the template parameter gets deduced as T&, which fails the is_class
check.
- it also did not work if the function was called with a const variable because
the template parameter would get deduced as const T&, again failing the
is_class check.
This fixes the problem by stripping the references in the uses_format_member
template, to make sure the type is correctly detected as class. It also provides
specializations of the has_FormatMember template for const and non-const members
of the types in order to enable declaring the format member as a "const"
function. I have added tests that verify that formatv can be now called in these
scenarios. As some scenarios could not be verified at runtime (e.g. making sure
that calling a non-const format member on a const object does *not* compile), I
have also added some static_asserts which test the behaviour of the template
classes used internally by formatv().
Reviewers: zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27525
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289040
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Thu, 8 Dec 2016 10:52:13 +0000 (10:52 +0000)]
[AVR] Add MIR tests for pseudo instruction expansions
This adds tests for 13 pseudo instruction expansions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289039
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 8 Dec 2016 10:41:41 +0000 (10:41 +0000)]
Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289038
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 8 Dec 2016 10:31:32 +0000 (10:31 +0000)]
Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289037
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Thu, 8 Dec 2016 10:31:21 +0000 (10:31 +0000)]
Add a comment consumer mechanism to MCAsmLexer
This allows clients to register an AsmCommentConsumer with the MCAsmLexer,
which receives a callback each time a comment is parsed.
Differential Revision: https://reviews.llvm.org/D27511
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289036
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 8 Dec 2016 10:17:25 +0000 (10:17 +0000)]
[X86][SSE] Add vector test for (shl (or x, c1), c2) -> (or (shl x, c2), c1 << c2) detailed in D19325
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289035
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Thu, 8 Dec 2016 08:54:41 +0000 (08:54 +0000)]
[AVR] Add MIR tests for a few pseudo instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289031
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Thu, 8 Dec 2016 08:34:13 +0000 (08:34 +0000)]
[AVR] Add an assertion to ensure we don't emit LPM when it's unsupported
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289030
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 8 Dec 2016 05:28:30 +0000 (05:28 +0000)]
LTO: Hash the parts of the LTO configuration that affect code generation.
Most importantly, we need to hash the relocation model, otherwise we can
end up trying to link non-PIC object files into PIEs or DSOs.
Differential Revision: https://reviews.llvm.org/D27556
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289024
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 8 Dec 2016 02:11:03 +0000 (02:11 +0000)]
Unbreak buildbots where the debug info test was crashing due to unchecked error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289017
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Thu, 8 Dec 2016 01:56:23 +0000 (01:56 +0000)]
Revert "[CodeGen] Fix invalid DWARF info on Win64"
Appears to break on build bots. Reverting pending investigation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289014
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Thu, 8 Dec 2016 01:40:21 +0000 (01:40 +0000)]
[CodeGen] Fix invalid DWARF info on Win64
The relocations for `DIEEntry::EmitValue` were wrong for Win64
(emitting FK_Data_4 instead of FK_SecRel_4). This corrects that
oversight so that the DWARF data is correct in Win64 COFF files.
Fixes PR15393.
Patch by Jameson Nash <jameson@juliacomputing.com> based on a patch
by David Majnemer.
Differential Revision: https://reviews.llvm.org/D21731
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289013
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Thu, 8 Dec 2016 01:03:48 +0000 (01:03 +0000)]
Make a DWARF generator so we can unit test DWARF APIs with gtest.
The only tests we have for the DWARF parser are the tests that use llvm-dwarfdump and expect output from textual dumps.
More DWARF parser modification are coming in the next few weeks and I wanted to add tests that can verify that we can encode and decode all form types, as well as test some other basic DWARF APIs where we ask DIE objects for their children and siblings.
DwarfGenerator.cpp was added in the lib/CodeGen directory. This file contains the code necessary to easily create DWARF for tests:
dwarfgen::Generator DG;
Triple Triple("x86_64--");
bool success = DG.init(Triple, Version);
if (!success)
return;
dwarfgen::CompileUnit &CU = DG.addCompileUnit();
dwarfgen::DIE CUDie = CU.getUnitDIE();
CUDie.addAttribute(DW_AT_name, DW_FORM_strp, "/tmp/main.c");
CUDie.addAttribute(DW_AT_language, DW_FORM_data2, DW_LANG_C);
dwarfgen::DIE SubprogramDie = CUDie.addChild(DW_TAG_subprogram);
SubprogramDie.addAttribute(DW_AT_name, DW_FORM_strp, "main");
SubprogramDie.addAttribute(DW_AT_low_pc, DW_FORM_addr, 0x1000U);
SubprogramDie.addAttribute(DW_AT_high_pc, DW_FORM_addr, 0x2000U);
dwarfgen::DIE IntDie = CUDie.addChild(DW_TAG_base_type);
IntDie.addAttribute(DW_AT_name, DW_FORM_strp, "int");
IntDie.addAttribute(DW_AT_encoding, DW_FORM_data1, DW_ATE_signed);
IntDie.addAttribute(DW_AT_byte_size, DW_FORM_data1, 4);
dwarfgen::DIE ArgcDie = SubprogramDie.addChild(DW_TAG_formal_parameter);
ArgcDie.addAttribute(DW_AT_name, DW_FORM_strp, "argc");
// ArgcDie.addAttribute(DW_AT_type, DW_FORM_ref4, IntDie);
ArgcDie.addAttribute(DW_AT_type, DW_FORM_ref_addr, IntDie);
StringRef FileBytes = DG.generate();
MemoryBufferRef FileBuffer(FileBytes, "dwarf");
auto Obj = object::ObjectFile::createObjectFile(FileBuffer);
EXPECT_TRUE((bool)Obj);
DWARFContextInMemory DwarfContext(*Obj.get());
This code is backed by the AsmPrinter code that emits DWARF for the actual compiler.
While adding unit tests it was discovered that DIEValue that used DIEEntry as their values had bugs where DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref8, and DW_FORM_ref_udata forms were not supported. These are all now supported. Added support for DW_FORM_string so we can emit inlined C strings.
Centralized the code to unique abbreviations into a new DIEAbbrevSet class and made both the dwarfgen::Generator and the llvm::DwarfFile classes use the new class.
Fixed comments in the llvm::DIE class so that the Offset is known to be the compile/type unit offset.
DIEInteger now supports more DW_FORM values.
There are also unit tests that cover:
Encoding and decoding all form types and values
Encoding and decoding all reference types (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata, DW_FORM_ref_addr) including cross compile unit references with that go forward one compile unit and backward on compile unit.
Differential Revision: https://reviews.llvm.org/D27326
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289010
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Thu, 8 Dec 2016 00:32:26 +0000 (00:32 +0000)]
CFI-icall on Thumb
Replace @progbits in the section directive with %progbits, because "@" starts a comment on arm/thumb.
Use b.w branch instruction.
Use .thumb_function and .thumb_set for proper arm/thumb interwork. This way jumptable entry addresses on thumb have bit 0 set (correctly). This does not affect CFI check math, because the address of the jumptable start also has that bit set.
This does not work on thumbv5, because it does not support b.w, and the linker would not insert a veneer (trampoline?) to extend the range of b.n. We may need to do full-range plt-style jumptables on thumbv54, which are 12 bytes per entry. Another option is "push lr; bl; pop pc" (4 bytes) but that needs unwinding instructions, etc.
Differential Revision: https://reviews.llvm.org/D27499
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289008
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 8 Dec 2016 00:27:37 +0000 (00:27 +0000)]
LTO: Remove the unused Config::Features field.
We are currently initializing Features via MAttrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289007
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 8 Dec 2016 00:16:42 +0000 (00:16 +0000)]
The few days mentioned in r267095 are over
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289004
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 8 Dec 2016 00:16:08 +0000 (00:16 +0000)]
TargetPassConfig: Rename DisablePostRA -> DisablePostRASched; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289003
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 8 Dec 2016 00:15:51 +0000 (00:15 +0000)]
LivePhysReg: Use reference instead of pointer in init(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289002
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 8 Dec 2016 00:06:51 +0000 (00:06 +0000)]
[InlineSpiller] Don't call TargetInstrInfo::foldMemoryOperand with an empty list.
Since r287792 if we try to do that we will hit an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289001
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Wed, 7 Dec 2016 22:37:11 +0000 (22:37 +0000)]
[asan] Split load and store checks in test. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288991
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 22:30:15 +0000 (22:30 +0000)]
[yaml2obj] Refactor and abstract yaml2dwarf functions
This abstracts the code for emitting DWARF binary from the DWARFYAML types into reusable interfaces that could be used by ELF and COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288990
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Wed, 7 Dec 2016 22:06:02 +0000 (22:06 +0000)]
[ADT, IR] Fix some Clang-tidy modernize-use-equals-delete and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288989
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 7 Dec 2016 21:47:32 +0000 (21:47 +0000)]
[BDCE] Skip metadata while replacing uses.
The fix committed in r288851 doesn't cover all the cases.
In particular, if we have an instruction with side effects
which has a no non-dbg use not depending on the bits, we still
perform RAUW destroying the dbg.value's first argument.
Prevent metadata from being replaced here to avoid the issue.
Differential Revision: https://reviews.llvm.org/D27534
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288987
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 21:47:28 +0000 (21:47 +0000)]
[obj2yaml] Refactor and abstract dwarf2yaml
This makes the dwarf2yaml code separated and reusable allowing ELF and COFF to share implementations with MachO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288986
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 7 Dec 2016 21:29:15 +0000 (21:29 +0000)]
GlobalISel: use correct builder for ConstantExprs.
ConstantExpr instances were emitting code into the current block rather than
the entry block. This meant they didn't necessarily dominate all uses, which is
clearly wrong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288985
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 21:26:32 +0000 (21:26 +0000)]
[ObjectYAML] Pull DWARF support into DWARFYAML namespace
Since DWARF formatting is agnostic to the object file it is stored in, it doesn't make sense for this to be in the MachOYAML implementation. Pulling it into its own namespace means we could modify the ELF and COFF YAML tools to emit DWARF as well.
In a follow-up patch I will better abstract this in obj2yaml and yaml2obj so that the DWARF bits in the tools can be re-used too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288984
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 7 Dec 2016 21:17:47 +0000 (21:17 +0000)]
GlobalISel: store the current MachineFunction as direct state. NFC.
Having to ask the MIRBuilder for the current function is a little awkward, and
I'm intending to improve how that's threaded through anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288983
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 21:09:37 +0000 (21:09 +0000)]
[ObjectYAML] Rename DWARF entries to match section names
This change makes the yaml tags for the members of the DWARF data match the names of the DWARF sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288981
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 7 Dec 2016 21:05:38 +0000 (21:05 +0000)]
GlobalISel: simplify MachineIRBuilder interface.
MachineIRBuilder had weird before/after and beginning/end flags for the insert
point. Unfortunately the non-default means that instructions will be inserted
in reverse order which is almost never what anyone wants.
Really, I think we just want (like IRBuilder has) the ability to insert at any
C++ iterator-style point (i.e. before any instruction or before MBB.end()). So
this fixes MIRBuilders to behave like IRBuilders in this respect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288980
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 7 Dec 2016 21:02:48 +0000 (21:02 +0000)]
[libFuzzer] include FuzzerIO.h and hopefully fix the Mac build. reported by Dejan Mircevski
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288979
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 7 Dec 2016 20:56:11 +0000 (20:56 +0000)]
InstCombine: Fold bitcast of vector to FP scalar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288978
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 20:55:38 +0000 (20:55 +0000)]
[CMake] Add check for HAVE_CRASHREPORTER_INFO
This was also explicitly undef in CMake for some unknown reason.
Hopefully this one won't kill all the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288977
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 7 Dec 2016 19:55:59 +0000 (19:55 +0000)]
[GVNHoist] Invalidate MemDep when an instruction is moved.
See also r279907.
Fixes https://llvm.org/bugs/show_bug.cgi?id=30991 .
Differential Revision: https://reviews.llvm.org/D27493
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288968
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 7 Dec 2016 19:31:08 +0000 (19:31 +0000)]
[X86] Skip over DEBUG_VALUE while looking for start of call sequence
If we don't skip over DEBUG_VALUEs, we get differences between -g and non-g
code.
This fixes PR31242.
Differential Revision: https://reviews.llvm.org/D27485
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288965
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Wed, 7 Dec 2016 19:29:18 +0000 (19:29 +0000)]
[X86] Do not assume "ri" instructions always have an immediate operand
The second operand of an "ri" instruction may be an immediate, but it may
also be a globalvariable, so we should make any assumptions.
This fixes PR31271.
Differential Revision: https://reviews.llvm.org/D27481
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288964
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 19:28:22 +0000 (19:28 +0000)]
Fix the apple build issue caused by r288956
Should be checking if HAVE_CRASHREPORTERCLIENT_H is defined not relying on it having a value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288963
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 19:25:38 +0000 (19:25 +0000)]
Revert "[CMake] Use cmakedefine01 instead of cmakedefine"
This reverts commit r288959.
Apparently using cmakedefine01 explodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288961
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 19:13:32 +0000 (19:13 +0000)]
[CMake] Use cmakedefine01 instead of cmakedefine
Looks like we need a 01 value for HAVE_CRASHREPORTERCLIENT_H.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288959
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 7 Dec 2016 18:56:55 +0000 (18:56 +0000)]
[InstCombine] add tests for smin+icmp; NFC
The tests that already work are folded in InstSimplify, so those
tests should be redundant and we can remove them if they don't
seem worthwhile for completeness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288957
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 18:53:04 +0000 (18:53 +0000)]
[CMake] Add a check for HAVE_CRASHREPORTERCLIENT_H
The CMake build has been hardcoding this to undef forever, we shouldn't have been doing that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288956
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 7 Dec 2016 18:52:59 +0000 (18:52 +0000)]
[ObjectYAML] Support for DWARF __debug_abbrev section
This patch adds support for round-tripping DWARF debug abbreviations through the obj<->yaml tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288955
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 17:54:00 +0000 (17:54 +0000)]
[SelectionDAG] Add knownbits support for vector demandedelts in SMAX/SMIN/UMAX/UMIN opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288926
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 17:21:13 +0000 (17:21 +0000)]
[X86] Add knownbits vector UMAX test
In preparation for demandedelts support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288920
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 17:02:41 +0000 (17:02 +0000)]
[X86][SSE] Remove AND -> VZEXT combine
This is now performed more generally by the target shuffle combine code.
Already covered by tests that were originally added in D7666/rL229480 to support combineVectorZext (or VectorZextCombine as it was known then....).
Differential Revision: https://reviews.llvm.org/D27510
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288918
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 16:28:21 +0000 (16:28 +0000)]
[SelectionDAG] Add knownbits support for EXTRACT_VECTOR_ELT opcodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288916
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 15:31:12 +0000 (15:31 +0000)]
[SelectionDAG] Removed old knownbits TODO comment. NFCI.
EXTRACT_VECTOR_ELT does support demanded elts if the element index is known and in range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288913
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 15:27:18 +0000 (15:27 +0000)]
[X86] Add test to show missed opportunities to calculate knownbits in INSERT_VECTOR_ELT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288912
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 15:10:05 +0000 (15:10 +0000)]
[X86][SSE] Fix vpextrd/vpextrq checks
They were testing for the pre-vex versions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288911
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 15:06:14 +0000 (15:06 +0000)]
[X86][SSE] Force execution domain of 32-bit extractps/pextrd in the stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288910
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Wed, 7 Dec 2016 15:03:32 +0000 (15:03 +0000)]
[LV] Scalarize operands of predicated instructions
This patch attempts to scalarize the operand expressions of predicated
instructions if they were conditionally executed in the original loop. After
scalarization, the expressions will be sunk inside the blocks created for the
predicated instructions. The transformation essentially performs
un-if-conversion on the operands.
The cost model has been updated to determine if scalarization is profitable. It
compares the cost of a vectorized instruction, assuming it will be
if-converted, to the cost of the scalarized instruction, assuming that the
instructions corresponding to each vector lane will be sunk inside a predicated
block, possibly avoiding execution. If it's more profitable to scalarize the
entire expression tree feeding the predicated instruction, the expression will
be scalarized; otherwise, it will be vectorized. We only consider the cost of
the entire expression to accurately estimate the cost of the required
insertelement and extractelement instructions.
Differential Revision: https://reviews.llvm.org/D26083
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288909
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 7 Dec 2016 13:35:11 +0000 (13:35 +0000)]
Try unbreaking the MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288907
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 13:05:04 +0000 (13:05 +0000)]
[X86][SSE] Regenerate test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288906
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Wed, 7 Dec 2016 12:34:47 +0000 (12:34 +0000)]
[AVR] Expand 'SELECT_CC' nodes whereever possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288905
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 7 Dec 2016 12:31:45 +0000 (12:31 +0000)]
[LowerTypeTests] Use the TrailingObjects infrastructure for trailing objects.
Also avoid allocating ~3x as much memory as needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288904
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Wed, 7 Dec 2016 12:31:36 +0000 (12:31 +0000)]
When GVN removes a redundant load, it should not modify the debug location of the dominating load.
In the case of a fully redundant load LI dominated by an equivalent load V, GVN
should always preserve the original debug location of V. Otherwise, we risk to
introduce an incorrect stepping.
If V has debug info, then clearly it should not be modified. If V has a null
debugloc, then it is still potentially incorrect to propagate LI's debugloc
because LI may not post-dominate V.
Differential Revision: https://reviews.llvm.org/D27468
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288903
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 12:10:49 +0000 (12:10 +0000)]
[X86][SSE] Consistently set MOVD/MOVQ load/store/move instructions to integer domain
We are being inconsistent with these instructions (and all their variants.....) with a random mix of them using the default float domain.
Differential Revision: https://reviews.llvm.org/D27419
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288902
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Wed, 7 Dec 2016 12:01:45 +0000 (12:01 +0000)]
[InlineFunction] Refactor code in function `fixupLineNumbers' as suggested by David in D27462. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288901
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Wed, 7 Dec 2016 11:41:23 +0000 (11:41 +0000)]
[mips][rtdyld] Merge code to write relocated values to the section. NFC
Preparation work for implementing N32 support.
Patch By: Daniel Sanders
Reviewers: vkalintiris, atanasyan
Differential Revision: https://reviews.llvm.org/D27460
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288900
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Wed, 7 Dec 2016 11:21:45 +0000 (11:21 +0000)]
[AVR] Move a pseudo expansion test into a folder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288899
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 7 Dec 2016 11:19:00 +0000 (11:19 +0000)]
[X86][XOP] Fix VPERMIL2 non-constant pool shuffle decoding (PR31296)
The non-constant pool version of DecodeVPERMIL2PMask was not offsetting correctly for the second input. I've updated the code to match the implementation in the constant-pool version.
Annoyingly this bug was hidden for so long as it's tricky to combine to useful variable shuffle masks that don't become constant-pool entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288898
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Wed, 7 Dec 2016 11:08:56 +0000 (11:08 +0000)]
[AVR] Allow loading from stack slots where src and dest registers are identical
Fixes PR 31256
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288897
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Wed, 7 Dec 2016 10:37:26 +0000 (10:37 +0000)]
[InlineFunction] Do not propagate the callsite debug location to instructions inlined from functions with debug info.
When a function F is inlined, InlineFunction extends the debug location of every
instruction inlined from F by adding an InlinedAt.
However, if an instruction has a 'null' debug location, InlineFunction would
propagate the callsite debug location to it. This behavior existed since
revision 210459.
Revision 210459 was originally committed specifically to workaround the lack of
debug information for instructions inlined from intrinsic functions (which are
usually declared with attributes `__always_inline__, __nodebug__`).
The problem with revision 210459 is that it doesn't make any sort of distinction
between instructions inlined from a 'nodebug' function and instructions which
are inlined from a function built with debug info. This issue may lead to
incorrect stepping in the debugger.
This patch works under the assumption that a nodebug function does not have a
DISubprogram. When a function F is inlined into another function G,
InlineFunction checks if F has debug info associated with it.
For nodebug functions, the InlineFunction logic is unchanged (i.e. it would
still propagate the callsite debugloc to the inlined instructions). Otherwise,
InlineFunction no longer propagates the callsite debug location.
Differential Revision: https://reviews.llvm.org/D27462
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288895
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 7 Dec 2016 10:33:15 +0000 (10:33 +0000)]
[PM] Add some more logging to make it more clear when the CGSCC
infrastrucutre is skipping SCCs and RefSCCs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288894
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Wed, 7 Dec 2016 04:48:50 +0000 (04:48 +0000)]
Reintroduce a check accidentally removed in 288873 to fix clang bots
I believe this is the cause of the failure, but have not been able to confirm. Note that this is a speculative fix; I'm still waiting for a full build to finish as I synced and ended up doing a clean build which takes 20+ minutes on my machine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288886
91177308-0d34-0410-b5e6-
96231b3b80d8