platform/upstream/llvm.git
7 years ago[GISel]: Missed passing in a parameter to addUsesFromArgs
Aditya Nandakumar [Thu, 27 Jul 2017 02:15:34 +0000 (02:15 +0000)]
[GISel]: Missed passing in a parameter to addUsesFromArgs

llvm-svn: 309243

7 years agoRemove check for i686.
Eric Beckmann [Thu, 27 Jul 2017 01:16:19 +0000 (01:16 +0000)]
Remove check for i686.

libxml2 is supported for 32 bit, so our build system should be checking
the target rather than native os when choosing shared libs.

llvm-svn: 309242

7 years agoRe-enable libxml2 tests.
Eric Beckmann [Thu, 27 Jul 2017 01:11:53 +0000 (01:11 +0000)]
Re-enable libxml2 tests.

llvm-svn: 309241

7 years ago[DWARF] Minor code style modification, no functionality change.
Spyridoula Gravani [Thu, 27 Jul 2017 00:59:33 +0000 (00:59 +0000)]
[DWARF] Minor code style modification, no functionality change.

llvm-svn: 309240

7 years agoAdd {Obj,Import,Bitcode}File::Instances to COFF input files.
Rui Ueyama [Thu, 27 Jul 2017 00:45:26 +0000 (00:45 +0000)]
Add {Obj,Import,Bitcode}File::Instances to COFF input files.

We did the same thing for ELF in r309152, and I want to maintain
COFF and ELF as close as possible.

llvm-svn: 309239

7 years agoFix the formatting for help on option value types.
Jim Ingham [Thu, 27 Jul 2017 00:18:18 +0000 (00:18 +0000)]
Fix the formatting for help on option value types.

Patch by Jessica Han <jessicah@juniper.net>

https://reviews.llvm.org/D35525

llvm-svn: 309238

7 years agoDebugInfo: Ensure imported entities at the top level of an inlined function don't...
David Blaikie [Thu, 27 Jul 2017 00:06:53 +0000 (00:06 +0000)]
DebugInfo: Ensure imported entities at the top level of an inlined function don't cause degenerate concrete definitions

Local imported entities at the top level of a subprogram were being
handled differently from those in nested scopes - that different
handling would cause pseudo concrete out-of-line definitions to be
created (but without any of their attributes, nor an abstract_origin) in
the case where there was no real concrete definition.

These local imported entities also only appeared in the concrete
definition where those imported entities in nested scopes appear in all
cases (abstract, concrete, and inlined). This change at least makes top
level case handle the same as the others - though there's a FIXME to
improve this to /only/ emit them into the abstract origin (though this
requires more plumbing - like the abstract subprogram and variable
handling that must defer population until the end of the unit to
discover if there is an abstract origin, or only a standalone concrete
definition).

llvm-svn: 309237

7 years ago[Hexagon] Fix expensive checks build bot broken in r309230.
Eugene Zelenko [Wed, 26 Jul 2017 23:56:29 +0000 (23:56 +0000)]
[Hexagon] Fix expensive checks build bot broken in r309230.

llvm-svn: 309236

7 years ago[CMake] Disable -Werror for CMake checks
Petr Hosek [Wed, 26 Jul 2017 23:49:18 +0000 (23:49 +0000)]
[CMake] Disable -Werror for CMake checks

-Werror may cause some of the CMake checks to fail, so we disable
it even if it's enabled for the build itself.

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

llvm-svn: 309235

7 years agoAdd --gc-sections to a test.
Rafael Espindola [Wed, 26 Jul 2017 23:47:24 +0000 (23:47 +0000)]
Add --gc-sections to a test.

This shows that the logic in --gc-sections is a bit more precise than
what can be easily done in LTO.

llvm-svn: 309234

7 years ago[Hexagon] Partially revert r309230 which caused some build bots failures.
Eugene Zelenko [Wed, 26 Jul 2017 23:45:28 +0000 (23:45 +0000)]
[Hexagon] Partially revert r309230 which caused some build bots failures.

llvm-svn: 309233

7 years agoMake __start_sec __end_sec handling more precise.
Rafael Espindola [Wed, 26 Jul 2017 23:39:10 +0000 (23:39 +0000)]
Make __start_sec __end_sec handling more precise.

With this we only ask LTO to keep a C named section if there is a
__start_ or __end symbol.

This is not as strict as lld's --gc-sections, but is as good as we can
get without having a far more detailed ir summary.

llvm-svn: 309232

7 years agolld: /manifestuac:no shouldn't disable /manifestdependency:
Nico Weber [Wed, 26 Jul 2017 23:38:10 +0000 (23:38 +0000)]
lld: /manifestuac:no shouldn't disable /manifestdependency:

Matches link.exe
https://reviews.llvm.org/D35872

llvm-svn: 309231

7 years ago[Hexagon] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Wed, 26 Jul 2017 23:20:35 +0000 (23:20 +0000)]
[Hexagon] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 309230

7 years agoSee if disabling libxml tests will pass the i686 bot.
Eric Beckmann [Wed, 26 Jul 2017 23:15:44 +0000 (23:15 +0000)]
See if disabling libxml tests will pass the i686 bot.

llvm-svn: 309229

7 years agoRename ObjectFile ObjFile for COFF as well.
Rui Ueyama [Wed, 26 Jul 2017 23:05:24 +0000 (23:05 +0000)]
Rename ObjectFile ObjFile for COFF as well.

