132651 Commits

Author SHA1 Message Date
Dan Liew
bbd3f4216e [LibFuzzer] Add missing #include<string>
This partially fixes the compilation of the LibFuzzer unit test
on OSX using AppleClang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:54:25 +00:00
Michael Zolotukhin
642359b127 [LoopUnrollAnalyzer] Fix a crash in analyzeLoopUnrollCost.
Condition might be simplified to a Constant, but it doesn't have to be
ConstantInt, so we should dyn_cast, instead of cast.

This fixes PR27886.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:42:51 +00:00
Adrian Prantl
514970f03e PR26055: Speed up LiveDebugValues::transferDebugValue()
This patch builds upon r270776 and speeds up
LiveDebugValues::transferDebugValue() by adding an index that maps each
DebugVariable to its open VarLoc.

The transferDebugValue() function needs to close all open ranges for a
given DebugVariable. Iterating over the set bits of OpenRanges is
prohibitively slow in practice. I experimented with using the sorted map
of VarLocs in the UniqueVector to iterate only over the range of VarLocs
with a given DebugVariable, but the binary search turned out to be even
more expensive than just iterating over the set bits in OpenRanges.
Instead, this patch exploits the fact that there can only be one open
location for each DebugVariable and redundantly stores this location in a
DenseMap.

This patch brings the time spent in the LiveDebugValues pass down to an
almost neglectiable amount.

http://llvm.org/bugs/show_bug.cgi?id=26055
http://reviews.llvm.org/D20636
rdar://problem/24091200

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270923 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:42:47 +00:00
Kostya Serebryany
1c5d1efdb3 [libFuzzer] refactor: hide CurrentUnitData inside an interface function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:32:30 +00:00
Chris Bieneman
81b104b6a0 [Docs][WritingAnLLVMBackend] Makefiles are deprecated
Summary: * docs/WritingAnLLVMBackend.rst: Makefiles are no longer used. The users should use CMakeLists.txt. In order to add the target, the TARGETS_TO_BUILD is replaced with LLVM_ALL_TARGETS.

Reviewers: gribozavr, void, beanz

Subscribers: llvm-commits

Patch By: Visoiu Mistrih Francis (thegameg)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:31:56 +00:00
Chris Bieneman
7593509c1b [obj2yaml][yaml2obj] Support for MachO lazy bindings
This adds support for YAML round tripping dyld info lazy bindings. The storage and format of these is the same as regular bind opcodes, they are just interpreted differently by dyld, and can have DONE opcodes in the middle of the opcode lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:29:39 +00:00
Lang Hames
dfc9470f33 [Kaleidoscope][BuildingAJIT] Remove leftover debugging output statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:27:52 +00:00
Lang Hames
26ec8e8a3d [Kaleidoscope][BuildingAJIT] Fix strong emphasis markup by removing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:21:18 +00:00
Lang Hames
71d351f50d [Kaleidoscope][BuildingAJIT] Add docs for Chapter 3 of the Building A JIT
tutorial.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:17:06 +00:00
Lang Hames
40407440a4 [Error] Make ECError only constructible via errorCodeToError.
This enforces idiomatic usage of ECError removing the option to construct them
using make_error.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:15:58 +00:00
Sanjoy Das
2562aca7c2 Add myself as the code owner for SCEV and IndVarSimplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:12:44 +00:00
Lang Hames
ffdfc78e37 [Kaleidoscope][BuildingAJIT] Add explicit dependence on TransformUtils to Chapter3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:00:29 +00:00
Dan Liew
caa716a991 [LibFuzzer] Emit error if LLVM_USE_SANITIZER is not correctly set.
Previously CMake would successfully configure and compile (with warnings
about ``-fsanitize-coverage=...`` being unused) but the tests LibFuzzer
tests would fail.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:55:09 +00:00
Dan Liew
b82cddc56f [LibFuzzer] Allow LibFuzzer to be built in modes other than RELEASE.
Previously the flags were only being set correctly when the
build type was "Release". Now the build should work properly
for all the supported build types. When building libFuzzer
the optimization level respects whatever is used for the
rest of LLVM but for the LibFuzzer tests we force -O0.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:55:05 +00:00
Chris Bieneman
429d7a4cff [obj2yaml][yaml2obj] Support for MachO weak bindings
This adds support for YAML round tripping dyld info weak bindings. The storage and format of these is the same as regular bind opcodes, they are just interpreted differently by dyld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:50:05 +00:00
Lang Hames
e0c300733e [Kaleidoscope][BuildingAJIT] Add code for Chapter 3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:35:39 +00:00
Lang Hames
f8e8d07f49 [Orc] Don't create empty globals modules in the CompileOnDemandLayer.
Global variables and aliases are emitted eagerly, but there may not be any in
the incoming module. In that case, we can save some memory and compile time by
not building, emitting and tracking an empty globals module.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:33:37 +00:00
Rafael Espindola
746036c22a coff: fix weak alias to local.
We were creating a weak external that tried to reference a static symbol. That
would always fail to link with link.exe.

