platform/upstream/llvm.git
7 years ago[llvm-config] Fix cflags test looking for "warning"
Ben Langmuir [Tue, 30 May 2017 20:21:47 +0000 (20:21 +0000)]
[llvm-config] Fix cflags test looking for "warning"

This will fail if you configure with e.g. -Wno-unknown-warning-option.
Change it to check for 'warning:' just like we did for 'error:' in
r289484.

llvm-svn: 304239

7 years agoAdd an explicit -std= to test to unbreak on PS4 targets.
Richard Smith [Tue, 30 May 2017 20:13:34 +0000 (20:13 +0000)]
Add an explicit -std= to test to unbreak on PS4 targets.

llvm-svn: 304237

7 years ago[test] s/uexpectedly/unexpectedly/
Casey Carter [Tue, 30 May 2017 20:12:55 +0000 (20:12 +0000)]
[test] s/uexpectedly/unexpectedly/

llvm-svn: 304236

7 years ago[LV] Reapply r303763 with fix for PR33193
Matthew Simpson [Tue, 30 May 2017 19:55:57 +0000 (19:55 +0000)]
[LV] Reapply r303763 with fix for PR33193

r303763 caused build failures in some out-of-tree tests due to an assertion in
TTI. The original patch updated cost estimates for induction variable update
instructions marked for scalarization. However, it didn't consider that the
incoming value of an induction variable phi node could be a cast instruction.
This caused queries for cast instruction costs with a mix of vector and scalar
types. This patch includes a fix for cast instructions and the test case from
PR33193.

The fix was suggested by Jonas Paulsson <paulsson@linux.vnet.ibm.com>.

Reference: https://bugs.llvm.org/show_bug.cgi?id=33193
Original Differential Revision: https://reviews.llvm.org/D33457

llvm-svn: 304235

7 years ago[sanitizer] Add "isapla" to symbolizer's global symbols whitelist.
Alex Shlyapnikov [Tue, 30 May 2017 19:52:34 +0000 (19:52 +0000)]
[sanitizer] Add "isapla" to symbolizer's global symbols whitelist.

Summary: D33637 introduced isalpha, whitelist need to reflect that.

Reviewers: eugenis

Subscribers: kubamracek, llvm-commits

Differential Revision: https://reviews.llvm.org/D33687

llvm-svn: 304234

7 years ago[Object] Remove unused field + constructor.
Benjamin Kramer [Tue, 30 May 2017 19:37:02 +0000 (19:37 +0000)]
[Object] Remove unused field + constructor.

llvm-svn: 304233

7 years ago[Object] Fix pessimizing move.
Benjamin Kramer [Tue, 30 May 2017 19:36:58 +0000 (19:36 +0000)]
[Object] Fix pessimizing move.

Returning the Error by value triggers copy elision, the move is more
expensive. Clang rightfully warns about it.

llvm-svn: 304232

7 years agoRevert "This patch closes PR28513: an optimization of multiplication by different...
Vedant Kumar [Tue, 30 May 2017 19:25:22 +0000 (19:25 +0000)]
Revert "This patch closes PR28513: an optimization of multiplication by different constants. It's implemented on DAG combiner level."

This reverts commit r304209.

I think this change is responsible for a tablgen failure in stage2 builds:

  http://green.lab.llvm.org/green/job/clang-stage2-configure-Rthinlto_build/2171/

I reproduced the failure locally (without ThinLTO), reverted the commit, rebuilt the stage1 clang, rebuilt the stage2 llvm-tblgen tool, and found that the crash disappears when the commit is reverted. Here is the stack trace:

FAILED: lib/Target/ARM/ARMGenRegisterBank.inc.tmp
cd /Volumes/Builds/pz-master-stage2-RA/lib/Target/ARM && /Volumes/Builds/pz-master-stage2-RA/bin/llvm-tblgen -gen-register-bank -I /Users/vk/llvm/lib/Target/ARM -I /Users/vk/llvm/include -I /Users/vk/llvm/lib/Target /Users/vk/llvm/lib/Target/ARM/ARM.td -o /Volumes
/Builds/pz-master-stage2-RA/lib/Target/ARM/ARMGenRegisterBank.inc.tmp
0  llvm-tblgen              0x0000000106fc9568 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  llvm-tblgen              0x0000000106fc9be6 SignalHandler(int) + 422
2  libsystem_platform.dylib 0x00000001076a7fba _sigtramp + 26
3  libsystem_platform.dylib 0x00007fff58deb468 _sigtramp + 1366570184
4  llvm-tblgen              0x0000000106e89cc7 llvm::CodeGenRegBank::getCompositeSubRegIndex(llvm::CodeGenSubRegIndex*, llvm::CodeGenSubRegIndex*) + 615
5  llvm-tblgen              0x0000000106e88be6 llvm::CodeGenRegister::computeSubRegs(llvm::CodeGenRegBank&) + 2182
6  llvm-tblgen              0x0000000106e8e9f0 llvm::CodeGenRegBank::CodeGenRegBank(llvm::RecordKeeper&) + 2192
7  llvm-tblgen              0x0000000106f384a1 llvm::EmitRegisterBank(llvm::RecordKeeper&, llvm::raw_ostream&) + 65
8  llvm-tblgen              0x0000000106f72c64 (anonymous namespace)::LLVMTableGenMain(llvm::raw_ostream&, llvm::RecordKeeper&) + 1172
9  llvm-tblgen              0x0000000106fcb15f llvm::TableGenMain(char*, bool (*)(llvm::raw_ostream&, llvm::RecordKeeper&)) + 3599
10 llvm-tblgen              0x0000000106f727a6 main + 134
11 libdyld.dylib            0x000000010733c6a5 start + 1
Stack dump:
0.      Program arguments: /Volumes/Builds/pz-master-stage2-RA/bin/llvm-tblgen -gen-register-bank -I /Users/vk/llvm/lib/Target/ARM -I /Users/vk/llvm/include -I /Users/vk/llvm/lib/Target /Users/vk/llvm/lib/Target/ARM/ARM.td -o /Volumes/Builds/pz-master-stage2-RA/lib/Target/ARM/ARMGenRegisterBank.inc.tmp
/bin/sh: line 1: 41986 Segmentation fault: 11  /Volumes/Builds/pz-master-stage2-RA/bin/llvm-tblgen -gen-register-bank -I /Users/vk/llvm/lib/Target/ARM -I /Users/vk/llvm/include -I /Users/vk/llvm/lib/Target /Users/vk/llvm/lib/Target/ARM/ARM.td -o /Volumes/Builds/pz
-master-stage2-RA/lib/Target/ARM/ARMGenRegisterBank.inc.tmp