llvm-svn: 309228

7 years ago[lit] Fix race between shtest-shell and max-failures tests
Reid Kleckner [Wed, 26 Jul 2017 22:57:32 +0000 (22:57 +0000)]
[lit] Fix race between shtest-shell and max-failures tests

Previously these tests would use the same Output directory leading to
flaky non-deterministic failures.

llvm-svn: 309227

7 years agoHeaders: improve ARM EHABI coverage of unwind.h
Saleem Abdulrasool [Wed, 26 Jul 2017 22:55:23 +0000 (22:55 +0000)]
Headers: improve ARM EHABI coverage of unwind.h

Ensure that we define the `_Unwind_Control_Block` structure used on ARM
EHABI targets.  This is needed for building libc++abi with the unwind.h
from the resource dir.  A minor fallout of this is that we needed to
create a typedef for _Unwind_Exception to work across ARM EHABI and
non-EHABI targets.  The structure definitions here are based originally
on the documentation from ARM under the "Exception Handling ABI for the
ARMĀ® Architecture" Section 7.2.  They are then adjusted to more closely
reflect the definition in libunwind from LLVM.  Those changes are
compatible in layout but permit easier use in libc++abi and help
maintain compatibility between libunwind and the compiler provided
definition.

llvm-svn: 309226

7 years agoFix the name of the section end symbol.
Rafael Espindola [Wed, 26 Jul 2017 22:52:53 +0000 (22:52 +0000)]
Fix the name of the section end symbol.

It is __stop_<sec>, not __end_<sec>.

llvm-svn: 309225

7 years ago[lit] Fix shtest-shell and max-failures lit tests on Windows
Reid Kleckner [Wed, 26 Jul 2017 22:21:25 +0000 (22:21 +0000)]
[lit] Fix shtest-shell and max-failures lit tests on Windows

Rewrite the write-to-stderr.sh and write-to-stdout-and-stderr.sh shell
scripts as python scripts and call python on them.

Fixes PR33940

llvm-svn: 309200

7 years agoRename ObjectFile -> ObjFile.
Rui Ueyama [Wed, 26 Jul 2017 22:13:32 +0000 (22:13 +0000)]
Rename ObjectFile -> ObjFile.

Rename it because it was too easy to conflict with llvm::object::ObjectFile
which broke buildbots several times.

llvm-svn: 309199

7 years ago[lit] Fix shtest-output-printing.py on Windows by matching either / or \\
Reid Kleckner [Wed, 26 Jul 2017 22:11:30 +0000 (22:11 +0000)]
[lit] Fix shtest-output-printing.py on Windows by matching either / or \\

Fixes PR33938

llvm-svn: 309198

7 years ago[ScopInfo] Never print instruction list of region stmts.
Michael Kruse [Wed, 26 Jul 2017 22:01:33 +0000 (22:01 +0000)]
[ScopInfo] Never print instruction list of region stmts.

A region statement's instruction list is always empty and ignored by the code
generator. Don't give the impression that it means anything.

llvm-svn: 309197

7 years ago[Simplify] Do not setInstructions() of region stmts. NFC.
Michael Kruse [Wed, 26 Jul 2017 22:01:28 +0000 (22:01 +0000)]
[Simplify] Do not setInstructions() of region stmts. NFC.

The instruction list is ignored for region statements, there
is no reason to set it.

llvm-svn: 309196

7 years agoAdd branch weights to branches for static initializers.
Richard Smith [Wed, 26 Jul 2017 22:01:09 +0000 (22:01 +0000)]
Add branch weights to branches for static initializers.

The initializer for a static local variable cannot be hot, because it runs at
most once per program. That's not quite the same thing as having a low branch
probability, but under the assumption that the function is invoked many times,
modeling this as a branch probability seems reasonable.

For TLS variables, the situation is less clear, since the initialization side
of the branch can run multiple times in a program execution, but we still
expect initialization to be rare relative to non-initialization uses. It would
seem worthwhile to add a PGO counter along this path to make this estimation
more accurate in future.

For globals with guarded initialization, we don't yet apply any branch weights.
Due to our use of COMDATs, the guard will be reached exactly once per DSO, but
we have no idea how many DSOs will define the variable.

llvm-svn: 309195

7 years ago[lit] Fix discovery.py on Windows by matching backslashes when necessary
Reid Kleckner [Wed, 26 Jul 2017 22:00:38 +0000 (22:00 +0000)]
[lit] Fix discovery.py on Windows by matching backslashes when necessary

Fixes PR33932

llvm-svn: 309194

7 years agoConvert mac file format to unix
Konstantin Zhuravlyov [Wed, 26 Jul 2017 21:59:45 +0000 (21:59 +0000)]
Convert mac file format to unix

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

llvm-svn: 309193

7 years agoFix a comment (test commit).
Hiroshi Yamauchi [Wed, 26 Jul 2017 21:54:43 +0000 (21:54 +0000)]
Fix a comment (test commit).

llvm-svn: 309192

7 years ago[ELF, LinkerScript] Memory region name parsing fix
Meador Inge [Wed, 26 Jul 2017 21:51:09 +0000 (21:51 +0000)]
[ELF, LinkerScript] Memory region name parsing fix

