Lang Hames [Tue, 9 Aug 2016 19:27:17 +0000 (19:27 +0000)]
Re-apply r278065 (Weak symbol support in RuntimeDyld) with a fix for ELF.
llvm-svn: 278149
Benjamin Kramer [Tue, 9 Aug 2016 19:20:25 +0000 (19:20 +0000)]
Add a missing -no-canonical-prefixes.
llvm-svn: 278148
Eric Fiselier [Tue, 9 Aug 2016 18:56:48 +0000 (18:56 +0000)]
Update in-tree Google Benchmark to current ToT.
I've put some work into the Google Benchmark library in order to make it easier
to benchmark libc++. These changes have already been upstreamed into
Google Benchmark and this patch applies the changes to the in-tree version.
The main improvement in the addition of a 'compare_bench.py' script which
makes it very easy to compare benchmarks. For example to compare the native
STL to libc++ you would run:
`$ compare_bench.py ./util_smartptr.native.out ./util_smartptr.libcxx.out`
And the output would look like:
RUNNING: ./util_smartptr.native.out
Benchmark Time CPU Iterations
----------------------------------------------------------------
BM_SharedPtrCreateDestroy 62 ns 62 ns
10937500
BM_SharedPtrIncDecRef 31 ns 31 ns
23972603
BM_WeakPtrIncDecRef 28 ns 28 ns
23648649
RUNNING: ./util_smartptr.libcxx.out
Benchmark Time CPU Iterations
----------------------------------------------------------------
BM_SharedPtrCreateDestroy 46 ns 46 ns
14957265
BM_SharedPtrIncDecRef 31 ns 31 ns
22435897
BM_WeakPtrIncDecRef 34 ns 34 ns
21084337
Comparing ./util_smartptr.native.out to ./util_smartptr.libcxx.out
Benchmark Time CPU
-----------------------------------------------------
BM_SharedPtrCreateDestroy -0.26 -0.26
BM_SharedPtrIncDecRef +0.00 +0.00
BM_WeakPtrIncDecRef +0.21 +0.21
llvm-svn: 278147
David Majnemer [Tue, 9 Aug 2016 18:34:19 +0000 (18:34 +0000)]
[vim] Update the llvm.vim syntax file
We never updated this file to contain the WinEH instructions.
Also, add the dereferenceable attribute.
llvm-svn: 278146
Miklos Vajna [Tue, 9 Aug 2016 18:20:41 +0000 (18:20 +0000)]
clang-rename rename-all: support reading old/newname pairs from a YAML file
This is handy in case by the time clang-rename is invoked, an external
tool already genereated a list of oldname -> newname pairs to handle.
Reviewers: omtcyfz
Differential Revision: https://reviews.llvm.org/D23198
llvm-svn: 278145
David Majnemer [Tue, 9 Aug 2016 17:55:12 +0000 (17:55 +0000)]
[X86] Don't model UD2/UD2B as a terminator
A UD2 might make its way into the program via a call to @llvm.trap.
Obviously, calls are not terminators. However, we modeled the X86
instruction, UD2, as a terminator. Later on, this confuses the epilogue
insertion machinery which results in the epilogue getting inserted
before the UD2. For some platforms, like x64, the result is a
violation of the ABI.
Instead, model UD2/UD2B as a side effecting instruction which may
observe memory.
llvm-svn: 278144
Mandeep Singh Grang [Tue, 9 Aug 2016 17:49:24 +0000 (17:49 +0000)]
Fix spacing around variable initializations and for-loops. NFC.
Reviewers: grosser, _jdoerfert, zinob
Projects: #polly
Differential Revision: https://reviews.llvm.org/D23285
llvm-svn: 278143
Vedant Kumar [Tue, 9 Aug 2016 17:42:11 +0000 (17:42 +0000)]
[debugserver] Delete CFData.{h,cpp}, since they appear to be dead (NFCI)
Differential Revision: https://reviews.llvm.org/D23070
llvm-svn: 278142
Simon Pilgrim [Tue, 9 Aug 2016 17:39:11 +0000 (17:39 +0000)]
[DAGCombiner] Better support for shifting large value type by constants
As detailed on D22726, much of the shift combining code assume constant values will fit into a uint64_t value and calls ConstantSDNode::getZExtValue where it probably shouldn't (leading to asserts). Using APInt directly avoids this problem but we encounter other assertions if we attempt to compare/operate on 2 APInt of different bitwidths.
This patch adds a helper function to ensure that 2 APInt values are zero extended as required so that they can be safely used together. I've only added an initial example use for this to the '(SHIFT (SHIFT x, c1), c2) --> (SHIFT x, (ADD c1, c2))' combines. Further cases can easily be added as required.
Differential Revision: https://reviews.llvm.org/D23007
llvm-svn: 278141
Samuel Antao [Tue, 9 Aug 2016 17:27:24 +0000 (17:27 +0000)]
[CUDA] Regression test to make sure C++ include path are forwarded to host and device frontends.
Summary: Add test to detect the C++ include paths are passed to both CUDA host and device frontends.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D22946
llvm-svn: 278140
Reid Kleckner [Tue, 9 Aug 2016 17:23:56 +0000 (17:23 +0000)]
[clang-cl] Make -gline-tables-only imply -gcodeview
It's surprising that you have to pass /Z7 in addition to -gcodeview to
get debug info. The sanitizer runtime, for example, expects that if the
compiler supports the -gline-tables-only flag, then it will emit debug
info.
llvm-svn: 278139
Anna Thomas [Tue, 9 Aug 2016 17:18:05 +0000 (17:18 +0000)]
[AliasAnalysis] Treat invariant.start as read-memory
Summary:
We teach alias analysis that invariant.start is readonly.
This helps with GVN and memcopy optimizations that currently treat.
invariant.start as a clobber.
We need to treat this as readonly, so that DSE does not incorrectly
remove stores prior to the invariant.start
Reviewers: sanjoy, reames, majnemer, dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23214
llvm-svn: 278138
Sanjay Patel [Tue, 9 Aug 2016 17:03:51 +0000 (17:03 +0000)]
auto-generate checks
llvm-svn: 278137
Sanjay Patel [Tue, 9 Aug 2016 17:02:17 +0000 (17:02 +0000)]
auto-generate checks
llvm-svn: 278136
Sanjay Patel [Tue, 9 Aug 2016 16:59:54 +0000 (16:59 +0000)]
auto-generate checks
llvm-svn: 278135
Hans Wennborg [Tue, 9 Aug 2016 16:46:02 +0000 (16:46 +0000)]
test-release.sh: Drop autoconf support
The autoconf build was deleted some time ago.
llvm-svn: 278133
Sanjay Patel [Tue, 9 Aug 2016 16:39:05 +0000 (16:39 +0000)]
add tests for missing vector icmp folds
llvm-svn: 278132
Sanjay Patel [Tue, 9 Aug 2016 16:19:57 +0000 (16:19 +0000)]
update to use FileCheck and auto-generate checks
llvm-svn: 278131
Sanjay Patel [Tue, 9 Aug 2016 16:17:46 +0000 (16:17 +0000)]
regenerate checks
llvm-svn: 278130
Sanjay Patel [Tue, 9 Aug 2016 16:05:57 +0000 (16:05 +0000)]
add tests for missing vector icmp folds
llvm-svn: 278129
Xinliang David Li [Tue, 9 Aug 2016 15:35:28 +0000 (15:35 +0000)]
[Profile] turn off verbose warnings by default
no prof data for func warning is turned off by default
due to its high verbosity and minimal usefulness.
Differential Revision: http://reviews.llvm.org/D23295
llvm-svn: 278127
Tobias Grosser [Tue, 9 Aug 2016 15:35:06 +0000 (15:35 +0000)]
[GPGPU] Support PHI nodes used in GPU kernel
Ensure the right scalar allocations are used as the host location of data
transfers. For the device code, we clear the allocation cache before device
code generation to be able to generate new device-specific allocation and
we need to make sure to add back the old host allocations as soon as the
device code generation is finished.
llvm-svn: 278126
Tobias Grosser [Tue, 9 Aug 2016 15:35:03 +0000 (15:35 +0000)]
[GPGPU] Use separate basic block for GPU initialization code
This increases the readability of the IR and also clarifies that the GPU
inititialization is executed _after_ the scalar initialization which needs
to before the code of the transformed scop is executed.
Besides increased readability, the IR should not change. Specifically, I
do not expect any changes in program semantics due to this patch.
llvm-svn: 278125
Tobias Grosser [Tue, 9 Aug 2016 15:34:59 +0000 (15:34 +0000)]
[BlockGenerator] Insert initializations at beginning of start block
In case some code -- not guarded by control flow -- would be emitted directly in
the start block, it may happen that this code would use uninitalized scalar
values if the scalar initialization is only emitted at the end of the start
block. This is not a problem today in normal Polly, as all statements are
emitted in their own basic blocks, but Polly-ACC emits host-to-device copy
statements into the start block.
Additional Polly-ACC test coverage will be added in subsequent changes that
improve the handling of PHI nodes in Polly-ACC.
llvm-svn: 278124
Martin Bohme [Tue, 9 Aug 2016 15:07:52 +0000 (15:07 +0000)]
[ASTMatchers] Add matchers canReferToDecl() and hasUnderlyingDecl()
Summary: Required for D22220
Reviewers: sbenza, klimek, aaron.ballman, alexfh
Subscribers: alexfh, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D23004
llvm-svn: 278123
Artur Pilipenko [Tue, 9 Aug 2016 14:50:08 +0000 (14:50 +0000)]
[LVI] Make LVI smarter about comparisons with non-constants
Make LVI smarter about comparisons with a non-constant. For example, a s< b constraints a to be in [INT_MIN, INT_MAX) range. This is a part of https://llvm.org/bugs/show_bug.cgi?id=28620 fix.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D23205
llvm-svn: 278122
Sylvestre Ledru [Tue, 9 Aug 2016 14:24:40 +0000 (14:24 +0000)]
clang-format: Add SpaceAfterTemplate
Summary:
This is required for compliance with the Mozilla style guide.
This is a rebase+minor change of Birunthan Mohanathas's patch
Reviewers: djasper
Subscribers: klimek, cfe-commits, opilarium
Differential Revision: https://reviews.llvm.org/D23317
llvm-svn: 278121
Simon Pilgrim [Tue, 9 Aug 2016 12:56:15 +0000 (12:56 +0000)]
[X86][XOP] Add support for combining target shuffles to VPERMIL2PD/VPERMIL2PS
llvm-svn: 278120
Kuba Brecka [Tue, 9 Aug 2016 12:12:15 +0000 (12:12 +0000)]
Add `#ifdef __cplusplus` around `extern "C"` in Compiler.h. NFC.
llvm-svn: 278119
Pavel Labath [Tue, 9 Aug 2016 12:04:46 +0000 (12:04 +0000)]
Reapply "Rewrite gdb-remote's SendContinuePacketAndWaitForResponse"
Resumbitting the commit after fixing the following problems:
- broken unit tests on windows: incorrect gtest usage on my part (TEST vs. TEST_F)
- the new code did not correctly handle the case where we went to interrupt the process, but it
stopped due to a different reason - the interrupt request would remain queued and would
interfere with the following "continue". I also added a unit test for this case.
This reapplies r277156 and r277139.
llvm-svn: 278118
Elena Demikhovsky [Tue, 9 Aug 2016 11:54:14 +0000 (11:54 +0000)]
AVX-512: A new test for FMA intrinsic
A new test that explores sub-optimal sequence of FMA intrinsic and FNEG operation.
An upcoming patch will fix it.
llvm-svn: 278117
Daniel Sanders [Tue, 9 Aug 2016 11:50:53 +0000 (11:50 +0000)]
[sanitizers] Make it possible to XFAIL on the effective target, not just the default.
Summary:
The triple is not the right thing to XFAIL on since LIT only sees the default
triple and not the effective triple chosen by any -target option in the RUN
directives. This discrepancy is shown in the table below:
Default Triple | Options | XFAIL | LIT's expected result | Desired expectation
=================+===================================+========+=======================+====================
mips-linux-gnu | -target mips-linux-gnu | | Pass | Pass
mips-linux-gnu | -target mips64-linux-gnu -mabi=64 | | Pass | Pass
mips-linux-gnu | -target mips-linux-gnu | mips | Fail | Fail
mips-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips | Fail | Fail/Pass* (debatable**)
mips-linux-gnu | -target mips-linux-gnu | mips- | Fail | Fail
mips-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips- | Fail | Pass*
mips-linux-gnu | -target mips-linux-gnu | mips64 | Pass | Pass
mips-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips64 | Pass | Fail*
mips64-linux-gnu | -target mips-linux-gnu | | Pass | Pass
mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | | Pass | Pass
mips64-linux-gnu | -target mips-linux-gnu | mips | Fail | Fail*
mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips | Fail | Fail/Pass (debatable**)
mips64-linux-gnu | -target mips-linux-gnu | mips- | Pass | Fail*
mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips- | Pass | Pass
mips64-linux-gnu | -target mips-linux-gnu | mips64 | Fail | Pass*
mips64-linux-gnu | -target mips64-linux-gnu -mabi=64 | mips64 | Fail | Fail
x64_64-linux-gnu | -target i386-linux-gnu | | Pass | Pass
x64_64-linux-gnu | -target x86_64-linux-gnu | | Pass | Pass
x64_64-linux-gnu | -target i386-linux-gnu | i386 | Pass | Fail*
x64_64-linux-gnu | -target x86_64-linux-gnu | i386 | Pass | Pass
x64_64-linux-gnu | -target i386-linux-gnu | x86_64 | Fail | Pass
x64_64-linux-gnu | -target x86_64-linux-gnu | x86_64 | Fail | Fail*
* These all differ from LIT's current behaviour.
** People's expectations vary depending on whether they know that LIT does a
substring match on the default triple or think it's an exact match on an
architecture.
This patch adds "target-is-${target_arch}" to the available features list and
updates the mips XFAIL's to use them. XFAIL'ing on these features will
correctly account for the target being tested. Making the table:
Options | XFAIL | LIT's expected result
==================================+==================+======================
-target mips-linux-gnu | | Pass
-target mips64-linux-gnu -mabi=64 | | Pass
-target mips-linux-gnu | target-is-mips | Fail
-target mips64-linux-gnu -mabi=64 | target-is-mips | Pass
-target mips-linux-gnu | target-is-mips64 | Pass
-target mips64-linux-gnu -mabi=64 | target-is-mips64 | Fail
-target i386-linux-gnu | | Pass
-target x86_64-linux-gnu | | Pass
-target i386-linux-gnu | target-is-i386 | Fail
-target x86_64-linux-gnu | target-is-i386 | Pass
-target i386-linux-gnu | target-is-x86_64 | Pass
-target x86_64-linux-gnu | target-is-x86_64 | Fail
Reviewers: probinson
Subscribers: probinson, kubabrecka, llvm-commits, samsonov
Differential Revision: https://reviews.llvm.org/D22802
llvm-svn: 278116
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