llvm-svn: 304231

7 years agoAdded missing break.
Galina Kistanova [Tue, 30 May 2017 19:02:49 +0000 (19:02 +0000)]
Added missing break.

llvm-svn: 304230

7 years ago[OpenMP][Driver] Put target binary for each offload target into a
Alexey Bataev [Tue, 30 May 2017 18:57:51 +0000 (18:57 +0000)]
[OpenMP][Driver] Put target binary for each offload target into a
separate section, by Sergey Dmitriev

Linker script that is generated by the clang driver for creating fat binary puts target binaries for all offload targets into a single ELF section .omp_offloading. This is not convenient because it greatly complicates operations with the final fat binary once it is linked. For example extracting target binary for a particular target from such fat executable would not be an easy task if you have more than one offload target.

Attached patch changes clang driver to put target binary for each
offload target into a separate ELF section .omp_offloading.<target
triple>.

Differential Revision: https://reviews.llvm.org/D33254

llvm-svn: 304229

7 years agoRevert "[Cloning] Take another pass at properly cloning debug info"
Keno Fischer [Tue, 30 May 2017 18:56:26 +0000 (18:56 +0000)]
Revert "[Cloning] Take another pass at properly cloning debug info"

At least one build bot is complaining. Will investigate after lunch.

llvm-svn: 304228

7 years agoARM: Add missing flags to TBB_[JH]T pseudo instructions
Matthias Braun [Tue, 30 May 2017 18:52:33 +0000 (18:52 +0000)]
ARM: Add missing flags to TBB_[JH]T pseudo instructions

NFC except for calming down the machine verifier in some cases.

llvm-svn: 304227

7 years ago[Cloning] Take another pass at properly cloning debug info
Keno Fischer [Tue, 30 May 2017 18:28:30 +0000 (18:28 +0000)]
[Cloning] Take another pass at properly cloning debug info

Summary:
In rL302576, DISubprograms gained the constraint that a !dbg attachments to functions must
have a 1:1 mapping to DISubprograms. As part of that change, the function cloning support
was adjusted to attempt to enforce this invariant during cloning. However, there
were several problems with the implementation. Part of these were fixed in rL304079.
However, there was a more fundamental problem with these changes, namely that it
bypasses the matadata value map, causing the cloned metadata to be a mix of metadata
pointing to the new suprogram (where manual code was added to fix those up) and the
old suprogram (where this was not the case). This mismatch could cause a number of
different assertion failures in the DWARF emitter. Some of these are given at
https://github.com/JuliaLang/julia/issues/22069, but some others have been observed
as well. Attempt to rectify this by partially reverting the manual DI metadata fixup,
and instead using the standard value map approach. To retain the desired semantics
of not duplicating the compilation unit and inlined subprograms, explicitly freeze
these in the value map.

Reviewers: dblaikie, aprantl, GorNishanov, echristo

Reviewed By: aprantl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33655

llvm-svn: 304226

7 years agoAdding parsing ability for .res file.
Eric Beckmann [Tue, 30 May 2017 18:19:06 +0000 (18:19 +0000)]
Adding parsing ability for .res file.

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33566

llvm-svn: 304225

7 years ago[InstCombine] Add test cases to show missed opportunities to remove compare instructi...
Craig Topper [Tue, 30 May 2017 17:47:59 +0000 (17:47 +0000)]
[InstCombine] Add test cases to show missed opportunities to remove compare instructions after cttz/ctlz/ctpop where some bits of the input is known.

llvm-svn: 304224

7 years ago[Hexagon] Improve code generation for 32x32-bit multiplication
Krzysztof Parzyszek [Tue, 30 May 2017 17:47:51 +0000 (17:47 +0000)]
[Hexagon] Improve code generation for 32x32-bit multiplication

For multiplications of 64-bit values (giving 64-bit result), detect
cases where the arguments are sign-extended 32-bit values, on a per-
operand basis. This will allow few patterns to match a wider variety
of combinations in which extensions can occur.

llvm-svn: 304223

7 years ago[CodeView] Add more DebugSubsection implementations.
Zachary Turner [Tue, 30 May 2017 17:13:33 +0000 (17:13 +0000)]
[CodeView] Add more DebugSubsection implementations.

This adds implementations for Symbols and FrameData, and renames
the existing codeview::StringTable class to conform to the
DebugSectionStringTable convention.

llvm-svn: 304222

7 years ago[SelectionDAG] Remove special case for ISD::FPOWI from the strict FP intrinsic handling.
Craig Topper [Tue, 30 May 2017 17:12:18 +0000 (17:12 +0000)]
[SelectionDAG] Remove special case for ISD::FPOWI from the strict FP intrinsic handling.

This code was compensating for FPOWI defaulting to Legal and many targets not changing it to Expand. This was fixed in r304215 to default to Expand so this special handling should no longer be necessary.

llvm-svn: 304221