We now create an external symbol in the same position as the local and refer
to that. This works with link.exe and matches what gas does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:31:00 +00:00
Kostya Serebryany
ddaf22d2ba [libFuzzer] when there is a leak in the existing corpus report the reproducer properly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:25:49 +00:00
Richard Smith
60364032ef Don't use recursion to print out the PrettyStackTrace after a crash. If the
crash was due to a stack overflow, chances are good that this would also cause
a stack overflow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:21:55 +00:00
Richard Smith
baaf0f7642 Add new .def file to module map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:13:50 +00:00
Chris Bieneman
7ad3d3b16b [obj2yaml][yaml2obj] Support for MachO bind opcodes
This adds support for YAML round tripping dyld info bind opcodes. Bind opcodes can have signed or unsigned LEB128 data, and they can have symbols associated with them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:06:14 +00:00
Kostya Serebryany
34fca4b9ec [libFuzzer] reimplement the way we do -only_ascii to allow more 'const' in function declarations. Add a test for -only_ascii. NFC intended
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:03:02 +00:00
Lang Hames
67faeedf47 [Kaleidoscope][BuildingAJIT] Fix a bug in the symbol resolver in Chapter2.
Symbol resolution should be done on the top layer of the stack unless there's a
good reason to do otherwise. In this case it would have worked because
OptimizeLayer::addModuleSet eagerly passes all modules down to the
CompileLayer, meaning that searches in CompileLayer will find the definitions.
In later chapters where the top layer's addModuleSet isn't a pass-through, this
would break.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 19:44:33 +00:00
Krzysztof Parzyszek
fd1e14e505 [Hexagon] Enable the post-RA scheduler
The aggressive anti-dependency breaker can rename the restored callee-
saved registers. To prevent this, mark these registers are live on all
paths to the return/tail-call instructions, and add implicit use operands
for them to these instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 19:44:28 +00:00
Chad Rosier
6b9dd0cef1 [AArch64] Generate rev16/rev32 from bswap + srl when upper bits are known zero.
Canonicalize (srl (bswap i32 x), 16) to (rotr (bswap i32 x), 16), if the high
16-bits of x are zero. Similarly, canonicalize (srl (bswap i64 x), 32) to
(rotr (bswap i64 x), 32), if the high 32-bits of x are zero.

test_rev_w_srl16:            test_rev_w_srl16:
  and w8, w0, #0xffff          and     w8, w0, #0xffff
  rev w8, w8           --->    rev16   w0, w8
  lsr     w0, w8, #16

test_rev_x_srl32:            test_rev_x_srl32:
  rev x8, x8           --->    rev32   x0, x8
  lsr x0, x8, #32

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 19:41:33 +00:00
Changpeng Fang
faf7289db3 AMDGPU/SI: Enable load-store-opt by default.
Summary: Enable load-store-opt by default, and update LIT tests.

Reviewers: arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270894 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 19:35:29 +00:00
Michael Kuperstein
b80d8daba8 [BasicAA] Extend inbound GEP negative offset logic to GlobalVariables
r270777 improved the precision of alloca vs. inbounbds GEP alias queries: if
we have (a) an inbounds GEP and (b) a pointer based on an alloca, and the
beginning of the object the GEP points to would have a negative offset with
respect to the alloca, then the GEP can not alias pointer (b).

This makes the same logic fire when (b) is based on a GlobalVariable instead
of an alloca.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 19:30:49 +00:00
David Majnemer
4b3bb8d03e [MemCpyOpt] Don't perform callslot optimization across may-throw calls
An exception could prevent a store from occurring but MemCpyOpt's
callslot optimization would fire anyway, causing the store to occur.

This fixes PR27849.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 19:24:24 +00:00
Rafael Espindola
8d48aba10b coff: fix the section of weak symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 18:48:23 +00:00
Michael Kuperstein
a8a201a894 [BBVectorize] Don't vectorize selects with a scalar condition and vector operands.
This fixes PR27879.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270888 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 18:43:57 +00:00
Krzysztof Parzyszek
422399f9c7 Add test/CodeGen/MIR/Hexagon/lit.local.cfg
Require that Hexagon is a registered target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270887 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 18:35:45 +00:00
Krzysztof Parzyszek
e19980c408 Do not rename registers that do not start an independent live range
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 18:22:53 +00:00
Rafael Espindola
018780927c coff: fix the value of weak definitions.
It looks like this doesn't get a lot of use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 18:04:53 +00:00
Pete Cooper
18a6f17098 Don't allocate in APInt::slt. NFC.
APInt::slt was copying the LHS and RHS in to temporaries then making
them unsigned so that it could use an unsigned comparision.  It did
this even on the paths which were trivial to give results for, such
as the sign bit of the LHS being set while RHS was not set.

