George Rimar [Tue, 9 Aug 2016 10:57:42 +0000 (10:57 +0000)]
[ELF] - Removed dead code. NFC.
llvm-svn: 278115
Simon Pilgrim [Tue, 9 Aug 2016 10:56:29 +0000 (10:56 +0000)]
[X86][XOP] Add support for combining target shuffles to VPPERM
llvm-svn: 278114
Dean Michael Berris [Tue, 9 Aug 2016 10:42:11 +0000 (10:42 +0000)]
[XRay] Test for xray_instr_map in object file. (NFC)
This makes a trivial change in the emission of the per-function XRay
tables, and makes sure that the xray_instr_map section does show up in
the object file.
llvm-svn: 278113
Kirill Bobyrev [Tue, 9 Aug 2016 10:03:33 +0000 (10:03 +0000)]
[clang-rename] cleanup: use isWritten
nit: use isWritten and const auto *Initializer in
NamedDeclFindingASTVisitor::VisitCXXConstructorDecl method.
Test plan: make -j8 check-clang-tools (passed)
Patch by Alexander Shaposhnikov!
Reviewers: omtcyfz
Differential Revision: https://reviews.llvm.org/D23298
llvm-svn: 278112
Simon Pilgrim [Tue, 9 Aug 2016 10:02:11 +0000 (10:02 +0000)]
Fix Wdocumentation unknown parameter warning
llvm-svn: 278111
Vassil Vassilev [Tue, 9 Aug 2016 10:00:23 +0000 (10:00 +0000)]
[analyzer] Try to fix coverity CID 1360469.
Patch by Raphael Isemann!
llvm-svn: 278110
Artur Pilipenko [Tue, 9 Aug 2016 10:00:22 +0000 (10:00 +0000)]
Revert 278107 which causes buildbot failures and in addition has wrong commit message
llvm-svn: 278109
Vassil Vassilev [Tue, 9 Aug 2016 09:46:11 +0000 (09:46 +0000)]
[modules]Add missing include.
llvm-svn: 278108
Artur Pilipenko [Tue, 9 Aug 2016 09:41:34 +0000 (09:41 +0000)]
Teach CorrelatedValuePropagation to mark adds as no wrap
Use LVI to prove that adds do not wrap. The change is motivated by https://llvm.org/bugs/show_bug.cgi?id=28620 bug and it's the first step to fix that problem.
Reviewed By: sanjoy
Differential Revision: http://reviews.llvm.org/D23059
llvm-svn: 278107
Simon Pilgrim [Tue, 9 Aug 2016 09:32:34 +0000 (09:32 +0000)]
[X86][SSE] Fix memory folding of (v)roundsd / (v)roundss
We only had partial memory folding support for the intrinsic definitions, and (as noted on PR27481) was causing FR32/FR64/VR128 mismatch errors with the machine verifier.
This patch adds missing memory folding support for both intrinsics and the ffloor/fnearbyint/fceil/frint/ftrunc patterns and in doing so fixes the failing machine verifier stack folding tests from PR27481.
Differential Revision: https://reviews.llvm.org/D23276
llvm-svn: 278106
Artur Pilipenko [Tue, 9 Aug 2016 09:14:29 +0000 (09:14 +0000)]
[LVI] NFC. Fix a typo Bofore -> Before
llvm-svn: 278105
Tobias Grosser [Tue, 9 Aug 2016 09:11:39 +0000 (09:11 +0000)]
[tests] Add two missing 'REQUIRES' lines
llvm-svn: 278104
Tobias Grosser [Tue, 9 Aug 2016 08:59:05 +0000 (08:59 +0000)]
[BlockGenerator] Also eliminate dead code not originating from BB
After having generated the code for a ScopStmt, we run a simple dead-code
elimination that drops all instructions that are known to be and remain unused.
Until this change, we only considered instructions for dead-code elimination, if
they have a corresponding instruction in the original BB that belongs to
ScopStmt. However, when generating code we do not only copy code from the BB
belonging to a ScopStmt, but also generate code for operands referenced from BB.
After this change, we now also considers code for dead code elimination, which
does not have a corresponding instruction in BB.
This fixes a bug in Polly-ACC where such dead-code referenced CPU code from
within a GPU kernel, which is possible as we do not guarantee that all variables
that are used in known-dead-code are moved to the GPU.
llvm-svn: 278103
Haojian Wu [Tue, 9 Aug 2016 08:26:19 +0000 (08:26 +0000)]
[include-fixer] Support processing multiple files in one run.
Summary:
Previously, if we pass multiple files or a file pattern (e.g. /path/to/*.cc) to
include-fixer, include-fixer will apply all replacements to the first argument,
which probably causes crashes.
With this patch, include-fixer can process multiple files now.
Vim and Emacs integration are tested manually.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23266
llvm-svn: 278102
Eric Liu [Tue, 9 Aug 2016 07:54:49 +0000 (07:54 +0000)]
Fix clang-tidy crash when a single fix is applied on multiple files.
Summary:
tooling::Replacements only holds replacements for a single file, so
this patch makes Fix a map from file paths to tooling::Replacements so that it
can be applied on multiple files.
Reviewers: hokein, alexfh
Subscribers: Prazek, cfe-commits
Differential Revision: https://reviews.llvm.org/D23257
llvm-svn: 278101
Tobias Grosser [Tue, 9 Aug 2016 07:22:08 +0000 (07:22 +0000)]
[GPGPU] Pass parameters always by using their own type
llvm-svn: 278100
Kirill Bobyrev [Tue, 9 Aug 2016 07:14:48 +0000 (07:14 +0000)]
[clang-rename] fix bug with initializer lists
Clang-rename is currently not able to find a symbol in initializer list. This
patch fixes described issue.
Reviewers: alexfh
Differential Revision: https://reviews.llvm.org/D23193
llvm-svn: 278099
Craig Topper [Tue, 9 Aug 2016 05:26:09 +0000 (05:26 +0000)]
[X86] Reduce duplicated code in the execution domain lookup functions by passing tables as an argument.
llvm-svn: 278098
Craig Topper [Tue, 9 Aug 2016 05:26:07 +0000 (05:26 +0000)]
[AVX-512] Add support for execution domain switching masked logical ops between floating point and integer domain.
This switches PS<->D and PD<->Q.
llvm-svn: 278097
Rui Ueyama [Tue, 9 Aug 2016 04:50:26 +0000 (04:50 +0000)]
Remove unreachable `return`. NFC.
llvm-svn: 278096
Rui Ueyama [Tue, 9 Aug 2016 04:42:01 +0000 (04:42 +0000)]
Remove isOutputDynamic and use Out<ELFT>::DynSymTab instead.
This patch is to not instantiate DynSymTab and DynStrTab if the
output is not a dynamic output.
llvm-svn: 278095
Rui Ueyama [Tue, 9 Aug 2016 04:31:21 +0000 (04:31 +0000)]
Remove redundant variable.
llvm-svn: 278094
Rui Ueyama [Tue, 9 Aug 2016 04:25:20 +0000 (04:25 +0000)]
Separate {Preinit,Init,Fini}Arrays from Out<ELFT>::Dynamic.
Even if an output is not a dynamic object, the output may have
.{preinit,init,fini} sections. Therefore, managing these sections
as Out<ELFT>::Dynamic's members is not correct.
llvm-svn: 278093
Xinliang David Li [Tue, 9 Aug 2016 04:21:14 +0000 (04:21 +0000)]
[Profile] Implement new API __llvm_profile_dump
The API is intended to be used by user to do fine
grained (per-region) control of profile dumping.
Differential Revision: http://reviews.llvm.org/D23106
llvm-svn: 278092
Rui Ueyama [Tue, 9 Aug 2016 03:38:23 +0000 (03:38 +0000)]
Do not pass the SymbolTable to writeResult.
The SymbolTable is always accessible as Symtab<ELFT>::X,
so no need to pass it as an argument.
llvm-svn: 278091
Craig Topper [Tue, 9 Aug 2016 03:06:33 +0000 (03:06 +0000)]
[X86] Remove the Fv packed logical operation alias instructions. Replace them with patterns to the regular instructions.
This enables execution domain fixing which is why the tests changed.
llvm-svn: 278090
Craig Topper [Tue, 9 Aug 2016 03:06:28 +0000 (03:06 +0000)]
[X86] Cleanup patterns for AVX/SSE for PS operations. Always try to look for bitcasts from floating point types. If only AVX1 is supported we also need to handle integer types with floating point ops without looking for bitcasts.
Previously SSE1 had a pattern that looked for integer types without bitcasts, but the type wasn't legal with only SSE1 and SSE2 add an identical pattern for the integer instructions.
llvm-svn: 278089
Craig Topper [Tue, 9 Aug 2016 03:06:26 +0000 (03:06 +0000)]
[X86] Remove unnecessary bitcast from the front of AVX1Only 256-bit logical operation patterns.
llvm-svn: 278088
Eric Fiselier [Tue, 9 Aug 2016 03:05:43 +0000 (03:05 +0000)]
Remove *super* old test suite results doc for Linux and Windows.
Neither of these results files has been update in years. Linux now has a dozen
or so buildbots tracking it and the Windows results are no longer relevant.
I plan on looking into getting a Windows buildbot going using Appveyor in the
coming days.
llvm-svn: 278087
Matthias Braun [Tue, 9 Aug 2016 01:47:26 +0000 (01:47 +0000)]
X86InstrInfo: Update liveness in classifyLea()
We need to update liveness information when we create COPYs in
classifyLea().
This fixes http://llvm.org/28301
llvm-svn: 278086
Rui Ueyama [Tue, 9 Aug 2016 01:35:39 +0000 (01:35 +0000)]
Remove redundant local variable.
llvm-svn: 278085
Rui Ueyama [Tue, 9 Aug 2016 01:35:38 +0000 (01:35 +0000)]
Reduce dependency to OutputSectionFactory.
The Factory class is too object-oriented-ish and easy to be abused.
This patch reduces dependency to that class. Eventually we want to
remove the dependency to that class from LinkerScript.
llvm-svn: 278084
Rui Ueyama [Tue, 9 Aug 2016 01:35:37 +0000 (01:35 +0000)]
Do not initialize Out<ELFT>::Opd until needed.
This change makes it clear that we need the variable only within
writeSections.
llvm-svn: 278083
Derek Schuff [Tue, 9 Aug 2016 00:29:55 +0000 (00:29 +0000)]
[WebAssembly] Fix bugs in WebAssemblyLowerEmscriptenExceptions pass
* Delete extra '_' prefixes from JS library function names. fixImports()
function in JS glue code deals with this for wasm.
* Change command-line option names in order to be consistent with
asm.js.
* Add missing lowering code for llvm.eh.typeid.for intrinsics
* Delete commas in mangled function names
* Fix a function argument attributes bug. Because we add the pointer to
the original callee as the first argument of invoke wrapper, all
argument attribute indices have to be incremented by one.
Patch by Heejin Ahn
Differential Revision: https://reviews.llvm.org/D23258
llvm-svn: 278081
Sean Silva [Tue, 9 Aug 2016 00:28:56 +0000 (00:28 +0000)]
Consistently use CGSCCAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.
Thanks to David for the suggestion.
llvm-svn: 278080
Sean Silva [Tue, 9 Aug 2016 00:28:52 +0000 (00:28 +0000)]
Consistently use LoopAnalysisManager
One exception here is LoopInfo which must forward-declare it (because
the typedef is in LoopPassManager.h which depends on LoopInfo).
Also, some includes for LoopPassManager.h were needed since that file
provides the typedef.
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.
Thanks to David for the suggestion.
llvm-svn: 278079
Sean Silva [Tue, 9 Aug 2016 00:28:38 +0000 (00:28 +0000)]
Consistently use ModuleAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.
Thanks to David for the suggestion.
llvm-svn: 278078
Sean Silva [Tue, 9 Aug 2016 00:28:15 +0000 (00:28 +0000)]
Consistently use FunctionAnalysisManager
Besides a general consistently benefit, the extra layer of indirection
allows the mechanical part of https://reviews.llvm.org/D23256 that
requires touching every transformation and analysis to be factored out
cleanly.
Thanks to David for the suggestion.
llvm-svn: 278077
Petr Hosek [Tue, 9 Aug 2016 00:27:19 +0000 (00:27 +0000)]
Add lib directory to linker paths when using libunwind
When using libunwind and not building as standalone project, we
need to add LLVM library directory to the list of linker directories
to ensure it can find libunwind dependency.
Differential Revision: https://reviews.llvm.org/D23287
llvm-svn: 278076
Saleem Abdulrasool [Tue, 9 Aug 2016 00:25:12 +0000 (00:25 +0000)]
CodeView: extract the OMF Directory Header
The DebugDirectory contains a pointer to the CodeView info structure which is a
derivative of the OMF debug directory. The structure has evolved a bit over
time, and PDB 2.0 used a slightly different definition from PDB 7.0. Both of
these are specific to CodeView and not COFF. Reflect this by moving the
structure definitions into the DebugInfo/CodeView headers. Define a generic
DebugInfo union type that can be used to pass around a reference to the
DebugInfo irrespective of the versioning. NFC.
llvm-svn: 278075
Sanjay Patel [Tue, 9 Aug 2016 00:01:11 +0000 (00:01 +0000)]
[x86] split combineVSelectWithAllOnesOrZeros into a helper function; NFCI
llvm-svn: 278074
Derek Schuff [Mon, 8 Aug 2016 23:56:01 +0000 (23:56 +0000)]
[WebAssembly] Fix CFI index to account for padding nullptr function
The WebAssembly linker now creates a dummy function at index 0 to
prevent miscomparisons with the NULL pointer, see
https://github.com/WebAssembly/binaryen/pull/658. Thanks to pcc for
pointing out this problem!
Patch by Dominic Chen
Differential Revision: https://reviews.llvm.org/D23137
llvm-svn: 278073
Pete Cooper [Mon, 8 Aug 2016 23:20:04 +0000 (23:20 +0000)]
The first string table entry should be a null terminated space, not just null.
This matches the behaviour of ld64 which initializes the string table with
' ' then '\0'. lld only had the '\0' and needed the ' '.
llvm-svn: 278071
Rui Ueyama [Mon, 8 Aug 2016 23:07:03 +0000 (23:07 +0000)]
Revert "Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present."
This reverts commit r278066 to unbreak buildbots.
llvm-svn: 278070
Lang Hames [Mon, 8 Aug 2016 22:57:30 +0000 (22:57 +0000)]
Revert r278065 while I investigate some build-bot breakage.
llvm-svn: 278069
Petr Hosek [Mon, 8 Aug 2016 22:57:25 +0000 (22:57 +0000)]
Allow building both shared and static library
This change allows building both shared and static version of libc++
in a single build, sharing object files between both versions.
Differential Revision: https://reviews.llvm.org/D23232
llvm-svn: 278068
Petr Hosek [Mon, 8 Aug 2016 22:55:48 +0000 (22:55 +0000)]
Allow building both shared and static library
This change allows building both shared and static version of libunwind
in a single build, sharing object files between both versions.
Differential Revision: https://reviews.llvm.org/D23233
llvm-svn: 278067
Rui Ueyama [Mon, 8 Aug 2016 22:54:22 +0000 (22:54 +0000)]
Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not present.
Attribute SizeOfOptionalHeader is ignored if no PE header is present
in the file. This attribute should be ignored according to standard,
however there are uses of this field even though it should not be used.
This change does not conform to PE/COFF standard, but there are several
COFF files without PE header, where you had to add up SizeOfOptionalHeader
in order to get proper section headers. Other tools and their own parsers
do take this into account.
Patch by Marek Milkovič!
https://reviews.llvm.org/D22750
llvm-svn: 278066
Lang Hames [Mon, 8 Aug 2016 22:53:37 +0000 (22:53 +0000)]
[RuntimeDyld][Orc][MCJIT] Add partial weak-symbol support to RuntimeDyld.
This patch causes RuntimeDyld to check for existing definitions when it
encounters weak symbols. If a definition already exists then the new weak
definition is discarded. All symbol lookups within a "logical dylib" should now
agree on the address of any given weak symbol. This allows the JIT to better
match the behavior of the static linker for C++ code.
This support is only partial, as it does not allow strong definitions that
occur after the first weak definition (in JIT symbol lookup order) to override
the previous weak definitions. Support for this will be added in a future
patch.
llvm-svn: 278065
Greg Clayton [Mon, 8 Aug 2016 22:48:57 +0000 (22:48 +0000)]
Garbage collection is not around anymore, we can remove our support for it.
llvm-svn: 278064
Greg Clayton [Mon, 8 Aug 2016 22:48:07 +0000 (22:48 +0000)]
Fix more RegisterInfo initialization issues and quiet hundreds of warnings.
llvm-svn: 278063
Michael Kruse [Mon, 8 Aug 2016 22:39:32 +0000 (22:39 +0000)]
[ScopDetection] Remove unused DetectionContexts during expansion.
The function expandRegion() frees Region* objects again when it determines that
these are not valid SCoPs. However, the DetectionContext added to the
DetectionContextMap still holds a reference. The validity is checked using the
ValidRegions lookup table. When a new Region is added to that list, it might
share the same address, such that the DetectionContext contains two
Region* associations that are in ValidRegions, but that are unrelated and of
which one has already been free.
Also remove the DetectionContext when not a valid expansion.
llvm-svn: 278062
Greg Clayton [Mon, 8 Aug 2016 22:16:03 +0000 (22:16 +0000)]
Fix printf warnings.
llvm-svn: 278061
Greg Clayton [Mon, 8 Aug 2016 22:15:35 +0000 (22:15 +0000)]
Fix RegisterInfo initializers to have all the required initializers after recent changes. This quiets a few hundred warnings on MacOSX.
llvm-svn: 278060
Petr Hosek [Mon, 8 Aug 2016 22:09:54 +0000 (22:09 +0000)]
Do not depend on unwind when building standalone
When libcxxabi is being built standalone, unwind dependency is not
available, so do not use it even when LLVM unwinder is being
requested.
Differential Revision: https://reviews.llvm.org/D23228
llvm-svn: 278058
Saleem Abdulrasool [Mon, 8 Aug 2016 22:02:44 +0000 (22:02 +0000)]
COFF: handle /debugtype option
Add the support infrastructure for the /debugtype option which takes a comma
delimited list of debug info to generate. The defaults are based on other
options potentially (/driver or /profile). This sets up the infrastructure to
allow us to emit RSDS records to get "build id" equivalents on COFF (similar to
binutils).
llvm-svn: 278056
Charles Davis [Mon, 8 Aug 2016 21:20:15 +0000 (21:20 +0000)]
Revert "[X86] Support the "ms-hotpatch" attribute."
This reverts commit r278048. Something changed between the last time I
built this--it takes awhile on my ridiculously slow and ancient
computer--and now that broke this.
llvm-svn: 278053
Charles Davis [Mon, 8 Aug 2016 21:19:08 +0000 (21:19 +0000)]
Revert "[Attr] Add support for the `ms_hook_prologue` attribute."
This reverts commit r278050. It depends on r278048, which will be
reverted.
llvm-svn: 278052
Derek Schuff [Mon, 8 Aug 2016 21:14:15 +0000 (21:14 +0000)]
[Driver] Enable CFI for WebAssembly
Since CFI support has landed in the WebAssembly backend, enable it in
the frontend driver.
Patch by Dominic Chen
Differential Revision: https://reviews.llvm.org/D23244
llvm-svn: 278051
Charles Davis [Mon, 8 Aug 2016 21:03:39 +0000 (21:03 +0000)]
[Attr] Add support for the `ms_hook_prologue` attribute.
Summary:
Based on a patch by Michael Mueller.
This attribute specifies that a function can be hooked or patched. This
mechanism was originally devised by Microsoft for hotpatching their
binaries (which they're constantly updating to stay ahead of crackers,
script kiddies, and other ne'er-do-wells on the Internet), but it's now
commonly abused by Windows programs that want to hook API functions. It
is for this reason that this attribute was added to GCC--hence the name,
`ms_hook_prologue`.
Depends on D19908.
Reviewers: rnk, aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D19909
llvm-svn: 278050
Justin Bogner [Mon, 8 Aug 2016 21:02:11 +0000 (21:02 +0000)]
InstCombine: Remove a redundant #ifdef NDEBUG. NFC
The DEBUG() macro already does this.
llvm-svn: 278049
Charles Davis [Mon, 8 Aug 2016 21:01:39 +0000 (21:01 +0000)]
[X86] Support the "ms-hotpatch" attribute.
Summary:
Based on two patches by Michael Mueller.
This is a target attribute that causes a function marked with it to be
emitted as "hotpatchable". This particular mechanism was originally
devised by Microsoft for patching their binaries (which they are
constantly updating to stay ahead of crackers, script kiddies, and other
ne'er-do-wells on the Internet), but is now commonly abused by Windows
programs to hook API functions.
This mechanism is target-specific. For x86, a two-byte no-op instruction
is emitted at the function's entry point; the entry point must be
immediately preceded by 64 (32-bit) or 128 (64-bit) bytes of padding.
This padding is where the patch code is written. The two byte no-op is
then overwritten with a short jump into this code. The no-op is usually
a `movl %edi, %edi` instruction; this is used as a magic value
indicating that this is a hotpatchable function.
Reviewers: majnemer, sanjoy, rnk
Subscribers: dberris, llvm-commits
Differential Revision: https://reviews.llvm.org/D19908
llvm-svn: 278048
Rui Ueyama [Mon, 8 Aug 2016 19:39:45 +0000 (19:39 +0000)]
Refactor getMipsEFlags.
Previously, we incrementally updated the reuslting flag as we check
file flags, so it was not very clear who is updating what flags.
This patch makes them pure functions -- that has no side effect and
don't update arguments to improve readability.
Now each function construct a patial result, and all resutls are then
bitwise-OR'ed to construct the final result.
This patch also creates a new file, Mips.cpp, to move all these
MIPS functions to a separate file.
Differential Revision: https://reviews.llvm.org/D23249
llvm-svn: 278042
Geoff Berry [Mon, 8 Aug 2016 19:33:27 +0000 (19:33 +0000)]
[MemorySSA] Fix windows build breakage caused by r278028 (take 2)
r278028: [MemorySSA] Ensure address stability of MemorySSA object.
llvm-svn: 278041
Krzysztof Parzyszek [Mon, 8 Aug 2016 19:24:25 +0000 (19:24 +0000)]
[Hexagon] Add pattern for 64-bit mulhs
llvm-svn: 278040
Tobias Grosser [Mon, 8 Aug 2016 19:22:19 +0000 (19:22 +0000)]
[GPGPU] Support Values referenced from both isl expr and llvm instructions
When adding code that avoids to pass values used in isl expressions and
LLVM instructions twice, we forgot to make single variable passed to the
kernel available in the ValueMap that makes it usable for instructions that
are not replaced with isl ast expressions. This change adds the variable
that is passed to the kernel to the ValueMap to ensure it is available
for such use cases as well.
llvm-svn: 278039
Michael Zolotukhin [Mon, 8 Aug 2016 19:02:15 +0000 (19:02 +0000)]
[LoopUnroll] Simplify loops created by unrolling.
Summary:
Currently loop-unrolling doesn't preserve loop-simplified form. This patch
fixes it by resimplifying affected loops.
Reviewers: chandlerc, sanjoy, hfinkel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23148
llvm-svn: 278038
Mehdi Amini [Mon, 8 Aug 2016 18:51:05 +0000 (18:51 +0000)]
RefreshCallGraph does not modify the SCC, adding "const" to make it clear (NFC)
llvm-svn: 278037
Dimitry Andric [Mon, 8 Aug 2016 18:34:05 +0000 (18:34 +0000)]
Fix linking of omp_foreign_thread_team_reuse test on FreeBSD
Summary:
On FreeBSD, linking the misc_bugs/omp_foreign_thread_team_reuse.c test
case fails with:
/usr/local/bin/ld: /tmp/omp_foreign_thread_team_reuse-c5e71b.o: undefined reference to symbol 'pthread_create@@FBSD_1.0'
This is because the program is linked without `-lpthread`. Since the
%libomp-compile-and-run macro does not allow that option to be added to
the compile command line, split it up and add the required `-lpthread`
between %libomp-compile and %libomp-run.
Reviewers: jlpeyton, hfinkel, Hahnfeld
Subscribers: Hahnfeld, emaste, openmp-commits
Differential Revision: https://reviews.llvm.org/D23084
llvm-svn: 278036
Geoff Berry [Mon, 8 Aug 2016 18:27:22 +0000 (18:27 +0000)]
[MemorySSA] Fix windows build breakage caused by r278028
r278028: [MemorySSA] Ensure address stability of MemorySSA object.
llvm-svn: 278035
Elliot Colp [Mon, 8 Aug 2016 18:11:13 +0000 (18:11 +0000)]
Re-add SystemZ SNaN test
The floating-point bug affecting ninja-x64-msvc-RA-centos6 is fixed (r277813) so this test should
now pass
llvm-svn: 278034
Lang Hames [Mon, 8 Aug 2016 18:09:56 +0000 (18:09 +0000)]
[BuildingAJIT] Fix a couple of typos in the Chapter 3 draft.
llvm-svn: 278033
Eugene Zelenko [Mon, 8 Aug 2016 18:01:50 +0000 (18:01 +0000)]
CMakeLists.txt cleanups: synchronize version with rest of LLVM, consistent spacing.
Differential revision: https://reviews.llvm.org/D23091
llvm-svn: 278032
Nirav Dave [Mon, 8 Aug 2016 18:01:04 +0000 (18:01 +0000)]
[X86] Improve code size on X86 segment moves
Moves of a value to a segment register from a 16-bit register is
equivalent to one from it's corresponding 32-bit register. Match gas's
behavior and rewrite instructions to the shorter of equivalent forms.
Reviewers: rnk, ab
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23166
llvm-svn: 278031
Eugene Zelenko [Mon, 8 Aug 2016 17:59:02 +0000 (17:59 +0000)]
CMakeLists.txt cleanups: synchronize version with rest of LLVM, consistent spacing.
Differential revision: https://reviews.llvm.org/D23092
llvm-svn: 278030
Eugene Zelenko [Mon, 8 Aug 2016 17:56:28 +0000 (17:56 +0000)]
CMakeLists.txt cleanups: synchronize version and CMake minimum required version with rest of LLVM, consistent spacing.
Differential revision: https://reviews.llvm.org/D23094
llvm-svn: 278029
Geoff Berry [Mon, 8 Aug 2016 17:52:01 +0000 (17:52 +0000)]
[MemorySSA] Ensure address stability of MemorySSA object.
Summary:
Ensure that the MemorySSA object never changes address when using the
new pass manager since the walkers contained by MemorySSA cache pointers
to it at construction time. This is achieved by wrapping the
MemorySSAAnalysis result in a unique_ptr. Also add some asserts that
check for this bug.
Reviewers: george.burgess.iv, dberlin
Subscribers: mcrosier, hfinkel, chandlerc, silvas, llvm-commits
Differential Revision: https://reviews.llvm.org/D23171
llvm-svn: 278028
Derek Bruening [Mon, 8 Aug 2016 17:37:19 +0000 (17:37 +0000)]
[esan] Add iterator to esan's generic hashtable
Summary: Adds simple iterator support to the esan hashtable.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D22682
llvm-svn: 278027
Tobias Grosser [Mon, 8 Aug 2016 17:35:55 +0000 (17:35 +0000)]
[GPGPU] Create code to verify run-time conditions
llvm-svn: 278026
Tobias Grosser [Mon, 8 Aug 2016 17:35:52 +0000 (17:35 +0000)]
Fix compilation in 'asserts' mode
llvm-svn: 278025
Derek Bruening [Mon, 8 Aug 2016 17:25:40 +0000 (17:25 +0000)]
[esan] Add generic resizing hashtable
Summary:
Adds a new, generic, resizing hashtable data structure for use by esan
tools. No existing sanitizer hashtable is suitable for the use case for
most esan tools: we need non-fixed-size tables, parameterized keys and
payloads, and write access to payloads. The new hashtable uses either
simple internal or external mutex locking and supports custom hash and
comparision operators. The focus is on functionality, not performance, to
catalyze creation of a variety of tools. We can optimize the more
successful tools later.
Adds tests of the data structure.
Reviewers: aizatsky
Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D22681
llvm-svn: 278024
Kirill Bobyrev [Mon, 8 Aug 2016 17:11:56 +0000 (17:11 +0000)]
[clang-tidy] enhance modernize-use-bool-literals to check ternary operator
modernize-use-bool-literals doesn't checks operands in ternary operator.
For example:
``` c++
static int Value = 1;
bool foo() {
bool Result = Value == 1 ? 1 : 0;
return Result;
}
bool boo() {
return Value == 1 ? 1 : 0;
}
```
This issue was reported in bug 28854. The patch fixes it.
Reviewers: alexfh, aaron.ballman, Prazek
Subscribers: Prazek, Eugene.Zelenko
Differential Revision: https://reviews.llvm.org/D23243
llvm-svn: 278022
Jason Henline [Mon, 8 Aug 2016 16:45:19 +0000 (16:45 +0000)]
[StreamExecutor] Add DeviceMemory and kernel arg packing
Summary:
Add types for device memory and add the code that knows how to pack these
device memory types if they are passed as arguments to kernel launches.
Reviewers: jlebar, tra
Subscribers: parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D23211
llvm-svn: 278021
Artem Dergachev [Mon, 8 Aug 2016 16:01:02 +0000 (16:01 +0000)]
[analyzer] Change -analyze-function to accept qualified names.
Both -analyze-function and -analyzer-display-progress now share the same
convention for naming functions, which allows discriminating between
methods with the same name in different classes, C++ overloads, and also
presents Objective-C instance and class methods in the convenient notation.
This also allows looking up the name for the particular function you're trying
to restrict analysis to in the -analyzer-display-progress output,
in case it was not instantly obvious.
Differential Revision: https://reviews.llvm.org/D22856
llvm-svn: 278018
Tobias Grosser [Mon, 8 Aug 2016 15:41:52 +0000 (15:41 +0000)]
[IslNodeBuilder] Move run-time check generation to NodeBuilder [NFC]
This improves the structure of the code and allows us to reuse the runtime
code generation in the PPCGCodeGeneration.
llvm-svn: 278017
Oliver Stannard [Mon, 8 Aug 2016 15:28:40 +0000 (15:28 +0000)]
[ARM] Command-line options for embedded position-independent code
This patch (with the corresponding ARM backend patch) adds support for
some new relocation models:
* Read-only position independence (ROPI): Code and read-only data is accessed
PC-relative. The offsets between all code and RO data sections are known at
static link time.
* Read-write position independence (RWPI): Read-write data is accessed relative
to a static base register. The offsets between all writeable data sections
are known at static link time.
These two modes are independent (they specify how different objects
should be addressed), so they can be used individually or together.
These modes are intended for bare-metal systems or systems with small
real-time operating systems. They are designed to avoid the need for a
dynamic linker, the only initialisation required is setting the static
base register to an appropriate value for RWPI code.
There is one C construct not currently supported by these modes: global
variables initialised to the address of another global variable or
function, where that address is not known at static-link time. There are
a few possible ways to solve this:
* Disallow this, and require the user to write their own initialisation
function if they need variables like this.
* Emit dynamic initialisers for these variables in the compiler, called from
the .init_array section (as is currently done for C++ dynamic initialisers).
We have a patch to do this, described in my original RFC email
(http://lists.llvm.org/pipermail/llvm-dev/2015-December/093022.html), but the
feedback from that RFC thread was that this is not something that belongs in
clang.
* Use a small dynamic loader to fix up these variables, by adding the
difference between the load and execution address of the relevant section.
This would require linker co-operation to generate a table of addresses that
need fixing up.
Differential Revision: https://reviews.llvm.org/D23196
llvm-svn: 278016
Oliver Stannard [Mon, 8 Aug 2016 15:28:31 +0000 (15:28 +0000)]
[ARM] Add support for embedded position-independent code
This patch adds support for some new relocation models to the ARM
backend:
* Read-only position independence (ROPI): Code and read-only data is accessed
PC-relative. The offsets between all code and RO data sections are known at
static link time. This does not affect read-write data.
* Read-write position independence (RWPI): Read-write data is accessed relative
to the static base register (r9). The offsets between all writeable data
sections are known at static link time. This does not affect read-only data.
These two modes are independent (they specify how different objects
should be addressed), so they can be used individually or together. They
are otherwise the same as the "static" relocation model, and are not
compatible with SysV-style PIC using a global offset table.
These modes are normally used by bare-metal systems or systems with
small real-time operating systems. They are designed to avoid the need
for a dynamic linker, the only initialisation required is setting r9 to
an appropriate value for RWPI code.
I have only added support to SelectionDAG, not FastISel, because
FastISel is currently disabled for bare-metal targets where these modes
would be used.
Differential Revision: https://reviews.llvm.org/D23195
llvm-svn: 278015
Tobias Grosser [Mon, 8 Aug 2016 15:25:50 +0000 (15:25 +0000)]
[CodeGeneration] Do not set insert position redundantly
There is no need to reset the position of the builder, as we can just continue
to insert code at the current position of the IRBuilder, which happens to
be precisely the location we reset the builder to.
llvm-svn: 278014
Tobias Grosser [Mon, 8 Aug 2016 15:25:46 +0000 (15:25 +0000)]
[IslNodeBuilder] Directly use the insert location of our Builder
... instead of adding instructions at the end of the basic block the builder
is currently at. This makes it easier to reason about where IR is generated,
as with the IRBuilder there is just a single location that specificies where
IR is generated.
llvm-svn: 278013
Zhan Jun Liau [Mon, 8 Aug 2016 15:13:08 +0000 (15:13 +0000)]
[SystemZ] Add support for the .insn directive
Summary:
Add support for the .insn directive.
.insn is an s390 specific directive that allows encoding of an instruction
instead of using a mnemonic. The motivating case is some code in node.js that
requires support for the .insn directive.
Reviewers: koriakin, uweigand
Subscribers: koriakin, llvm-commits
Differential Revision: https://reviews.llvm.org/D21809
llvm-svn: 278012
Nico Weber [Mon, 8 Aug 2016 14:51:53 +0000 (14:51 +0000)]
Revert r2277979.
For some reason, MSVC2013's cl.exe crashes with
fatal error C1001: An internal error has occurred in the compiler
with this when compiling e.g. LoopDistribute.cpp.
llvm-svn: 278011
Sebastian Pop [Mon, 8 Aug 2016 14:46:15 +0000 (14:46 +0000)]
GVN-hoist: enable by default
llvm-svn: 278010
Artur Pilipenko [Mon, 8 Aug 2016 14:33:11 +0000 (14:33 +0000)]
[LVI] NFC. On the fast dest path use inverse predicate instead of inverse range result
Gathering constantins from a condition on the false path ask makeAllowedICmpRegion about inverse predicate instead of inversing the resulting range.
This change was separated from the review "[LVI] Make LVI smarter about comparisons with non-constants" (https://reviews.llvm.org/D23205#inline-198361)
llvm-svn: 278009
Artur Pilipenko [Mon, 8 Aug 2016 14:13:56 +0000 (14:13 +0000)]
[LVI] NFC. Rename confusing local NegOffset to Offset
NegOffset is not necessarily negative
llvm-svn: 278008
Artur Pilipenko [Mon, 8 Aug 2016 14:08:37 +0000 (14:08 +0000)]
[LVI] NFC. Extract LHS, RHS, Predicate locals in getValueFromCondition
llvm-svn: 278007
Gabor Horvath [Mon, 8 Aug 2016 13:41:04 +0000 (13:41 +0000)]
[analyzer] Command line option to show enabled checker list.
This patch adds a command line option to list the checkers that were enabled
by analyzer-checker and not disabled by -analyzer-disable-checker.
It can be very useful to debug long command lines when it is not immediately
apparent which checkers are turned on and which checkers are turned off.
Differential Revision: https://reviews.llvm.org/D23060
llvm-svn: 278006
Pavel Labath [Mon, 8 Aug 2016 13:38:33 +0000 (13:38 +0000)]
Fix uninitialized field warnings in GDBRemoteRegisterContext
also take the opportunity to replace NULL with nullptr and add clang-format guards to prevent it
from messing up the nice table there.
llvm-svn: 278005
Eric Liu [Mon, 8 Aug 2016 13:37:39 +0000 (13:37 +0000)]
Fixes calculateRangesAfterReplacements crash when Replacements is empty.
Reviewers: klimek, djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D23264
llvm-svn: 278004
Jonas Hahnfeld [Mon, 8 Aug 2016 13:23:08 +0000 (13:23 +0000)]
kmp_gsupport: Fix library initialization with taskgroup
Differential Revision: https://reviews.llvm.org/D23259
llvm-svn: 278003
Silviu Baranga [Mon, 8 Aug 2016 13:13:57 +0000 (13:13 +0000)]
[AArch64] PR28877: Don't assume we're running after legalization when creating vcvtfp2fxs
Summary:
The DAG combine transformation that was generating the
aarch64_neon_vcvtfp2fxs node was assuming that all
inputs where legal and wasn't accounting that the input
could be a v4f64 if we're trying to do the transformation
before legalization. We now bail out in this case.
All illegal types besides v4f64 were already rejected.
Fixes https://llvm.org/bugs/show_bug.cgi?id=28877.
Reviewers: jmolloy
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D23261
llvm-svn: 278002