7 years agoReverting Neon vector type 64-alignment fix
Javed Absar [Tue, 30 May 2017 17:09:47 +0000 (17:09 +0000)]
Reverting Neon vector type 64-alignment fix

The patch caused ABI breaks on darwin/others.
Reverting to come back with a more restrictive patch.

llvm-svn: 304220

7 years ago[AMDGPU] Allow SDWA in instructions with immediates and SGPRs
Stanislav Mekhanoshin [Tue, 30 May 2017 16:49:24 +0000 (16:49 +0000)]
[AMDGPU] Allow SDWA in instructions with immediates and SGPRs

An encoding does not allow to use SDWA in an instruction with
scalar operands, either literals or SGPRs. That is however possible
to copy these operands into a VGPR first.

Several copies of the value are produced if multiple SDWA conversions
were done. To cleanup MachineLICM (to hoist copies out of loops),
MachineCSE (to remove duplicate copies) and SIFoldOperands (to replace
SGPR to VGPR copy with immediate copy right to the VGPR) runs are added
after the SDWA pass.

Differential Revision: https://reviews.llvm.org/D33583

llvm-svn: 304219

7 years ago[CodeView] Rename ModuleDebugFragment -> DebugSubsection.
Zachary Turner [Tue, 30 May 2017 16:36:15 +0000 (16:36 +0000)]
[CodeView] Rename ModuleDebugFragment -> DebugSubsection.

This is more concise, and matches the terminology used in other
parts of the codebase more closely.

llvm-svn: 304218

7 years ago [AMDGPU] Require waitcnt before barrier for all targets; adjust tests.
Mark Searles [Tue, 30 May 2017 16:22:43 +0000 (16:22 +0000)]
[AMDGPU] Require waitcnt before barrier for all targets; adjust tests.

    Differential Revision: https://reviews.llvm.org/D33576

llvm-svn: 304217

7 years ago[OPENMP] Allow 'use_device_ptr' clause in 'target data' alone.
Alexey Bataev [Tue, 30 May 2017 16:00:04 +0000 (16:00 +0000)]
[OPENMP] Allow 'use_device_ptr' clause in 'target data' alone.

According to OpenMP 5.0 at least one 'map' or 'use_device_ptr' clause
must be specified for 'target data' construct. Patch adds support for
this feature.

llvm-svn: 304216

7 years ago[SelectionDAG] Set ISD::FPOWI to Expand by default
Craig Topper [Tue, 30 May 2017 15:27:55 +0000 (15:27 +0000)]
[SelectionDAG] Set ISD::FPOWI to Expand by default

Summary:
Currently FPOWI defaults to Legal and LegalizeDAG.cpp turns Legal into Expand for this opcode because Legal is a "lie".

This patch changes the default for this opcode to Expand and removes the hack from LegalizeDAG.cpp. It also removes all the code in the targets that set this opcode to Expand themselves since they can just rely on the default.

Reviewers: spatel, RKSimon, efriedma

Reviewed By: RKSimon

Subscribers: jfb, dschuff, sbc100, jgravelle-google, nemanjai, javed.absar, andrew.w.kaylor, llvm-commits

Differential Revision: https://reviews.llvm.org/D33530

llvm-svn: 304215

7 years ago[clangd] Mark results of clangd requests with a tag provided by the FileSystemProvider.
Ilya Biryukov [Tue, 30 May 2017 15:11:02 +0000 (15:11 +0000)]
[clangd] Mark results of clangd requests with a tag provided by the FileSystemProvider.

Summary:
This allows an implementation of FileSystemProvider that can track which vfs::FileSystem
were used for each of the requests.

Reviewers: bkramer, krasimir

Reviewed By: bkramer

Subscribers: klimek, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D33678

llvm-svn: 304214

7 years ago[libclang] Allow to suspend a translation unit.
Erik Verbruggen [Tue, 30 May 2017 14:25:54 +0000 (14:25 +0000)]
[libclang] Allow to suspend a translation unit.

A suspended translation unit uses significantly less memory but on the
other side does not support any other calls than
clang_reparseTranslationUnit to resume it or
clang_disposeTranslationUnit to dispose it completely.

This helps IDEs to reduce the memory footprint. The data that is freed
by a call to clang_suspendTranslationUnit will be re-generated on the
next (re)parse anyway. Used with a preamble, this allows pretty fast
resumption of the translation unit for further use (compared to disposal
of the translation unit and a parse from scratch).

Patch by Nikolai Kosjar!

llvm-svn: 304212

7 years agoFixup r304205 - Require PowerPC target
Diana Picus [Tue, 30 May 2017 14:05:33 +0000 (14:05 +0000)]
Fixup r304205 - Require PowerPC target

llvm-svn: 304211

7 years agoFix issue with test that caused bildbot failure
Javed Absar [Tue, 30 May 2017 13:34:26 +0000 (13:34 +0000)]
Fix issue with test that caused bildbot failure

These tests did not specify the target.
The failure was triggered by change -
https://reviews.llvm.org/D33205
http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/7314

which sets vector alignment to 8-byte for arm-targets (except for Android).
So, fixing the test to make it target specific.

llvm-svn: 304210

7 years agoThis patch closes PR28513: an optimization of multiplication by different constants.
Andrew V. Tischenko [Tue, 30 May 2017 13:00:44 +0000 (13:00 +0000)]
This patch closes PR28513: an optimization of multiplication by different constants.
It's implemented on DAG combiner level.

llvm-svn: 304209

7 years ago[ARM] Update long-test after r304201.
Benjamin Kramer [Tue, 30 May 2017 12:44:48 +0000 (12:44 +0000)]
[ARM] Update long-test after r304201.

llvm-svn: 304208