This patch fixes a small issue with respect to how memory region names
are parsed on output section descriptions.  For example, consider:

  .text : { *(.text) } > rom

That can also be written like:

  .text : { *(.text) } >rom

The latter form is accepted by GNU LD and is fairly common.

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

llvm-svn: 309191

7 years ago[lit] Un-XFAIL selecting.py test on Windows
Reid Kleckner [Wed, 26 Jul 2017 21:48:41 +0000 (21:48 +0000)]
[lit] Un-XFAIL selecting.py test on Windows

This passes locally for me, which fails the overall lit test suite. I
can't debug a passing test, but I will try to help debug the test when
we get some failing logs.

llvm-svn: 309190

7 years agoClang and LLVM search for different versions of libxml2, reset found
Eric Beckmann [Wed, 26 Jul 2017 21:47:17 +0000 (21:47 +0000)]
Clang and LLVM search for different versions of libxml2, reset found
variable before each search so that they don't conflict.

llvm-svn: 309189

7 years agoAttempt to fix buildbots.
Rui Ueyama [Wed, 26 Jul 2017 21:37:11 +0000 (21:37 +0000)]
Attempt to fix buildbots.

llvm-svn: 309188

7 years agoRevert r309106 "Recommit r308327 2nd time: Add a warning for missing"
Hans Wennborg [Wed, 26 Jul 2017 21:29:24 +0000 (21:29 +0000)]
Revert r309106 "Recommit r308327 2nd time: Add a warning for missing"

The warning fires on non-suspicious code in Chromium. Reverting until a
solution is figured out.

> Recommit r308327 2nd time: Add a warning for missing
> '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files
>
> The first recommit (r308441) caused a "non-default #pragma pack value might
> change the alignment of struct or union members in the included file" warning
> in LLVM itself. This recommit tweaks the added warning to avoid warnings for
> #includes that don't have any records that are affected by the non-default
> alignment. This tweak avoids the previously emitted warning in LLVM.
>
> Original message:
>
> This commit adds a new -Wpragma-pack warning. It warns in the following cases:
>
> - When a translation unit is missing terminating #pragma pack (pop) directives.
> - When entering an included file if the current alignment value as determined
>   by '#pragma pack' directives is different from the default alignment value.
> - When leaving an included file that changed the state of the current alignment
>   value.
>
> rdar://10184173
>
> Differential Revision: https://reviews.llvm.org/D35484

llvm-svn: 309186

7 years ago[AMDGPU] Optimize SI_IF lowering for simple if regions
Stanislav Mekhanoshin [Wed, 26 Jul 2017 21:29:15 +0000 (21:29 +0000)]
[AMDGPU] Optimize SI_IF lowering for simple if regions

Currently SI_IF results in a s_and_saveexec_b64 followed by s_xor_b64.
The xor is used to extract only the changed bits. In case of a simple
if region where the only use of that value is in the SI_END_CF to
restore the old exec mask, we can omit the xor and perform an or of
the exec mask with the original exec value saved by the
s_and_saveexec_b64.

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

llvm-svn: 309185

7 years ago[ARM] Minor cosmetic edits (NFC)
Evandro Menezes [Wed, 26 Jul 2017 21:28:20 +0000 (21:28 +0000)]
[ARM] Minor cosmetic edits (NFC)

Change the order of a case and the description for Exynos Mx processors.

llvm-svn: 309184

7 years ago[AArch64] Adjust the cost model for Exynos M1 and M2
Evandro Menezes [Wed, 26 Jul 2017 21:28:15 +0000 (21:28 +0000)]
[AArch64] Adjust the cost model for Exynos M1 and M2

Add the information for the scalar reciprocal square root approximation.

llvm-svn: 309183

7 years agoRemove unnecessary namespace specifier.
Rui Ueyama [Wed, 26 Jul 2017 21:24:01 +0000 (21:24 +0000)]
Remove unnecessary namespace specifier.

I believe this compiles fine on all platforms, even on Windows.

llvm-svn: 309182

7 years agoClose if statement in config-ix.cmake while checking for i686 arch.
Eric Beckmann [Wed, 26 Jul 2017 21:20:24 +0000 (21:20 +0000)]
Close if statement in config-ix.cmake while checking for i686 arch.

Reapply "Set a different var for checking I686, because LLVM_NATIVE_ARCH is"

This reverts commit e7400d7cbc2b7539de3aa7a20adc8f4ee0cb7bef.

llvm-svn: 309181

7 years agoAdd liblog to ubsan `UBSAN_DYNAMIC_LIBS`
Leo Li [Wed, 26 Jul 2017 21:16:15 +0000 (21:16 +0000)]
Add liblog to ubsan `UBSAN_DYNAMIC_LIBS`

Summary: liblog is still required to create ubsan runtimes on Android when __ANDROID_API__ < 21.

Reviewers: eugenis, vsk

Subscribers: kubamracek, mgorny, pirama, srhines, llvm-commits

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

llvm-svn: 309180

7 years agoRevert "Set a different var for checking I686, because LLVM_NATIVE_ARCH is"
Eric Beckmann [Wed, 26 Jul 2017 21:11:07 +0000 (21:11 +0000)]
Revert "Set a different var for checking I686, because LLVM_NATIVE_ARCH is"

This reverts commit 38a6db6397364ee91b04afea2cdcb1b5b4d252bf.

llvm-svn: 309179

