Commit Graph

139835 Commits

Author SHA1 Message Date
Reid Kleckner
3a3c5c8815 Use __func__ directly now that all supported compilers support it
Remove the portability macro now that it is unused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 00:22:23 +00:00
Victor Leschuk
e69c459a6e DebugInfo: preparation to implement DW_AT_alignment
- Add alignment attribute to DIVariable family
 - Modify bitcode format to match new DIVariable representation
 - Update tests to match these changes (also add bitcode upgrade test)
 - Expect that frontend passes non-zero align value only when it is not default
   (was forcibly aligned by alignas()/_Alignas()/__atribute__(aligned())

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284678 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 00:13:12 +00:00
Derek Schuff
1c2f240908 [WebAssembly] Update extending load test for new i1 behavior
r284611 changed the behavior of the DAG legalizer for sign-extending i1
values. Update the wasm extending load test to match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 00:10:34 +00:00
Reid Kleckner
5b1c9f3223 Remove LLVM_NOEXCEPT and replace it with noexcept
Now that we have dropped MSVC 2013, all supported compilers support
noexcept and we can drop this portability macro.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 23:52:38 +00:00
Kevin Enderby
04e3307190 Next set of additional error checks for invalid Mach-O files for the
load commands that use the MachO::thread_command type
but are not used in llvm libObject code but used in llvm tool code.

This includes the LC_UNIXTHREAD and LC_THREAD
load commands.

A quick note about the philosophy of the error checking in
libObject for Mach-O files, the idea behind the checking is
that we never will return a Mach-O file out of libObject that
contains unknown things in the load commands.

To do this the 32-bit ARM and PPC general tread states
needed to be defined as two test case binaries contained
them.  If other thread states for other CPUs need to be
added we will do that as needed.

Going forward the LC_MAIN load command is used to
set the entry point in Mach-O executables these days
instead of an LC_UNIXTHREAD as was done in the past.
So today only in core files are LC_THREAD load commands
and thread states usually found.

Other thread states have not yet been defined in
include/Support/MachO.h at this time.  But that can be
added as needed with their corresponding checking also
added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284668 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 23:44:34 +00:00
Reid Kleckner
6224e335f0 Update Compiler.h to fail fast when building with MSVC 2013
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 23:34:58 +00:00
Rong Xu
fa327aeea5 [PGO] Fix a use-after-move. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 23:31:59 +00:00
Reid Kleckner
f4ca0f5a59 Revert "DenseSet: Appease msc18 to define derived constructors explicitly."
This reverts commit r284570. MSVC 18 / 2013 is not supported anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284661 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 23:04:57 +00:00
Reid Kleckner
dee834ca3b Update docs to reflect new minimum MSVC version requirement
Mailing list discussion about this:
http://lists.llvm.org/pipermail/llvm-dev/2016-September/104631.html

Code changes to simplify the ifdefs will come next, and can be reverted
without affecting the policy if someone needs it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284660 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 23:04:41 +00:00
Rong Xu
c8872308b4 [PGO] Fix bogus warning for merging empty llvm profile file
Profile runtime can generate an empty raw profile (when there is no function in
the shared library). This empty profile is treated as a text format profile.  A
test format profile without the flag of "#IR" is thought to be a clang
generated profile.  So in llvm profile merging, we will get a bogus warning of
"Merge IR generated profile with Clang generated profile."

The fix here is to skip the empty profile (when the buffer size is 0) for
profile merge.

Reviewers: vsk, davidxl

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284659 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 22:51:17 +00:00
Lang Hames
207b6abad4 [BuildingAJIT] Use the remote target triple to construct the TargetMachine in
Chapter 5.

Chapter 5 demonstrates remote JITing: code is executed on the remote, not the
machine running the REPL, so it's the remote's triple (and TargetMachine) that
we need.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 22:41:03 +00:00
Mehdi Amini
2bd75068e1 Add computeHostNumPhysicalCores() implementation for Darwin
Differential Revision: https://reviews.llvm.org/D25800

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 22:36:07 +00:00
Wei Ding
cc8ca50286 AMDGPU : Add a function to enable and disable IEEEBit for SC and shader
respectively.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 22:34:49 +00:00
Lang Hames
599a7aa9a7 Remove the JIT EH/small code model tests for now.
These tests rely on two sections being allocated with a limited displacement
from one to the other to work. We've never guaranteed this, and consequently
these tests usually fail. That led to them being XFAILed, but now they XPASS
whenever the sections do happen to be allocated nearby in memory. So I'm
removing these for now to get rid of the noise. We can re-instate them if/when
we take the time to implement a displacement-respecting allocator.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284654 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 22:19:38 +00:00
Chris Bieneman
43fa064b8c [CMake] Make the runtimes directory work with bootstrap builds
This patch builds on clang r284648, and allows the runtime directory to make the bootstrap builds depend on the builtin libraries.

This patch also make the bootstrap build depend on configuring the other runtimes because the libcxx headers are copied during configuration. I have left a TODO in the code to remove that once I come up with a better solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284650 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 21:50:25 +00:00
Sanjay Patel
bac9c437ae [InstSimplify] fold negation of sign-bit
0 - X --> X, if X is 0 or the minimum signed value
0 - X --> 0, if X is 0 or the minimum signed value and the sub is NSW

I noticed this pattern might be created in the backend after the change from D25485, 
so we'll want to add a similar fold for the DAG.

The use of computeKnownBits in InstSimplify may be something to investigate if the
compile time of InstSimplify is noticeable. We could replace computeKnownBits with 
specific pattern matchers or limit the recursion.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284649 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 21:23:45 +00:00
Lang Hames
b5046bac11 [BuildingAJIT] Make the chapter 5 server export symbols.
This will allow chapter 5 to work on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 20:22:12 +00:00
Hans Wennborg
d673d6f04b Typo: nomed struct -> named struct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284635 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 20:10:03 +00:00
Reid Kleckner
3fd59c99d0 [GlobalMerge] Handle non-landingpad EH pads
This code crashed on funclet-style EH instructions such as catchpad,
catchswitch, and cleanuppad. Just treat all EH pad instructions
equivalently and avoid merging the globals they reference through any
use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 19:56:22 +00:00
Artur Pilipenko
86fff1f817 [IndVarSimplify] Teach calculatePostIncRange to take guards into account
Reviewed By: sanjoy

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284632 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 19:43:54 +00:00
Matthew Simpson
f461f21edc [LV] Avoid emitting trivially dead instructions
Some instructions from the original loop, when vectorized, can become trivially
dead. This happens because of the way we structure the new loop. For example,
we create new induction variables and induction variable "steps" in the new
loop. Thus, when we go to vectorize the original induction variable update, it
may no longer be needed due to the instructions we've already created. This
patch prevents us from creating these redundant instructions. This reduces code
size before simplification and allows greater flexibility in code generation
since we have fewer unnecessary instruction uses.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 19:22:02 +00:00
Chad Rosier
db638de2de [AliasSetTracker] Add support for memcpy and memmove.
Differential Revision: https://reviews.llvm.org/D25776

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284630 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 19:09:03 +00:00
Artur Pilipenko
6ca75fa2b4 [IndVarSimplify] Use control-dependent range information to prove non-negativity
This change is motivated by the case when IndVarSimplify doesn't widen a comparison of IV increment because it can't prove IV increment being non-negative. We end up with a redundant trunc of the widened increment on this example.

for.body:
  %i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.inc ]
  %within_limits = icmp ult i32 %i, 64
  br i1 %within_limits, label %continue, label %for.end