7 years agoAllow for unfinished #if blocks in preambles
Erik Verbruggen [Tue, 30 May 2017 11:54:55 +0000 (11:54 +0000)]
Allow for unfinished #if blocks in preambles

Previously, a preamble only included #if blocks (and friends like
ifdef) if there was a corresponding #endif before any declaration or
definition. The problem is that any header file that uses include guards
will not have a preamble generated, which can make code-completion very
slow.

To prevent errors about unbalanced preprocessor conditionals in the
preamble, and unbalanced preprocessor conditionals after a preamble
containing unfinished conditionals, the conditional stack is stored
in the pch file.

This fixes PR26045.

Differential Revision: http://reviews.llvm.org/D15994

llvm-svn: 304207

7 years ago[ELF] Add .ARM.exidx sentinel section to an OutputSectionDescription
Peter Smith [Tue, 30 May 2017 11:51:02 +0000 (11:51 +0000)]
[ELF] Add .ARM.exidx sentinel section to an OutputSectionDescription

When there is a linker script with .ARM.exidx in the SECTIONS
command we must add the .ARM.exidx sentinel section to the
InputSectionDescriptions as well as to OutputSection::Sections.

Differential Revision: https://reviews.llvm.org/D33496

llvm-svn: 304206

7 years ago[PPC] Make altivec conversion function macros.
Benjamin Kramer [Tue, 30 May 2017 11:37:29 +0000 (11:37 +0000)]
[PPC] Make altivec conversion function macros.

The second argument must be a constant, otherwise instruction selection
will fail. always_inline is not enough for isel to always fold
everything away at -O0.

Sadly the overloading turned this into a big macro mess. Fixes PR33212.

llvm-svn: 304205

7 years ago[SCEV][NFC] Remove redundant params from isAvailableAtLoopEntry
Max Kazantsev [Tue, 30 May 2017 10:54:58 +0000 (10:54 +0000)]
[SCEV][NFC] Remove redundant params from isAvailableAtLoopEntry

Params DT and LI are redundant, because these values are contained in fields anyways.

Differential Revision: https://reviews.llvm.org/D33668

llvm-svn: 304204

7 years ago[SystemZ] Add decimal floating-point instructions
Ulrich Weigand [Tue, 30 May 2017 10:15:16 +0000 (10:15 +0000)]
[SystemZ] Add decimal floating-point instructions

This adds assembler / disassembler support for the decimal
floating-point instructions.  Since LLVM does not yet have
support for decimal float types, these cannot be used for
codegen at this point.

llvm-svn: 304203

7 years ago[SystemZ] Add hexadecimal floating-point instructions
Ulrich Weigand [Tue, 30 May 2017 10:13:23 +0000 (10:13 +0000)]
[SystemZ] Add hexadecimal floating-point instructions

This adds assembler / disassembler support for the hexadecimal
floating-point instructions.  Since the Linux ABI does not use
any hex float data types, these are not useful for codegen.

llvm-svn: 304202

7 years ago[ARM] Fix Neon vector type alignment to 64-bit
Javed Absar [Tue, 30 May 2017 10:12:15 +0000 (10:12 +0000)]
[ARM] Fix Neon vector type alignment to 64-bit

The maximum alignment for ARM NEON data types should be 64-bits as specified
in ARM procedure call standard document Sec. A.2 Notes.
This patch fixes it from its current larger natural default values, except
for Android (so as not to break existing ABI).
Reviewed by: Stephen Hines, Renato Golin.
Differential Revision: https://reviews.llvm.org/D33205

llvm-svn: 304201

7 years ago[SystemZ] Add missing assembler/disassembler tests
Ulrich Weigand [Tue, 30 May 2017 10:11:13 +0000 (10:11 +0000)]
[SystemZ] Add missing assembler/disassembler tests

A few instructions that are actually correctly supported in the
assembler and disassembler did not have any tests.

llvm-svn: 304200

7 years ago[MC] Fix constant pools with DenseMap sentinel values
Oliver Stannard [Tue, 30 May 2017 09:37:11 +0000 (09:37 +0000)]
[MC] Fix constant pools with DenseMap sentinel values

The MC ConstantPool class uses a DenseMap to track generated constants, with
the int64_t value of the constant as the key. This fails when values of
0x7fffffffffffffff or 0x7ffffffffffffffe are inserted into the constant pool, as
these are sentinel values for DenseMap.

The fix is to use std::map instead, which doesn't use sentinel values.

Differential revision: https://reviews.llvm.org/D33667

llvm-svn: 304199

7 years ago[mips] Expansion of LI.S and LI.D
Zoran Jovanovic [Tue, 30 May 2017 09:33:43 +0000 (09:33 +0000)]
[mips] Expansion of LI.S and LI.D
Author: smaksimovic
Reviewers: dsanders sdardis
Introduces LI.S and LI.D pseudo instructions with floating point operands.
Differential Revision: https://reviews.llvm.org/D14390

llvm-svn: 304198

7 years ago[ELF] - Fix comment. NFC.
George Rimar [Tue, 30 May 2017 07:51:25 +0000 (07:51 +0000)]
[ELF] - Fix comment. NFC.

llvm-svn: 304197

7 years agoFix PR33031: correct the estimate of maximum offset for instructions spilling/filling...
Kristof Beyls [Tue, 30 May 2017 06:58:41 +0000 (06:58 +0000)]
Fix PR33031: correct the estimate of maximum offset for instructions spilling/filling the stack.

llvm-svn: 304196

7 years agoNewGVN: Compute hash value of expression on demand and use it in inequality testing.
Daniel Berlin [Tue, 30 May 2017 06:58:18 +0000 (06:58 +0000)]
NewGVN: Compute hash value of expression on demand and use it in inequality testing.

llvm-svn: 304195