7 years agoAMDGPU : Widen extending scalar loads to 32-bits.
Wei Ding [Wed, 26 Jul 2017 21:07:28 +0000 (21:07 +0000)]
AMDGPU : Widen extending scalar loads to 32-bits.

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

llvm-svn: 309178

7 years agoSet a different var for checking I686, because LLVM_NATIVE_ARCH is
Eric Beckmann [Wed, 26 Jul 2017 21:03:55 +0000 (21:03 +0000)]
Set a different var for checking I686, because LLVM_NATIVE_ARCH is
overwritten.

llvm-svn: 309177

7 years ago[gold] Relax this tests a little more.
Davide Italiano [Wed, 26 Jul 2017 21:01:57 +0000 (21:01 +0000)]
[gold] Relax this tests a little more.

Thanks to Peter for the report!

llvm-svn: 309176

7 years ago[COFF, ARM64] Handle ADRP immediate offsets in relocations
Martin Storsjo [Wed, 26 Jul 2017 20:51:47 +0000 (20:51 +0000)]
[COFF, ARM64] Handle ADRP immediate offsets in relocations

Also handle overflow correctly in LDR/STR relocations. Even if the
offset range of a 8 byte LDR instruction is 15 bit (even if the immediate
itself is 12 bit) due to a 3 bit shift, only include up to 12 bits of offset
after doing the relocation, by limiting the range of the immediate by the
number of shifted bits.

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

llvm-svn: 309175

7 years ago[gold] Relax tests to account for difference in layout across versions.
Davide Italiano [Wed, 26 Jul 2017 20:40:33 +0000 (20:40 +0000)]
[gold] Relax tests to account for difference in layout across versions.

llvm-svn: 309174

7 years ago[sanitizer-coverage] remove stale code
Kostya Serebryany [Wed, 26 Jul 2017 20:40:25 +0000 (20:40 +0000)]
[sanitizer-coverage] remove stale code

llvm-svn: 309173

7 years agoAMDGPU: Fix using SMRD instructions for argument loads in functions
Matt Arsenault [Wed, 26 Jul 2017 20:39:42 +0000 (20:39 +0000)]
AMDGPU: Fix using SMRD instructions for argument loads in functions

These are not actually uniform values except in kernels.

llvm-svn: 309172

7 years ago[Dominators] Fix typos. NFC.
Jakub Kuderski [Wed, 26 Jul 2017 20:26:13 +0000 (20:26 +0000)]
[Dominators] Fix typos. NFC.

llvm-svn: 309170

7 years agoDisable libxml on i686, because it is a 32 bit architecture and
Eric Beckmann [Wed, 26 Jul 2017 20:22:26 +0000 (20:22 +0000)]
Disable libxml on i686, because it is a 32 bit architecture and
libxml2.so is for 64 bit.

llvm-svn: 309169

7 years agoIntroduce KMP_DEVICE_THREAD_LIMIT
Jonathan Peyton [Wed, 26 Jul 2017 20:07:58 +0000 (20:07 +0000)]
Introduce KMP_DEVICE_THREAD_LIMIT

This change drops in KMP_DEVICE_THREAD_LIMIT to replace KMP_MAX_THREADS. It's
possible there will eventually be a OMP_DEVICE_THREAD_LIMIT, and we need
something to distinguish from OMP_THREAD_LIMIT, which is currently implemented
incorrectly (the fix for that will be added soon in a separate patch).
KMP_ALL_THREADS is deprecated here, but we can keep the "all" option on
KMP_DEVICE_THREAD_LIMIT to support that functionality. KMP_DEVICE_THREAD_LIMIT
now has priority over its deprecated rival KMP_ALL_THREADS. I also cleaned up
some comments that incorrectly referred to non-existent kmp_max_threads variable
instead of kmp_max_nth.

I've left the name of where this setting eventually ends up as
__kmp_max_nth, for now.

This change does not change much in the way of functionality. It does NOT change
OMP_THREAD_LIMIT. It's just cleaning up and setting up for that.

Patch by Terry Wilmarth

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

llvm-svn: 309168