continue:
  %i.i64 = zext i32 %i to i64
  %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
  %val = load i32, i32* %arrayidx, align 4
  br label %for.inc

for.inc:
  %i.inc = add nsw nuw i32 %i, 1
  %cmp = icmp slt i32 %i.inc, %limit
  br i1 %cmp, label %for.body, label %for.end

There is a range check inside of the loop which guarantees the IV to be non-negative. NSW on the increment guarantees that the increment is also non-negative. Teach IndVarSimplify to use the range check to prove non-negativity of loop increments.

Reviewed By: sanjoy

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 18:59:03 +00:00
Chad Rosier
6d823ecec2 [AliasSetTracker] Return void for add() functions. NFC.
Differential Revision: https://reviews.llvm.org/D25748

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 18:50:32 +00:00
Sanjay Patel
0ca2107254 [InstSimplify] move one and add more tests for potential negation folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 18:42:12 +00:00
Rafael Espindola
8ddbe891dd Add a macro for prefetching data.
It will be used in lld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284626 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 18:34:32 +00:00
Mehdi Amini
e66ad1c5d9 [ADT] Zip range adapter
This augments the STLExtras toolset with a zip iterator and range
adapter. Zip comes in two varieties: `zip`, which will zip to the
shortest of the input ranges, and `zip_first`, which limits its
`begin() == end()` checks to just the first range.