7 years agoNewGVN: Fix PR33194, memory corruption by putting temporary instructions in tables...
Daniel Berlin [Tue, 30 May 2017 06:42:29 +0000 (06:42 +0000)]
NewGVN: Fix PR33194, memory corruption by putting temporary instructions in tables sometimes.

llvm-svn: 304194

7 years ago[OpenCL] Added diagnostic for implicit declaration of function in OpenCL
Egor Churaev [Tue, 30 May 2017 05:57:52 +0000 (05:57 +0000)]
[OpenCL] Added diagnostic for implicit declaration of function in OpenCL

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

Differential Revision: https://reviews.llvm.org/D31745

llvm-svn: 304193

7 years ago[ELF] - Do not crash when linkerscript applies fill to .bss.
George Rimar [Tue, 30 May 2017 05:48:09 +0000 (05:48 +0000)]
[ELF] - Do not crash when linkerscript applies fill to .bss.

I found that during visual inspection of code while wrote different patch.
Script in testcase probably have nothing common with real life, but
we segfault currently using it.

If output section is known NOBITS, there is no need to create
writers threads for doing nothing or proccess any filler logic that
is useless here. We can just early return, that is what this patch do.

DIfferential revision: https://reviews.llvm.org/D33646

llvm-svn: 304192

7 years ago[OpenCL] An error shall occur if any scalar operand has greater rank than the type...
Egor Churaev [Tue, 30 May 2017 05:32:03 +0000 (05:32 +0000)]
[OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element

Summary:
This is the fix for patch https://reviews.llvm.org/D33353
@uweigand, could you please verify that everything will be good on SystemZ?
I added triple spir-unknown-unknown.
Thank you in advance!

Reviewers: uweigand

Reviewed By: uweigand

Subscribers: yaxunl, cfe-commits, bader, Anastasia, uweigand

Differential Revision: https://reviews.llvm.org/D33648

llvm-svn: 304191

7 years agoDiagnose attempts to build a preprocessed module that defines an unavailable submodule.
Richard Smith [Tue, 30 May 2017 05:22:59 +0000 (05:22 +0000)]
Diagnose attempts to build a preprocessed module that defines an unavailable submodule.

The errors we would otherwise get are incomprehensible, as we would enter the
module but not make its contents visible to itself.

llvm-svn: 304190

7 years ago[ELF] Filter out non InputSection members from InputSections
Petr Hosek [Tue, 30 May 2017 05:17:58 +0000 (05:17 +0000)]
[ELF] Filter out non InputSection members from InputSections

InputSections may contain MergeInputSection members which trigger
a segmentation fault when trying to cast them to InputSection.

Differential Revision: https://reviews.llvm.org/D33628

llvm-svn: 304189

7 years ago[trivial] fix a typo in comment, NFC
Hiroshi Inoue [Tue, 30 May 2017 05:06:46 +0000 (05:06 +0000)]
[trivial] fix a typo in comment, NFC

llvm-svn: 304188

7 years agoAdded LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
Galina Kistanova [Tue, 30 May 2017 03:30:34 +0000 (03:30 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.

llvm-svn: 304187

7 years agoAdded missing line continuation to HANDLE_DIEVALUE_SMALL and HANDLE_DIEVALUE_LARGE...
Galina Kistanova [Tue, 30 May 2017 03:21:12 +0000 (03:21 +0000)]
Added missing line continuation to HANDLE_DIEVALUE_SMALL and HANDLE_DIEVALUE_LARGE macros.

llvm-svn: 304186

7 years ago[ELF] Use late evaluation for ALIGN in expression
Petr Hosek [Tue, 30 May 2017 03:18:28 +0000 (03:18 +0000)]
[ELF] Use late evaluation for ALIGN in expression

While the following expression is handled fine:

  PROVIDE_HIDDEN(newsym = oldsym + address);

The following expression triggers an error because the expression
is evaluated as absolute:

  PROVIDE_HIDDEN(newsym = ALIGN(oldsym, CONSTANT(MAXPAGESIZE)) + address);

To avoid this error, we use late evaluation for ALIGN by making the
alignment an attribute of the expression itself.

Differential Revision: https://reviews.llvm.org/D33629

llvm-svn: 304185

7 years agoReverted r303602, as it will be fixed in gtest.
Galina Kistanova [Tue, 30 May 2017 03:17:10 +0000 (03:17 +0000)]
Reverted r303602, as it will be fixed in gtest.

llvm-svn: 304184

7 years ago[modules] When we #include a local submodule header that we've already built,
Richard Smith [Tue, 30 May 2017 02:03:19 +0000 (02:03 +0000)]
[modules] When we #include a local submodule header that we've already built,
and it has an include guard, produce callbacks for a module import, not for a
skipped non-modular header.

Fixes -E output when preprocessing a module to list these cases as a module
import, rather than suppressing the #include and losing the import side effect.

llvm-svn: 304183

7 years agoReplace a few more uses of OutputSections.
Rafael Espindola [Tue, 30 May 2017 01:36:48 +0000 (01:36 +0000)]
Replace a few more uses of OutputSections.

llvm-svn: 304182

7 years agoKeep a list of all OutputSectionCommands.
Rafael Espindola [Tue, 30 May 2017 01:30:14 +0000 (01:30 +0000)]
Keep a list of all OutputSectionCommands.

Now that we are trying to use the linker script representation as the
canonycal one, there are a few loops looking for just OutputSectionCommands.

Create a vector with just the OutputSectionCommands once that is
stable to simplify the rest of the code.

llvm-svn: 304181

7 years agoAdd missing 'requires coroutines' to module map
Eric Fiselier [Mon, 29 May 2017 23:17:28 +0000 (23:17 +0000)]
Add missing 'requires coroutines' to module map

llvm-svn: 304180

7 years agoRevert r303763, results in asserts i.e. while building Ruby.
Joerg Sonnenberger [Mon, 29 May 2017 22:52:17 +0000 (22:52 +0000)]
Revert r303763, results in asserts i.e. while building Ruby.

llvm-svn: 304179

7 years ago[TableGen] Use StringMap instead of DenseMap<StringRef> to unique CodeInit and String...
Craig Topper [Mon, 29 May 2017 21:49:37 +0000 (21:49 +0000)]
[TableGen] Use StringMap instead of DenseMap<StringRef> to unique CodeInit and StringInit objects. Override the allocator to keep using the BumpPtrAllocator. NFCI

StringMap is better suited to mapping strings than a DenseMap.

llvm-svn: 304178

7 years ago[TableGen] Introduce DagInit::getArgs that returns an ArrayRef. Use it to fix 80...
Craig Topper [Mon, 29 May 2017 21:49:34 +0000 (21:49 +0000)]
[TableGen] Introduce DagInit::getArgs that returns an ArrayRef. Use it to fix 80 column violations in arg_begin/arg_end. Remove DagInit::args and use getArgs instead. NFC

llvm-svn: 304177

7 years agoCGCoroutine.cpp: (NFC) clang-format misplaced brace
Gor Nishanov [Mon, 29 May 2017 21:15:31 +0000 (21:15 +0000)]
CGCoroutine.cpp: (NFC) clang-format misplaced brace

llvm-svn: 304176

7 years ago[ManagedStatic] Avoid putting function pointers in template args.
Benjamin Kramer [Mon, 29 May 2017 20:56:27 +0000 (20:56 +0000)]
[ManagedStatic] Avoid putting function pointers in template args.

This is super awkward, but GCC doesn't let us have template visible when
an argument is an inline function and -fvisibility-inlines-hidden is
used.

llvm-svn: 304175

7 years ago[GlobalIsel] Fix a warning with GCC 7 -Wpedantic. NFCI.
Davide Italiano [Mon, 29 May 2017 20:13:22 +0000 (20:13 +0000)]
[GlobalIsel] Fix a warning with GCC 7 -Wpedantic. NFCI.

llvm-svn: 304174

7 years agoFix <experimental/coroutine> in C++03
Eric Fiselier [Mon, 29 May 2017 19:46:16 +0000 (19:46 +0000)]
Fix <experimental/coroutine> in C++03

llvm-svn: 304173

7 years ago[coroutines] Make coroutine_handle<T>::from_address ill-formed for everything but...
Eric Fiselier [Mon, 29 May 2017 19:24:25 +0000 (19:24 +0000)]
[coroutines] Make coroutine_handle<T>::from_address ill-formed for everything but void*.

from_address requires that the provided pointer refer to the suspended coroutine,
which doesn't have a type, or at least not one knowable by the user. Therefore
every use of `from_address` with a typed pointer is almost certainly a bug.

This behavior is a part of the TS specification, but hopefully it will be
in the future.

llvm-svn: 304172

7 years ago[X86] Add tests for (ix bitcast (vxi1 and ...)). NFC.
Zvi Rackover [Mon, 29 May 2017 19:00:57 +0000 (19:00 +0000)]
[X86] Add tests for (ix bitcast (vxi1 and ...)). NFC.

To be improved by D33311.

llvm-svn: 304171

7 years ago[analyzer] Fix immutable map factory lifetime for partial taint.
Artem Dergachev [Mon, 29 May 2017 18:54:02 +0000 (18:54 +0000)]
[analyzer] Fix immutable map factory lifetime for partial taint.

This should fix the leaks found by asan buildbot in r304162.

Also don't store a reference to the factory with every map value,
which is the only difference between ImmutableMap and ImmutableMapRef.

llvm-svn: 304170

7 years ago[X86] Replace undef value in flaky test
Zvi Rackover [Mon, 29 May 2017 18:27:00 +0000 (18:27 +0000)]
[X86] Replace undef value in flaky test

D33311 exposes the flakiness in this test. Replacing the undef placed by
bugpoint, makes it more interesting and robust.

llvm-svn: 304168

7 years agoUnbreak long test after r304127.
Benjamin Kramer [Mon, 29 May 2017 18:11:11 +0000 (18:11 +0000)]
Unbreak long test after r304127.

llvm-svn: 304167

7 years ago[ManagedStatic] Make object_creator/object_deleter visible again.
Benjamin Kramer [Mon, 29 May 2017 18:00:33 +0000 (18:00 +0000)]
[ManagedStatic] Make object_creator/object_deleter visible again.

They're now exposed as template args, which creates complications when
ManagedStatics are used across .so boundaries.

llvm-svn: 304166

7 years agoDon't destroy ManagedStatics in a unit test.
Benjamin Kramer [Mon, 29 May 2017 17:25:37 +0000 (17:25 +0000)]
Don't destroy ManagedStatics in a unit test.

Turns out this is very hostile towards other unit tests running in the
same process, it unregisters all flags.

llvm-svn: 304165

7 years ago[wasm] Fix test after r304117.
Benjamin Kramer [Mon, 29 May 2017 16:32:52 +0000 (16:32 +0000)]
[wasm] Fix test after r304117.

llvm-svn: 304164

7 years ago[X86] Don't fold away the memory operand of an xchg.
Benjamin Kramer [Mon, 29 May 2017 16:25:20 +0000 (16:25 +0000)]
[X86] Don't fold away the memory operand of an xchg.

xchg with a mem operand has different locking semantics. If we unfold it
into a xchg r,r we will loose the implicit lock. Likewise we never want
to fold a register xchg into a memory one as it would be a lot slower.

This triggers during LLVM selfhost.

llvm-svn: 304163

7 years ago[analyzer] Support partially tainted records.
Artem Dergachev [Mon, 29 May 2017 15:42:56 +0000 (15:42 +0000)]
[analyzer] Support partially tainted records.

The analyzer's taint analysis can now reason about structures or arrays
originating from taint sources in which only certain sections are tainted.

In particular, it also benefits modeling functions like read(), which may
read tainted data into a section of a structure, but RegionStore is incapable of
expressing the fact that the rest of the structure remains intact, even if we
try to model read() directly.

Patch by Vlad Tsyrklevich!

Differential revision: https://reviews.llvm.org/D28445

llvm-svn: 304162

7 years ago[Docs] Add VectorizationPlan to docs/Proposals.
Ayal Zaks [Mon, 29 May 2017 15:36:23 +0000 (15:36 +0000)]
[Docs] Add VectorizationPlan to docs/Proposals.

Following the request made in https://reviews.llvm.org/D32871, the
general documentation of the Vectorization Plan is hereby placed
under docs/Proposals.

llvm-svn: 304161

7 years ago[analyzer] Initial commit for the upcoming refactoring of the IteratorChecker.
Artem Dergachev [Mon, 29 May 2017 15:03:20 +0000 (15:03 +0000)]
[analyzer] Initial commit for the upcoming refactoring of the IteratorChecker.

The new checker currently contains the very core infrastructure for tracking
the state of iterator-type objects in the analyzer: relating iterators to
their containers, tracking symbolic begin and end iterator values for
containers, and solving simple equality-type constraints over iterators.
A single specific check over this infrastructure is capable of finding usage of
out-of-range iterators in some simple cases.

Patch by Ádám Balogh!

Differential revision: https://reviews.llvm.org/D32592

llvm-svn: 304160

7 years ago[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.
Artem Dergachev [Mon, 29 May 2017 14:51:39 +0000 (14:51 +0000)]
[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.

pthread_mutex_destroy() may fail, returning a non-zero error number, and
keeping the mutex untouched. The mutex can be used on the execution branch
that follows such failure, so the analyzer shouldn't warn on using
a mutex that was previously destroyed, when in fact the destroy call has failed.

Patch by Malhar Thakkar!

Differential revision: https://reviews.llvm.org/D32449

llvm-svn: 304159

7 years agoReplace forward decl with include to unbreak the build.
Benjamin Kramer [Mon, 29 May 2017 14:40:07 +0000 (14:40 +0000)]
Replace forward decl with include to unbreak the build.

llvm-svn: 304158

7 years agoTry to work around MSVC being buggy. Attempt #1.
Benjamin Kramer [Mon, 29 May 2017 14:28:04 +0000 (14:28 +0000)]
Try to work around MSVC being buggy. Attempt #1.

error C2971: 'llvm::ManagedStatic': template parameter 'Creator': 'CreateDefaultTimerGroup': a variable with non-static storage duration cannot be used as a non-type argument

llvm-svn: 304157

7 years ago[Timer] Move DefaultTimerGroup into a ManagedStatic.
Benjamin Kramer [Mon, 29 May 2017 14:05:29 +0000 (14:05 +0000)]
[Timer] Move DefaultTimerGroup into a ManagedStatic.

This used to be just leaked. r295370 made it use magic statics. This adds
a global destructor, which is something we'd like to avoid. It also creates
a weird situation where the mutex used by TimerGroup is re-created during
global shutdown and leaked.

Using a ManagedStatic here is also subtle as it relies on the mutex
inside of ManagedStatic to be recursive. I've added a test for that
in a previous change.

llvm-svn: 304156

7 years ago[ManagedStatic] Add a way to pass custom creators/deleters.
Benjamin Kramer [Mon, 29 May 2017 14:05:26 +0000 (14:05 +0000)]
[ManagedStatic] Add a way to pass custom creators/deleters.

Also add a test case verifying that nested ManagedStatics work correctly.

llvm-svn: 304155

7 years ago[clang-tidy] Use getLocalOrGlobal for the StrictMode option
Alexander Kornienko [Mon, 29 May 2017 13:59:27 +0000 (13:59 +0000)]
[clang-tidy] Use getLocalOrGlobal for the StrictMode option

llvm-svn: 304154

7 years ago[DAGCombiner] fix load narrowing transform to exclude loads with extension
Sanjay Patel [Mon, 29 May 2017 13:24:58 +0000 (13:24 +0000)]
[DAGCombiner] fix load narrowing transform to exclude loads with extension

The extending load possibility was missed in:
https://reviews.llvm.org/rL304072

We might want to handle this cases as a follow-up, but bailing out for now
to avoid miscompiling.

llvm-svn: 304153

7 years ago[SystemZ] Improve buildVector() in SystemZISelLowering.cpp.
Jonas Paulsson [Mon, 29 May 2017 13:22:23 +0000 (13:22 +0000)]
[SystemZ]  Improve buildVector() in SystemZISelLowering.cpp.

Use VLREP when inserting one or more loads into a vector. This is more
efficient than to first load and then use a VLVGP.

Review: Ulrich Weigand
llvm-svn: 304152

7 years ago[ScopInfo] Do not add terminator & synthesizable instructions to the output instructions.
Michael Kruse [Mon, 29 May 2017 12:27:38 +0000 (12:27 +0000)]
[ScopInfo] Do not add terminator & synthesizable instructions to the output instructions.

Such instructions are generates on-demand by the CodeGenerator and thus
do not need representation in a statement.

Differential Revision: https://reviews.llvm.org/D33642

llvm-svn: 304151

7 years agoTest commit: fix typos
Mattias Eriksson [Mon, 29 May 2017 11:46:44 +0000 (11:46 +0000)]
Test commit: fix typos

Just fixing a few typos in comments to test commit access.

llvm-svn: 304149

7 years agoRevert "[NFC] Fix formatting & typecast issue. Build succeeds."
Siddharth Bhat [Mon, 29 May 2017 11:34:29 +0000 (11:34 +0000)]
Revert "[NFC] Fix formatting & typecast issue. Build succeeds."

Should not have 'fixed' the formatting issue, I did not have the most
recent version of `clang-format`.
This reverts commit 761b1268359e14e59142f253d77864a29d55c56c.

llvm-svn: 304148

7 years agoReplaced StructuredData::Type with eStructuredDataType
Abhishek Aggarwal [Mon, 29 May 2017 11:13:30 +0000 (11:13 +0000)]
Replaced StructuredData::Type with eStructuredDataType

...missing from r304138 "Added new API to SBStructuredData class"

llvm-svn: 304147

7 years ago[NFC] Fix formatting & typecast issue. Build succeeds.
Siddharth Bhat [Mon, 29 May 2017 11:00:31 +0000 (11:00 +0000)]
[NFC] Fix formatting & typecast issue. Build succeeds.

- Fix formatting in `RegisterPasses.cpp`.
- `assert` tried to compare `isl::boolean` against `long`. Explicitly
construct `bool` from `isl::boolean`. This allows the implicit cast of
`bool` to `long.

llvm-svn: 304146

7 years ago[Nios2] Target registration
Nikolai Bozhenov [Mon, 29 May 2017 09:48:30 +0000 (09:48 +0000)]
[Nios2] Target registration

Reviewers: craig.topper, hfinkel, joerg, lattner, zvi

Reviewed By: craig.topper

Subscribers: oren_ben_simhon, igorb, belickim, tvvikram, mgorny, llvm-commits, pavel.v.chupin, DavidKreitzer

Differential Revision: https://reviews.llvm.org/D32669
Patch by AndreiGrischenko <andrei.l.grischenko@intel.com>

llvm-svn: 304144

7 years ago[ARM] GlobalISel: Extract helper. NFCI.
Diana Picus [Mon, 29 May 2017 09:09:54 +0000 (09:09 +0000)]
[ARM] GlobalISel: Extract helper. NFCI.

Create a helper to deal with the common code for merging incoming values
together after they've been split during call lowering. There's likely
more stuff that can be commoned up here, but we'll leave that for later.

llvm-svn: 304143

7 years agoMore StructuredData::Type::eTypeDictionary -> lldb::eStructuredDataTypeDictionary
Stephan Bergmann [Mon, 29 May 2017 08:51:58 +0000 (08:51 +0000)]
More StructuredData::Type::eTypeDictionary -> lldb::eStructuredDataTypeDictionary

...missing from previous r304138 "Added new API to SBStructuredData class"

llvm-svn: 304142

7 years agoclang-format: [JS] do not clean up duplicated commas.
Martin Probst [Mon, 29 May 2017 08:41:11 +0000 (08:41 +0000)]
clang-format: [JS] do not clean up duplicated commas.

Summary:
In JavaScript, duplicated commas have semantic meaning.
    x = [a,,b];

The statement above creates an array with three entries, the middle being undefined. Because clang-format should not change semantics, disable this cleanup in JS.

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D33641

llvm-svn: 304141

7 years ago[ELF] - Do not allow -r to eat comdats.
George Rimar [Mon, 29 May 2017 08:37:50 +0000 (08:37 +0000)]
[ELF] - Do not allow -r to eat comdats.

This is PR33052, "Bug 33052 - -r eats comdats ".

To fix it I stop removing group section from out when -r is given
and fixing SHT_GROUP content when writing it just like we do some
other fixup, e.g. for Rel[a]. (it needs fix for section indices that
are in group).

Differential revision: https://reviews.llvm.org/D33485

llvm-svn: 304140

7 years ago[trivial] fix a typo in comment, NFC
Hiroshi Inoue [Mon, 29 May 2017 08:37:42 +0000 (08:37 +0000)]
[trivial] fix a typo in comment, NFC

llvm-svn: 304139

7 years agoAdded new API to SBStructuredData class
Abhishek Aggarwal [Mon, 29 May 2017 08:25:46 +0000 (08:25 +0000)]
Added new API to SBStructuredData class

Summary:
 - Added API to access data types
    -- integer, double, array, string, boolean and dictionary data types
    -- Earlier user had to parse through the string output to get these
       values

 - Added Test cases for API testing

 - Added new StructuredDataType enum in public include file
   -- Replaced locally-defined enum in StructuredData.h with this new
      one
   -- Modified other internal files using this locally-defined enum

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>
Reviewers: clayborg, lldb-commits

Reviewed By: clayborg

Subscribers: labath

Differential Revision: https://reviews.llvm.org/D33434

llvm-svn: 304138

7 years ago[ARM] GlobalISel: Support array returns
Diana Picus [Mon, 29 May 2017 08:19:19 +0000 (08:19 +0000)]
[ARM] GlobalISel: Support array returns

These are a bit rare in practice, but they don't require anything
special compared to array parameters, so support them as well.

llvm-svn: 304137

7 years agoAdapt to recent clang-format changes
Tobias Grosser [Mon, 29 May 2017 08:06:29 +0000 (08:06 +0000)]
Adapt to recent clang-format changes

llvm-svn: 304136

7 years agoclang-format: [JS] fix indenting bound functions.
Martin Probst [Mon, 29 May 2017 07:50:52 +0000 (07:50 +0000)]
clang-format: [JS] fix indenting bound functions.

Summary:
The previous fix to force build style wrapping if the previous token is a closing parenthesis broke a peculiar pattern where users parenthesize the function declaration in a bind call:
    fn((function() { ... }).bind(this));

This restores the previous behaviour by reverting that change, but narrowing the special case for unindenting closing parentheses to those followed by semicolons and opening braces, i.e. immediate calls and function declarations.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D33640

llvm-svn: 304135