7 years agoAMDGPU/GlobalISel: Mark 32-bit G_OR as legal
Tom Stellard [Wed, 26 Jul 2017 20:00:53 +0000 (20:00 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_OR as legal

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 309165

7 years ago[Simplify] Fix invalid removal write for escaping values.
Michael Kruse [Wed, 26 Jul 2017 19:58:15 +0000 (19:58 +0000)]
[Simplify] Fix invalid removal write for escaping values.

A PHI node's incoming block is the user of its operand, not the PHI's parent.

Assuming the PHINode's parent being the user lead to the removal of a
MemoryAccesses because its use was assumed to be inside of the SCoP.

llvm-svn: 309164

7 years ago[GISel]: Avoid zero length array when building Instrs that don't have
Aditya Nandakumar [Wed, 26 Jul 2017 19:58:03 +0000 (19:58 +0000)]
[GISel]: Avoid zero length array when building Instrs that don't have
uses.

Also splitting the buildSources part allows more overloads such as
adding MachineOperands directly in the arguments for buildInstr.

llvm-svn: 309163

7 years agoTry to fix the windows build.
Rafael Espindola [Wed, 26 Jul 2017 19:57:40 +0000 (19:57 +0000)]
Try to fix the windows build.

llvm-svn: 309162

7 years agoTry to fix the windows build.
Rafael Espindola [Wed, 26 Jul 2017 19:39:40 +0000 (19:39 +0000)]
Try to fix the windows build.

llvm-svn: 309161

7 years agoTry to fix the windows build.
Rafael Espindola [Wed, 26 Jul 2017 19:37:58 +0000 (19:37 +0000)]
Try to fix the windows build.

llvm-svn: 309160

7 years agoChange CallLoweringInfo::CS to be an ImmutableCallSite instead of a pointer. NFCI.
Peter Collingbourne [Wed, 26 Jul 2017 19:15:29 +0000 (19:15 +0000)]
Change CallLoweringInfo::CS to be an ImmutableCallSite instead of a pointer. NFCI.

This was a use-after-free waiting to happen.

llvm-svn: 309159

7 years agoMigrate SimplifyLibCalls to new OptimizationRemarkEmitter
Adam Nemet [Wed, 26 Jul 2017 19:03:18 +0000 (19:03 +0000)]
Migrate SimplifyLibCalls to new OptimizationRemarkEmitter

Summary:
This changes SimplifyLibCalls to use the new OptimizationRemarkEmitter
API.

In fact, as SimplifyLibCalls is only ever called via InstCombine,
(as far as I can tell) the OptimizationRemarkEmitter is added there,
and then passed through to SimplifyLibCalls later.

I have avoided changing any remark text.

This closes PR33787

Patch by Sam Elliott!

Reviewers: anemet, davide

Reviewed By: anemet

Subscribers: davide, mehdi_amini, eraman, fhahn, llvm-commits

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

llvm-svn: 309158

7 years agoThis patch returns proper value to indicate the case when instruction throughput...
Andrew V. Tischenko [Wed, 26 Jul 2017 18:55:14 +0000 (18:55 +0000)]
This patch returns proper value to indicate the case when instruction throughput can't be calculated.
Differential revision https://reviews.llvm.org/D35831

llvm-svn: 309156

7 years ago[OpenCL] Fix access qualifiers metadata for kernel arguments with typedef
Alexey Sotkin [Wed, 26 Jul 2017 18:49:54 +0000 (18:49 +0000)]
[OpenCL] Fix access qualifiers metadata for kernel arguments with typedef

Subscribers: cfe-commits, yaxunl, Anastasia

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

llvm-svn: 309155

7 years agoDo a better job at emitting prefrabricated skeleton CUs.
Adrian Prantl [Wed, 26 Jul 2017 18:48:32 +0000 (18:48 +0000)]
Do a better job at emitting prefrabricated skeleton CUs.

This is a better fix than r308708 for the problem introduced in
r304020. It restores the skeleton CU testcases modified by that commit
to their original form and most importantly ensures that
frontend-generated skeleton CUs (such as used to point to Clang
modules) come after the regular CUs. This broke for DICompileUnit
nodes that don't have any immediate children because they are now
constructed lazily instead of the order in which they are listed in
!llvm.dbg.cu. After this commit we still don't guarantee that order,
but we do guarantee that empty skeletons come last.

Shipping versions of LLDB are very sensitive to the ordering of
CUs. I'll track a fix for LLDB to be more permissive separately.
This fixes a test failure in the LLDB testsuite.

rdar://problem/33357252

llvm-svn: 309154

7 years agoSimplify. NFC.
Rafael Espindola [Wed, 26 Jul 2017 18:47:49 +0000 (18:47 +0000)]
Simplify. NFC.

llvm-svn: 309153

7 years agoDetemplate SymbolTable.
Rafael Espindola [Wed, 26 Jul 2017 18:42:48 +0000 (18:42 +0000)]
Detemplate SymbolTable.

NFC, just makes it easier to access from non templated code.

llvm-svn: 309152

7 years agoUnlink nodes instead of copying, to avoid memory problems.
Eric Beckmann [Wed, 26 Jul 2017 18:33:21 +0000 (18:33 +0000)]
Unlink nodes instead of copying, to avoid memory problems.

llvm-svn: 309151

7 years ago[Dominators] Change Roots type to SmallVector
Jakub Kuderski [Wed, 26 Jul 2017 18:27:39 +0000 (18:27 +0000)]
[Dominators] Change Roots type to SmallVector

Summary: We can use the template parameter `IsPostDom` to pick an appropriate SmallVector size to store DomTree roots for dominators and postdominators. Before, the code would always allocate memory with `std::vector`.

Reviewers: dberlin, davide, sanjoy, grosser

Reviewed By: grosser

Subscribers: llvm-commits

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

llvm-svn: 309148

7 years agoPartial fix for PR33858
Jonathan Roelofs [Wed, 26 Jul 2017 18:13:57 +0000 (18:13 +0000)]
Partial fix for PR33858

https://reviews.llvm.org/D35848

llvm-svn: 309147

7 years ago[Dominators] Move root-finding out of DomTreeBase and simplify it
Jakub Kuderski [Wed, 26 Jul 2017 18:07:40 +0000 (18:07 +0000)]
[Dominators] Move root-finding out of DomTreeBase and simplify it

Summary:
This patch moves root-finding logic from DominatorTreeBase to GenericDomTreeConstruction.h.
It makes the behavior simpler and more consistent by always adding a virtual root to PostDominatorTrees.

Reviewers: dberlin, davide, grosser, sanjoy

Reviewed By: dberlin

Subscribers: llvm-commits

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

llvm-svn: 309146

7 years agoAdd bitrig removal to release notes
Erich Keane [Wed, 26 Jul 2017 18:04:45 +0000 (18:04 +0000)]
Add bitrig removal to release notes

llvm-svn: 309145

7 years agoUn-XFAIL some internal lit tests on Windows, they pass for me locally
Reid Kleckner [Wed, 26 Jul 2017 18:04:18 +0000 (18:04 +0000)]
Un-XFAIL some internal lit tests on Windows, they pass for me locally

llvm-svn: 309144

7 years agoDiffing against a file that is itself used in the test seems to be a bad
Eric Beckmann [Wed, 26 Jul 2017 17:47:44 +0000 (17:47 +0000)]
Diffing against a file that is itself used in the test seems to be a bad
idea, because it might get locked down and rendered unopenable.

llvm-svn: 309142

7 years agoSimplify. NFC.
Rafael Espindola [Wed, 26 Jul 2017 17:27:27 +0000 (17:27 +0000)]
Simplify. NFC.

llvm-svn: 309141

7 years agoFix LIT test breakage
George Karpenkov [Wed, 26 Jul 2017 17:19:36 +0000 (17:19 +0000)]
Fix LIT test breakage

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

llvm-svn: 309140

7 years ago[X86][AVX512] Regenerated and cleaned up extension tests.
Simon Pilgrim [Wed, 26 Jul 2017 16:47:00 +0000 (16:47 +0000)]
[X86][AVX512] Regenerated and cleaned up extension tests.

llvm-svn: 309139

7 years ago[X86] Regenerate setcc tests
Simon Pilgrim [Wed, 26 Jul 2017 16:45:57 +0000 (16:45 +0000)]
[X86] Regenerate setcc tests

llvm-svn: 309138

7 years ago[X86][AVX512] Regenerate shuffle tests with broadcast comments.
Simon Pilgrim [Wed, 26 Jul 2017 16:41:18 +0000 (16:41 +0000)]
[X86][AVX512] Regenerate shuffle tests with broadcast comments.

llvm-svn: 309137

7 years ago[X86] Regenerate memset tests
Simon Pilgrim [Wed, 26 Jul 2017 16:39:07 +0000 (16:39 +0000)]
[X86] Regenerate memset tests

llvm-svn: 309136

7 years agoCorrectly enable the llvm-mt tests, now that build flags changed.
Eric Beckmann [Wed, 26 Jul 2017 16:35:44 +0000 (16:35 +0000)]
Correctly enable the llvm-mt tests, now that build flags changed.

llvm-svn: 309134

7 years agoQuote '?' in llvm-rc test
Reid Kleckner [Wed, 26 Jul 2017 16:25:48 +0000 (16:25 +0000)]
Quote '?' in llvm-rc test

Summary:
Bash interperets the '?' character as matching an arbitrary character.
On systems that have a file or directory with exactly one character in
their root directory, '/?' gets reinterpreted into that pathname, which
fails to match the expected Help text for llvm-rc.
This patch quotes the '/?' to avoid that edge case.

Reviewers: mnbvmar, ecbeckmann, rnk

Reviewed By: rnk

Subscribers: dyung, ruiu, llvm-commits

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

llvm-svn: 309133

7 years ago[Hexagon] Mark raise_relocation_error as NORETURN.
Florian Hahn [Wed, 26 Jul 2017 16:07:51 +0000 (16:07 +0000)]
[Hexagon] Mark raise_relocation_error as NORETURN.

Summary:
This silences a couple of implicit fallthrough warnings with GCC 7.1 in
this file.

Reviewers: colinl, kparzysz

Reviewed By: kparzysz

Subscribers: llvm-commits

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

llvm-svn: 309129

7 years agoUpdate the assertion to meet with the changes in r309121. (NFC)
Dehao Chen [Wed, 26 Jul 2017 15:47:00 +0000 (15:47 +0000)]
Update the assertion to meet with the changes in r309121. (NFC)

llvm-svn: 309125

7 years ago[X86] Add combineBT test failure because bits have multiple uses.
Simon Pilgrim [Wed, 26 Jul 2017 15:41:57 +0000 (15:41 +0000)]
[X86] Add combineBT test failure because bits have multiple uses.

llvm-svn: 309124

7 years ago[lit] Mark several of lit's tests XFAIL on Windows
Brian Gesiak [Wed, 26 Jul 2017 15:10:50 +0000 (15:10 +0000)]
[lit] Mark several of lit's tests XFAIL on Windows

Summary:
rL257221 attempted to run lit's own test suite continuously, but that
commit was reverted because lit's test suite does not pass on Windows.
Because lit's tests do not run continuously, they often regress.

In order to un-revert rL257221, mark lit tests that fail as XFAIL for
Windows platforms.

Test Plan:
On a Windows development environment, follow the instructions in
utils/lit/README.txt to run lit's test suite:

```
utils/lit/lit.py \
    --path /path/to/your/llvm/build/bin \
    utils/lit/tests
```

Verify that the test suite is run and a successful exit code is
returned.

Reviewers: mgorny, rnk, delcypher, beanz

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 309123

7 years ago[lit] Fix type error for parallelism groups
Brian Gesiak [Wed, 26 Jul 2017 15:02:05 +0000 (15:02 +0000)]
[lit] Fix type error for parallelism groups

Summary:
Whereas rL299560 and rL309071 call `parallelism_groups.items()`, under the
assumption that `parallelism_groups` is a `dict` type, the default
parameter for that attribute is a `list`. Change the default to a
`dict` for type correctness.

This regression in the unit tests would have been caught if the
unit tests were being run continously. It also would have been caught
if the lit project used a Python type checker such as `mypy`.

Test Plan:
As per the instructions in `utils/lit/README.txt`, run the lit unit
test suite:

```
utils/lit/lit.py \
    --path /path/to/your/llvm/build/bin \
    utils/lit/tests
```

Verify that the test `lit :: unit/TestRunner.py` fails before applying this
patch, but passes once this patch is applied.

Reviewers: mgorny, rnk, rafael

Reviewed By: mgorny

Subscribers: llvm-commits

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

llvm-svn: 309122

7 years agoMake new PM honor -fdebug-info-for-profiling
Dehao Chen [Wed, 26 Jul 2017 15:01:20 +0000 (15:01 +0000)]
Make new PM honor -fdebug-info-for-profiling

Summary: The new PM needs to invoke add-discriminator pass when building with -fdebug-info-for-profiling.

Reviewers: chandlerc, davidxl

Reviewed By: chandlerc

Subscribers: sanjoy, llvm-commits

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

llvm-svn: 309121

7 years agoRevert "[lit] Remove dead code not referenced in the LLVM SVN repo."
Brian Gesiak [Wed, 26 Jul 2017 14:59:36 +0000 (14:59 +0000)]
Revert "[lit] Remove dead code not referenced in the LLVM SVN repo."

Summary:
This reverts rL306623, which removed `FileBasedTest`, an abstract base class,
but did not also remove the usages of that class in the lit unit tests.
The revert fixes four test failures in the lit unit test suite.

Test plan:
As per the instructions in `utils/lit/README.txt`, run the lit unit
test suite:

```
utils/lit/lit.py \
    --path /path/to/your/llvm/build/bin \
    utils/lit/tests
```

Verify that the following tests fail before applying this patch, and
pass once the patch is applied:

```
lit :: test-data.py
lit :: test-output.py
lit :: xunit-output.py
```

In addition, run `check-llvm` to make sure the existing LLVM test suite
executes normally.

Reviewers: george.karpenkov, mgorny, dlj

Reviewed By: mgorny

Subscribers: llvm-commits

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

llvm-svn: 309120

7 years ago[ScheduleOptimizer] Translate to C++ bindings
Roman Gareev [Wed, 26 Jul 2017 14:59:15 +0000 (14:59 +0000)]
[ScheduleOptimizer] Translate to C++ bindings

Translate the ScheduleOptimizer to use the new isl C++ bindings.

Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D35845

llvm-svn: 309119

7 years agoRegression test for PR10856
Serge Pavlov [Wed, 26 Jul 2017 14:58:55 +0000 (14:58 +0000)]
Regression test for PR10856

llvm-svn: 309118

7 years ago[docs] change a few code-blocks to llvm from text
Nuno Lopes [Wed, 26 Jul 2017 14:11:23 +0000 (14:11 +0000)]
[docs] change a few code-blocks to llvm from text

llvm-svn: 309117

7 years agounguarded availability: add a fixit for the "annotate '...'
Alex Lorenz [Wed, 26 Jul 2017 13:58:02 +0000 (13:58 +0000)]
unguarded availability: add a fixit for the "annotate '...'
with an availability attribute to silence" note

rdar://33539233

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

llvm-svn: 309116

7 years ago[CMake] Disable building libomptarget and add CMake switch
Jonas Hahnfeld [Wed, 26 Jul 2017 13:55:00 +0000 (13:55 +0000)]
[CMake] Disable building libomptarget and add CMake switch

Introduce OPENMP_ENABLE_LIBOMPTARGET which defaults to OFF at the moment.

libomptarget is not yet ready for prime time:
 - Offloading to NVIDIA GPUs is not completed yet (compiler, device RTL)
 - The generic ELF plugin for offloading to the host (meant for testing)
   uses a single instance of the OpenMP runtime (libomp). That is why
   omp_is_initial_device() returns 1 which makes the tests fail.
Because of these reasons, we want to disable building (and testing!)
for release 5.0.

See https://bugs.llvm.org/show_bug.cgi?id=33859

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

llvm-svn: 309115

7 years ago[NFC] test commit.
Stefan Pintilie [Wed, 26 Jul 2017 13:44:59 +0000 (13:44 +0000)]
[NFC] test commit.

Added a comment to explain how to add a PPCISD node.

llvm-svn: 309114

7 years ago[Bash-autocompletion] Show HelpText with possible flags
Yuka Takahashi [Wed, 26 Jul 2017 13:36:58 +0000 (13:36 +0000)]
[Bash-autocompletion] Show HelpText with possible flags

Summary:
`clang --autocomplete=-std` will show
```
-std:   Language standard to compile for
-std=   Language standard to compile for
-stdlib=        C++ standard library to use
```
after this change.

However, showing HelpText with completion in bash seems super tricky, so
this feature will be used in other shells (fish, zsh...).

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: cfe-commits, hiraditya

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

llvm-svn: 309113

7 years ago[Bash-completion] Fixed a bug that file doesn't autocompleted after =
Yuka Takahashi [Wed, 26 Jul 2017 13:30:36 +0000 (13:30 +0000)]
[Bash-completion] Fixed a bug that file doesn't autocompleted after =

Summary:
File path wasn't autocompleted after `-fmodule-cache-path=[tab]`, so
fixed this bug by checking if $flags contains only a newline or not.

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

llvm-svn: 309112

7 years agoRevert r309094: [globalisel][tablegen] Fuse the generated tables together.
Daniel Sanders [Wed, 26 Jul 2017 13:28:40 +0000 (13:28 +0000)]
Revert r309094: [globalisel][tablegen] Fuse the generated tables together.

The ARM bots have started failing and while this patch should be an improvement
for these bots, it's also the only suspect in the blamelist. Reverting while
Diana and I investigate the problem.

llvm-svn: 309111

7 years ago[ScopInfo] Avoid use of getStmtFor(BB). NFC.
Michael Kruse [Wed, 26 Jul 2017 13:25:28 +0000 (13:25 +0000)]
[ScopInfo] Avoid use of getStmtFor(BB). NFC.

Since there will be no more a 1:1 correspondence between statements and
basic blocks, we would like to get rid of the method getStmtFor(BB)
and its uses. Here we remove one of its uses in ScopInfo by fetching
the statement in which the call instruction lies.

Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in>
Differential Revision: https://reviews.llvm.org/D35691

llvm-svn: 309110

7 years ago[SCEVValidator] Loop exit values of loops before the SCoP are synthesizable.
Michael Kruse [Wed, 26 Jul 2017 13:05:45 +0000 (13:05 +0000)]
[SCEVValidator] Loop exit values of loops before the SCoP are synthesizable.

 In the following loop:

   int i;
   for (i = 0; i < func(); i+=1)
     ;
SCoP:
   for (int j = 0; j<n; j+=1)
     S(i, j)

The value i is synthesizable in the SCoP that includes only the j-loop.
This is because i is fixed within the SCoP, it is irrelevant whether
it originates from another loop.

This fixes a strange case where a PHI was synthesiable in a SCoP,
but not its incoming value, triggering an assertion.

This should fix MultiSource/Applications/sgefa/sgefa of the
perf-x86_64-penryn-O3-polly-before-vectorizer-unprofitable buildbot.

llvm-svn: 309109

7 years agoDAGCombiner: Extend reduceBuildVecToTrunc to handle non-zero offset
Zvi Rackover [Wed, 26 Jul 2017 12:57:03 +0000 (12:57 +0000)]
DAGCombiner: Extend reduceBuildVecToTrunc to handle non-zero offset

Summary:
Adding support for combining power2-strided build_vector's where the
first build_vectori's operand is extracted from a non-zero index.

Example:

 v4i32 build_vector((extract_elt V, 1),
                    (extract_elt V, 3),
                    (extract_elt V, 5),
                    (extract_elt V, 7))
 -->
 v4i32 truncate (bitcast (shuffle<1,u,3,u,5,u,7,u> V, u) to v4i64)

Reviewers: delena, RKSimon, guyblank

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 309108

7 years ago[X86] Regenerated BT tests
Simon Pilgrim [Wed, 26 Jul 2017 12:49:20 +0000 (12:49 +0000)]
[X86] Regenerated BT tests

Test on 32/64 bit targets where appropriate

llvm-svn: 309107

7 years agoRecommit r308327 2nd time: Add a warning for missing
Alex Lorenz [Wed, 26 Jul 2017 12:20:57 +0000 (12:20 +0000)]
Recommit r308327 2nd time: Add a warning for missing
'#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files

The first recommit (r308441) caused a "non-default #pragma pack value might
change the alignment of struct or union members in the included file" warning
in LLVM itself. This recommit tweaks the added warning to avoid warnings for
#includes that don't have any records that are affected by the non-default
alignment. This tweak avoids the previously emitted warning in LLVM.

Original message:

This commit adds a new -Wpragma-pack warning. It warns in the following cases:

- When a translation unit is missing terminating #pragma pack (pop) directives.
- When entering an included file if the current alignment value as determined
  by '#pragma pack' directives is different from the default alignment value.
- When leaving an included file that changed the state of the current alignment
  value.

rdar://10184173

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

llvm-svn: 309106

7 years ago[COFF, ARM64] Fix symbol offsets in ADRP/ADD/LDR/STR relocations
Martin Storsjo [Wed, 26 Jul 2017 11:19:17 +0000 (11:19 +0000)]
[COFF, ARM64] Fix symbol offsets in ADRP/ADD/LDR/STR relocations

In COFF, a symbol offset can't be stored in the relocation (as is
done in ELF or MachO), but is stored as the immediate in the
instruction itself. The immediate in the ADRP thus is the symbol
offset in bytes, not in pages. For the PAGEOFFSET_12A/L relocations,
ignore any offset outside of the lowest 12 bits; they won't have any
effect on the ADD/LDR/STR instruction itself but only on the associated
ADRP.

This is similar to how the same issue is handled for MOVW/MOVT
instructions in ELF (see e.g. SVN r307713, and r307728 in lld).

This fixes "fixup out of range" errors while building larger object
files, where temporary symbols end up as a plain section symbol and
an offset, and fixes any cases where the symbol offset mean that
the actual target ended up on a different page than the symbol
itself.

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

llvm-svn: 309105