Recommit r284035 after MSVC2013 support has been dropped.

Patch by: Bryant Wong <github.com/bryant>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284623 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 18:02:21 +00:00
Vedant Kumar
4c50ebb18b [llvm-cov] Don't spawn a thread unless ThreadCount > 1
Initializing a ThreadPool with ThreadCount = 1 spawns a thread even
though we don't need to. This is at least slower than it needs to be,
and at worst may somehow be exacerbating PR30735 (llvm-cov times out
on ARM bots).

As a follow-up, I'll try to add logic to llvm::ThreadPool to avoid
spawning a thread when ThreadCount = 1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 17:55:44 +00:00
Krzysztof Parzyszek
735fbf86f3 [AMDGPU] Stop using MCRegisterClass::getSize()
Differential Review: https://reviews.llvm.org/D24675


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 17:40:36 +00:00
Teresa Johnson
740d871c3e [ThinLTO] Default backend threads to heavyweight_hardware_concurrency
Summary:
Changes default backend parallelism from thread::hardware_concurrency to
the new llvm::heavyweight_hardware_concurrency, which for X86 Linux
defaults to the number of physical cores (and will fall back to
thread::hardware_concurrency otherwise). This avoid oversubscribing
the physical cores using hyperthreading.

Reviewers: mehdi_amini, pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 17:35:01 +00:00
Simon Pilgrim
440f75c589 Merged nested ifs. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284616 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 17:30:24 +00:00
Pavel Labath
b40b8e3413 Revert "Add Chrono.h - std::chrono support header"
This reverts commit r284590 as it fails on the mingw buildbot. I think I know the
fix, but I cannot test it right now. Will reapply when I verify it works ok.

This reverts r284590.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284615 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 17:17:53 +00:00
Simon Pilgrim
9f2ab76dca [DAGCombiner] Add general constant vector support to (shl (add x, c1), c2) -> (add (shl x, c2), c1 << c2)
We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284613 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 17:12:22 +00:00
Reid Kleckner
0c4885106a [WinEH] Allow catchpads to reuse the same catch object
This code used a regular when it should have used a multimap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 17:08:23 +00:00
Sanjay Patel
85745f9561 [DAG] optimize negation of bool
Use mask and negate for legalization of i1 source type with SIGN_EXTEND_INREG.
With the mask, this should be no worse than 2 shifts. The mask can be eliminated
in some cases, so that should be better than 2 shifts.

This change exposed some missing folds related to negation:
https://reviews.llvm.org/rL284239
https://reviews.llvm.org/rL284395

