Commit Graph

80230 Commits

Author SHA1 Message Date
Filipe Cabecinhas
6af0f89f37 [IR/AsmWriter] Output escape sequences if the first character isdigit()
If the first character in a metadata attachment's name is a digit, it has
to be output using an escape sequence, otherwise it's not valid text IR.

Removed an over-zealous assert from LLVMContext which didn't allow this.
The rule should only apply to text IR. Actual names can have any sequence
of non-NUL bytes.

Also added some documentation on accepted names.

Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238867 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 21:25:08 +00:00
Filipe Cabecinhas
581e255b1f clang-format a few functions. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238865 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 21:25:00 +00:00
Rafael Espindola
569f382a46 Merge MCELF.h into MCSymbolELF.h.
Now that we have a dedicated type for ELF symbol, these helper functions can
become member function of MCSymbolELF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238864 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 20:38:46 +00:00
Daniel Sanders
92a1dad6d1 [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
Summary:
Following on from r209907 which made personality encodings indirect, do the
same for TType encodings. This fixes the case where a try/catch block needs
to generate references to, for example, std::exception in the
.gcc_except_table.

Previous attempts at committing this broke the buildbots due to bugs in IAS.
These bugs have now been fixed so trying again.

Reviewers: petarj

Reviewed By: petarj

Subscribers: srhines, joerg, tberghammer, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238863 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 20:32:50 +00:00
Tim Northover
33d75a269c AArch64: fix typo in SMIN far atomics and add tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238858 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 18:37:20 +00:00
Duncan P. N. Exon Smith
16fb1632a1 DebugInfo: Really support 2^16 arguments in a subprogram
As a follow-up to r235955, actually support up to 65535 arguments in a
subprogram.  r235955 missed assembly support, having only tested the new
limit via C++ unit tests.  Code patch by Amjad Aboud.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238854 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 17:17:44 +00:00
Daniel Sanders
6c55f8dda7 [mips][mcjit] Add support for R_MIPS_PC32.
Summary:
This allows us to resolve relocations for DW_EH_PE_pcrel TType encodings
in the exception handling LSDA.

Also fixed a nearby typo.

Reviewers: petarj, vkalintiris

Reviewed By: vkalintiris

Subscribers: vkalintiris, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238844 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 15:28:29 +00:00
Benjamin Kramer
5a04f4af36 Push constness through LoopInfo::isLoopHeader and clean it up a bit.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238843 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 15:28:27 +00:00
Sanjay Patel
871beb8dd7 make reciprocal estimate code generation more flexible by adding command-line options (2nd try)
The first try (r238051) to land this was reverted due to bot failures
that were hopefully addressed by r238788.

This patch adds a TargetRecip class for processing many recip codegen possibilities.
The class is intended to handle both command-line options to llc as well
as options passed in from a front-end such as clang with the -mrecip option.

The x86 backend is updated to use the new functionality.
Only -mcpu=btver2 with -ffast-math should see a functional change from this patch.
All other x86 CPUs continue to *not* use reciprocal estimates by default with -ffast-math.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238842 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 15:28:15 +00:00
Elena Demikhovsky
6628cb50bd AVX-512: Implemented VRANGESD and VRANGESS instructions for SKX Implemented DAG lowering for all these forms.
Added tests for encoding.

By Igor Breger (igor.breger@intel.com)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238834 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 14:12:54 +00:00
Elena Demikhovsky
ccbc17f896 AVX-512: Shorten implementation of lowerV16X32VectorShuffle()
using lowerVectorShuffleWithSHUFPS() and other shuffle-helpers routines.
Added matching of VALIGN instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 13:43:18 +00:00
Vasileios Kalintiris
330e5f16d1 [mips] Add support for dynamic stack realignment.
Summary:
With this change we are able to realign the stack dynamically, whenever it
contains objects with alignment requirements that are larger than the
alignment specified from the given ABI.

We have to use the $fp register as the frame pointer when we perform
dynamic stack realignment. In complex stack frames, with variably-sized
objects, we reserve additionally the callee-saved register $s7 as the
base pointer in order to reference locals.

Reviewers: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238829 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 13:14:46 +00:00
Rafael Espindola
9751e35f20 Simplify now that we always use an alignment of 2 for ELF files.
This saves 123144 bytes out of llvm-nm on powerpc64le.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238824 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 12:05:27 +00:00
Renato Golin
6b35bec8ef Revert "ARM: Thumb2 LDRD/STRD supports independent input/output regs"
This reverts commit r238795, as it broke the Thumb2 self-hosting buildbot.

Since self-hosting issues with Clang are hard to investigate, I'm taking the
liberty to revert now, so we can investigate it offline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238821 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 11:47:30 +00:00
Vladimir Sukharev
1e7e9b1881 [AArch64] Add v8.1a atomic instructions
Patch by: Tom Coxon

Reviewers: t.p.northover

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238818 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 10:58:41 +00:00
Toma Tabacu
a5f14070fa [mips] [IAS] Add support for the .set softfloat/hardfloat directives.
Summary: These directives are used to set the current value of the SoftFloat feature.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits, mpf

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238813 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 09:48:04 +00:00
Elena Demikhovsky
d929045eb5 AVX-512: Implemented VFIXUPIMMSD and VFIXUPIMMSS instructions for KNL
Implemented DAG lowering for all these forms.
Added tests for encoding.

By Igor Breger (igor.breger@intel.com)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238811 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 08:28:57 +00:00
Asaf Badouh
aa9e1c528b revert 238809
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238810 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 07:45:19 +00:00
Asaf Badouh
82fa06895e AVX-512: Implemented GETEXP instruction for KNL and SKX
Added rounding mode modifier for SQRTPS/PD
Added tests for encoding and intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238809 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 07:18:14 +00:00
Craig Topper
caa40ec228 [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238808 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 06:19:28 +00:00
Craig Topper
61f49542d7 [TableGen] Rename ListInit::getSize to just 'size' to be more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238806 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 04:15:57 +00:00
Craig Topper
a1bedd75a0 [TableGen] Use range-based for loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238805 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 04:15:51 +00:00
Davide Italiano
69aef63931 [RuntimeDydlELF] Use range-based loop.
Differential Revision:	http://reviews.llvm.org/D10165
Reviewed by:	rafael


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238804 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 01:52:28 +00:00
Rafael Espindola
f7e0685b9a Create a MCSymbolELF.
This create a MCSymbolELF class and moves SymbolSize since only ELF
needs a size expression.

This reduces the size of MCSymbol from 56 to 48 bytes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238801 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 00:25:12 +00:00
Jim Grosbach
398f175c45 MC: Tidy up LOH naming a bit. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238800 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 23:55:06 +00:00
David Majnemer
3ba7d326d5 [Support] Simplify Triple::getOSVersion
Those who are interested in the Android version can use
getEnvironmentVersion instead of getOSVersion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238798 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 23:45:25 +00:00
David Majnemer
3fcfa4873a [ADT] Add Triple::getEnvironmentVersion
This allows us to extract version numbers from the environment.
getOSVersion is currently overloaded for that purpose, this allows us to
clean it up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238796 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 23:38:09 +00:00
Matthias Braun
d421582e90 ARM: Thumb2 LDRD/STRD supports independent input/output regs
The existing code would unnecessarily break LDRD/STRD apart with
non-adjacent registers, on thumb2 this is not necessary.

Ideally on thumb2 we shouldn't match for ldrd/strd pre-regalloc anymore
as there is not reason to set register hints anymore, changing that is
something for a future patch however.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238795 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 23:27:08 +00:00
Matthias Braun
fe1391f07d AArch64: Use CMP;CCMP sequences for and/or/setcc trees.
Previously CCMP/FCCMP instructions were only used by the
AArch64ConditionalCompares pass for control flow. This patch uses them
for SELECT like instructions as well by matching patterns in ISelLowering.

PR20927, rdar://18326194

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238793 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 22:31:17 +00:00
Alexei Starovoitov
0b48e9a83c [bpf] fix build
fix breakage due to r238634

Patch by Vijay Subramanian.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238792 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 22:24:36 +00:00
Owen Anderson
bd84bdb2be Move the name pointer out of Value into a map that lives on the
LLVMContext.  Production builds of clang do not set names on most
Value's, so this is wasted space on almost all subclasses of Value.
This reduces the size of all Value subclasses by 8 bytes on 64 bit
hosts.

The one tricky part of this change is averting compile time regression
by keeping Value::hasName() fast.  This required stealing bits out of
NumOperands.

With this change, peak memory usage on verify-uselistorder-nodbg.lto.bc
is decreased by approximately 2.3% (~3MB absolute on my machine).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238791 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 22:24:01 +00:00
Matt Arsenault
91e4ebaf74 R600/SI: Don't hardcode pointer type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238789 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 21:58:24 +00:00
Sanjay Patel
2c403d6891 add missing dependency for ExecutionEngine lib
This appears to be masked most of the time, but the problem
was exposed on some bots by r238051.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238788 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 21:56:56 +00:00
Matthias Braun
fa2b7e5cb4 LiveRangeEdit: Fix liveranges not shrinking on subrange kill.
If a dead instruction we may not only have a last-use in the main live
range but also in a subregister range if subregisters are tracked. We
need to partially rebuild live ranges in both cases.

The testcase only broke when subregister liveness was enabled. I
commited it in the current form because there is currently no flag to
enable/disable subregister liveness.

This fixes PR23720.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 21:26:26 +00:00
Matthias Braun
a3698105eb ARMLoadStoreOptimizer: Fix doxygen comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 21:26:23 +00:00
Peter Collingbourne
3fcf5a99cb Make the C++ LTO API easier to use from C++ clients.
Start using C++ types such as StringRef and MemoryBuffer in the C++ LTO
API. In doing so, clarify the ownership of the native object file: the caller
now owns it, not the LTOCodeGenerator. The C libLTO library has been modified
to use a derived class of LTOCodeGenerator that owns the object file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238776 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 20:08:30 +00:00
Rafael Espindola
9be6a55ba0 Revert "[Hexagon] Adding basic ELF relocation generation and testing advanced relaxation codepath."
This reverts commit r238748.

It broke the msan bot:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/4372/steps/check-llvm%20msan/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238772 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 19:20:47 +00:00
Owen Anderson
6f9474c1e1 Disable MachineSink on convergent operations, similar to how IR Sink is
restricted.  No test because no in-tree target currently has convergent
MachineInstr's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 17:26:30 +00:00
Owen Anderson
57e487e92c Teach the IR Sink pass to (conservatively) respect convergent annotations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238762 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 17:20:31 +00:00
Vasileios Kalintiris
a509ef9a17 [mips][FastISel] Implement bswap.
Summary: Implement bswap intrinsic for MIPS FastISel. It's very different for misp32 r1/r2 .

Based on a patch by Reed Kotler.

Test Plan:
bswap1.ll
test-suite

Reviewers: dsanders, rkotler

Subscribers: llvm-commits, rfuhler

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238760 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 16:40:45 +00:00
Vasileios Kalintiris
0cc6b87583 [mips][FastISel] Implement intrinsics memset, memcopy & memmove.
Summary:
Implement the intrinsics memset, memcopy and memmove in MIPS FastISel.
Make some needed infrastructure fixes so that this can work.

Based on a patch by Reed Kotler.

Test Plan:
memtest1.ll
The patch passes test-suite for mips32 r1/r2 and at O0/O2

Reviewers: rkotler, dsanders

Subscribers: llvm-commits, rfuhler

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 16:36:01 +00:00
Vasileios Kalintiris
d4b311fb43 [mips][FastISel] Implement srem/urem and sdiv/udiv instructions.
Summary: Implement the LLVM assembly urem/srem and sdiv/udiv instructions in MIPS FastISel.

Based on a patch by Reed Kotler.

Test Plan:
srem1.ll
div1.ll
test-suite at O0/O2 for mips32 r1/r2

Reviewers: dsanders, rkotler

Subscribers: llvm-commits, rfuhler

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238757 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 16:17:37 +00:00
Vasileios Kalintiris
e490b7733a [mips][FastISel] Implement the select statement for MIPS FastISel.
Summary: Implement the LLVM IR select statement for MIPS FastISelsel.

Based on a patch by Reed Kotler.

Test Plan:
"Make check" test included now.
Passes test-suite at O2/O0 mips32 r1/r2.

Reviewers: dsanders, rkotler

Subscribers: llvm-commits, rfuhler

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 15:56:40 +00:00
Vasileios Kalintiris
30b5412d92 [mips][FastISel] Clobber HI0/LO0 registers in MUL instructions.
Summary:
The contents of the HI/LO registers are unpredictable after the execution of
the MUL instruction. In addition to implicitly defining these registers in the
MUL instruction definition, we have to mark those registers as dead too.

Without this the fast register allocator is running out of registers when the
MUL instruction is followed by another one that tries to allocate the AC0
register.

Based on a patch by Reed Kotler.

Reviewers: dsanders, rkotler

Subscribers: llvm-commits, rfuhler

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238755 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 15:48:09 +00:00
Rafael Espindola
872808e946 Fix relocation selection for foo-. on mips.
This handles only the 32 bit case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238751 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 15:10:51 +00:00
Rafael Espindola
30e43fe1a9 Simplify code, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238750 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 14:58:29 +00:00
Artur Pilipenko
d997435840 Add isConstant argument to MDBuilder::createTBAAStructTagNode
According to the TBAA description struct-path tag node can have an optional IsConstant field. Add corresponding argument to MDBuilder::createTBAAStructTagNode.

Reviewed By: hfinkel

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 14:53:55 +00:00
Colin LeMahieu
8a6a249f6b [Hexagon] Adding basic ELF relocation generation and testing advanced relaxation codepath.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238748 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 14:51:26 +00:00
Rafael Espindola
ba9e3285d0 The fragment implies the section, don't store both.
This reduces MCSymbol from 64 to 56 bytes on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 14:34:40 +00:00
Elena Demikhovsky
bbd7cab2b9 AVX-512: Optimized vector shuffle for v16f32 and v16i32 types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-01 13:26:18 +00:00