This changes the logic to return out immediately in the trivial cases,
and use an unsigned comparison in the remaining cases.  But this time,
just use the unsigned comparison directly without creating any temporaries.

This works because, for example:
  true = (-2 slt -1) = (0xFE ult 0xFF)

Also added some tests explicitly for slt with APInt's larger than 64-bits
so that this new code is tested.

Using the memory for 'opt -O2 verify-uselistorder.lto.opt.bc -o opt.bc'
(see r236629 for details), this reduces the number of allocations from
26.8M to 23.9M.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:40:07 +00:00
David Majnemer
9139142972 [CaptureTracking] Volatile operations capture their memory location
The memory location that corresponds to a volatile operation is very
special.  They are observed by the machine in ways which we cannot
reason about.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270879 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:36:22 +00:00
Artem Belevich
c1645b33e4 Init member structs in constructor.
Fixes build error on windows where MSVC does not
support list initialization inside member initializer list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270877 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:29:20 +00:00
Xinliang David Li
f18a32f1af Revert 270865 -- unexplained bot failure on linux/ppcle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:27:22 +00:00
Lang Hames
69bb6054b5 [Orc] Merge some common code for creating CompileCallbackManagers and
IndirectStubsManagers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:20:35 +00:00
Artem Belevich
bd2219ad6e [NVPTX] Added NVVMIntrRange pass
NVVMIntrRange adds !range metadata to calls of NVVM intrinsics
that return values within known limited range.

This allows LLVM to generate optimal code for indexing arrays
based on tid/ctaid which is a frequently used pattern in CUDA code.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:02:56 +00:00
Artem Tamazov
cf3177d552 [AMDGPU][llvm-mc] s_getreg/setreg* - hwreg - factor out strings/literals etc.
Hwreg(...) syntax implementation unified with sendmsg(...).
Common strings moved to Utils
MathExtras.h functionality utilized.
Added missing build dependency in Disassembler.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:00:33 +00:00
Chris Bieneman
26cbd17577 [CMake] Restrict libxar linkage to just llvm-objdump
At some point we're going to need libObject to have this dependency, but as it is now this is causing too many headaches. This commit will reduce the linkage to just llvm-objdump where it is strictly needed, and we'll cross the libObject bridge later when we need it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 16:32:40 +00:00
Xinliang David Li
e859870381 Use new interface in Triple /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 16:28:01 +00:00
Adrian Prantl
7fc375e6c4 Undo a suboptimal clang-format decision. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 16:06:04 +00:00
Ismail Donmez
6803422ad6 Since some time clang itself figures out the default for ms-compatibility-version and uses it. Trying to figure it out during build is redundant and also will not work when the environment variable VSINSTALLDIR is not defined (which is not defined if you don't install whole Visual Studio but use Visual C++ Build Tools package).
Tested by bootstrapping clang with clang-cl.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 15:52:23 +00:00
Artem Tamazov
a14da14da0 Fix build warning introduced in r270552 "[AMDGPU][llvm-mc] Disassembler: support for TTMP/TBA/TMA registers."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 15:52:16 +00:00
Simon Pilgrim
1f433c478c [X86][SSE] When lowering a 256-bit shuffle as PMOVZX, reduce the input vector to the lower 128-bit subvector.
Most often as not this is what it started out as, the extraction is zero-cost on AVX and the PMOVZX/PMOVSX folding logic is based around 128-bit loads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 15:40:36 +00:00
Krzysztof Parzyszek
32afd6e7e7 [Hexagon] Select the aggressive anti-dependency breaker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 15:38:50 +00:00
Diana Picus
f46038dc53 [AMDGPU] Remove exit-on-error flag from test (PR27762)
Similar to r269948, but for argument lowering.

Fixes PR27762

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 15:24:55 +00:00
Diana Picus
e4d541946d [BPF] Remove exit-on-error flag in test (PR27767)
The exit-on-error flag is needed to avoid an assert where
llvm::SelectionDAGISel::LowerArguments doesn't create enough arguments. Fill up
with zeroes to reach the right number of args.

Fixes PR27767.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 15:23:50 +00:00