There may be others, so please let me know if you see any regressions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284611 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 16:58:59 +00:00
Zachary Turner
8b3f7e86b1 [pdb] Improve error messages when DIA is not found.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 16:42:20 +00:00
Krzysztof Parzyszek
cac70281f9 [RDF] Switch RefMap in liveness calculation to use lane masks
This required reengineering of some of the part of liveness calculation,
including fixing some issues caused by the limitations of the previous
approach. The current code is not necessarily the fastest, but it should
be functionally correct (at least more so than before). The compile-time
performance will be addressed in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 16:30:56 +00:00
Simon Pilgrim
057fdd87c1 [DAGCombiner] Add general constant vector support to (shl (sra x, c1), c1) -> (and x, (shl -1, c1))
We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 16:15:30 +00:00
Simon Pilgrim
f02821bc98 [DAGCombiner] Add general constant vector support to (shl (mul x, c1), c2) -> (mul x, c1 << c2)
We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 15:59:28 +00:00
Tim Northover
96f32a0e61 Revert r284604. A.K.A. "TMP"
Committed by mistake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284606 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 15:56:12 +00:00
Tim Northover
4648ae6845 Sparc: fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284605 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 15:55:11 +00:00
Tim Northover
ef2c5dd55c TMP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 15:55:09 +00:00
Tim Northover
dc8499fbc7 GlobalISel: support translating volatile loads and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284603 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 15:55:06 +00:00
Artur Pilipenko
57ea7480ce Introduce ConstantRange.addWithNoSignedWrap
To be used by upcoming change to IndVarSimplify

Reviewed By: sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284597 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 14:44:23 +00:00
Chris Dewhurst
4a9c407929 [Sparc][LEON] Detects an erratum on UT699 LEON 3 processors involving rounding mode changes and issues an appropriate user error message.
Differential Revision: https://reviews.llvm.org/D24665

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 14:01:06 +00:00
Pavel Labath
bca3cda284 Add Chrono.h - std::chrono support header
Summary:
std::chrono mostly covers the functionality of llvm::sys::TimeValue and
lldb_private::TimeValue. This header adds a bit of utility functions and
typedefs, which make the usage of the library and porting code from TimeValues
easier.

Rationale:
- TimePoint typedef - precision of system_clock is implementation defined -
  using a well-defined precision helps maintain consistency between platforms,
  makes it interact better with existing TimeValue classes, and avoids cases
  there a time point is implicitly convertible to a specific precision on some
  platforms but not on others.
- system_clock::to_time_t only accepts time_points with the default system
  precision (even though time_t has only second precision on all platforms we
  support). To avoid the need for explicit casts, I have added a toTimeT()
  wrapper function. toTimePoint(time_t) was not strictly necessary, but I have
  added it for symmetry.

Reviewers: zturner, mehdi_amini

Subscribers: beanz, mgorny, llvm-commits, modocache

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284590 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 13:58:55 +00:00
Sjoerd Meijer
556bf4b535 Reapply r284571 (with the new tests fixed).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 13:43:02 +00:00
NAKAMURA Takumi
a72922e1a6 llvm/test/MC/Mips/macro-ld-sd.s: Sweep a spurious character \xA0 in the test file.
It might crash FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 13:41:12 +00:00
Ulrich Weigand
bc50ab0dfa [SystemZ] Add missing vector instructions for the assembler
Most z13 vector instructions have a base form where the data type of
the operation (whether to consider the vector to be 16 bytes, 8
halfwords, 4 words, or 2 doublewords) is encoded into a mask field,
and then a set of extended mnemonics where the mask field is not
present but the data type is encoded into the mnemonic name.

Currently, LLVM only supports the type-specific forms (since those
are really the ones needed for code generation), but not the base
type-generic forms.

To complete the assembler support and make it fully compatible with
the GNU assembler, this commit adds assembler aliases for all the
base forms of the various vector instructions.

It also adds two more alias forms that are documented in the PoP:
VFPSO/VFPSODB/WFPSODB -- generic form of VFLCDB etc.
VNOT -- special variant of VNO



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284586 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 13:03:18 +00:00
Ulrich Weigand
a91221aaa6 [SystemZ] Add optional argument to some vector string instructions
The vfee[bhf], vfene[bhf], and vistr[bhf] assembler mnemonics are
documented in the Principles of Operation to have an optional last
operand to encode arbitrary values in a mask field.

This commit adds support for those optional operands, and cleans up
the patterns to generate vector string instruction as bit.  No change
to code generation intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284585 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 12:57:46 +00:00