Colin LeMahieu [Fri, 12 Dec 2014 21:29:25 +0000 (21:29 +0000)]
[Hexagon] Adding double word add/min/minu/max/maxu instructions and tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224153
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 12 Dec 2014 21:25:07 +0000 (21:25 +0000)]
Revert r224149, llvm-dsymutil was already here.
I saw a failure on an internal bot, opened this file, saw it was missing,
thought "aha!", tried to land, got an "file is out of date", synced, didn't see
the file listed right above the line I added (cause I didn't add it in the
right place) and landed. Apologies!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224152
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 12 Dec 2014 21:12:27 +0000 (21:12 +0000)]
[Hexagon] Adding J class call instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224150
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 12 Dec 2014 20:56:49 +0000 (20:56 +0000)]
Add llvm-dsymutil to test/CMakeLists.txt
r224134 added this and runs it from a test, but doesn't build it with test
binaries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224149
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 12 Dec 2014 19:24:33 +0000 (19:24 +0000)]
IR: Don't track nullptr on metadata RAUW
The RAUW support in `Metadata` supports going to `nullptr` specifically
to handle values being deleted, causing `ValueAsMetadata` to be deleted.
Fix the case where the reference is from a `TrackingMDRef` (as opposed
to an `MDOperand` or a `MetadataAsValue`).
This is surprisingly rare -- metadata tracked by `TrackingMDRef` going
to null -- but it came up in an openSUSE bootstrap during inlining. The
tracking ref was held by the `ValueMap` because it was referencing a
local, the basic block containing the local became dead after it had
been merged in, and when the local was deleted, the tracking ref
asserted in an `isa`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224146
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Dec 2014 19:12:42 +0000 (19:12 +0000)]
MAP_FILE is the default. We don't need to add it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224144
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 12 Dec 2014 18:52:07 +0000 (18:52 +0000)]
Relax debug-map-parsing.test error message check for Windows
On Windows we get the string "no such file or directory".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224141
91177308-0d34-0410-b5e6-
96231b3b80d8
Steven Wu [Fri, 12 Dec 2014 18:48:37 +0000 (18:48 +0000)]
More code format fix from r224133, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224140
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Dec 2014 18:37:43 +0000 (18:37 +0000)]
Remove silly left over from the Windows resize_file implementation.
I didn't notice the problem first because on a non debug build the CRT was
just exiting the process without any message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224139
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Dec 2014 18:13:23 +0000 (18:13 +0000)]
Move the resize file feature from mapped_file_region to the only user.
This removes a duplicated stat on every file that llvm-ar looks at.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224138
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Dec 2014 17:55:12 +0000 (17:55 +0000)]
Pass a FD to resise_file and add a testcase.
I will add a real use in another commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224136
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Dec 2014 17:35:34 +0000 (17:35 +0000)]
Remove unused feature. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224135
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 12 Dec 2014 17:31:24 +0000 (17:31 +0000)]
Initial dsymutil tool commit.
The goal of this tool is to replicate Darwin's dsymutil functionality
based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does
not link the debug information, it leaves it in the object files in
relocatable form, but embbeds a `debug map` into the executable that
describes where to find the debug information and how to relocate it.
When releasing/archiving a binary, dsymutil is called to link all the DWARF
information into a `dsym bundle` that can distributed/stored along with
the binary.
With this commit, the LLVM based dsymutil is just able to parse the STABS
debug maps embedded by ld64 in linked binaries (and not all of them, for
example archives aren't supported yet).
Note that the tool directory is called dsymutil, but the executable is
currently called llvm-dsymutil. This discrepancy will disappear once the
tool will be feature complete. At this point the executable will be renamed
to dsymutil, but until then you do not want it to override the system one.
Differential Revision: http://reviews.llvm.org/D6242
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224134
91177308-0d34-0410-b5e6-
96231b3b80d8
Steven Wu [Fri, 12 Dec 2014 17:21:54 +0000 (17:21 +0000)]
Restructure code from r224097. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224133
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Fri, 12 Dec 2014 17:02:18 +0000 (17:02 +0000)]
[AVX512] Enabling bit logic lowering
Added lowering tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224132
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Dec 2014 15:32:23 +0000 (15:32 +0000)]
Now that we require a newer python, use the new exception syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224130
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Dec 2014 15:29:31 +0000 (15:29 +0000)]
Require python 2.7.
We were already requiring 2.5, which meant that people on old linux distros
had to upgrade anyway.
Requiring python 2.6 will make supporting 3.X easier as we can use the 3.X
exception syntax.
According to the discussion on llvmdev, there is not much value is requiring
just 2.6, we may as well just require 2.7.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224129
91177308-0d34-0410-b5e6-
96231b3b80d8
Vasileios Kalintiris [Fri, 12 Dec 2014 15:16:46 +0000 (15:16 +0000)]
[mips] Enable code generation for MIPS-III.
Summary:
This commit enables the MIPS-III target and adds support for code
generation of SELECT nodes. We have to use pseudo-instructions with
custom inserters for these nodes as MIPS-III CPUs do not have
conditional-move instructions.
Depends on D6212
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6464
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224128
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Fri, 12 Dec 2014 15:10:43 +0000 (15:10 +0000)]
[AVX512] Enabling MIN/MAX lowering.
Added lowering tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224127
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Fri, 12 Dec 2014 15:09:58 +0000 (15:09 +0000)]
Reapply "[MachineScheduler] Fix for PR21807: minor code difference building with/without -g."
This reapplies r224118 with a fix for test 'misched-code-difference-with-debug.ll'.
That test was failing on some buildbots because it was x86 specific but it was
missing a target triple.
Added an explicit triple to test misched-code-difference-with-debug.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224126
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 12 Dec 2014 14:44:12 +0000 (14:44 +0000)]
[Reassociate] Use dbgs() instead of errs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224125
91177308-0d34-0410-b5e6-
96231b3b80d8
Vasileios Kalintiris [Fri, 12 Dec 2014 14:41:37 +0000 (14:41 +0000)]
[mips] Support SELECT nodes for targets that don't have conditional-move instructions.
Summary:
For Mips targets that do not have conditional-move instructions, ie. targets
before MIPS32 and MIPS-IV, we have to insert a diamond control-flow
pattern in order to support SELECT nodes. In order to do that, we add
pseudo-instructions with a custom inserter that emits the necessary
control-flow that selects the correct value.
With this patch we add complete support for code generation of Mips-II targets
based on the LLVM test-suite.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6212
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224124
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Dec 2014 14:28:19 +0000 (14:28 +0000)]
Disable --icf=safe to avoid a bug.
Thanks to Sameer Sahasrabuddhe for the report!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224123
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Fri, 12 Dec 2014 14:21:30 +0000 (14:21 +0000)]
[AVX512] Minor fix in lowering pattern for broadcast intrustions.
No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224122
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Fri, 12 Dec 2014 13:34:03 +0000 (13:34 +0000)]
Revert: [MachineScheduler] Fix for PR21807: minor code difference building with/without -g.
Test 'misched-code-difference-with-debug.ll' was failing on some buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224121
91177308-0d34-0410-b5e6-
96231b3b80d8
Suyog Sarda [Fri, 12 Dec 2014 12:53:44 +0000 (12:53 +0000)]
This patch recognizes (+ (+ v0, v1) (+ v2, v3)), reorders them for bundling into vector of loads,
and vectorizes it.
Test case :
float hadd(float* a) {
return (a[0] + a[1]) + (a[2] + a[3]);
}
AArch64 assembly before patch :
ldp s0, s1, [x0]
ldp s2, s3, [x0, #8]
fadd s0, s0, s1
fadd s1, s2, s3
fadd s0, s0, s1
ret
AArch64 assembly after patch :
ldp d0, d1, [x0]
fadd v0.2s, v0.2s, v1.2s
faddp s0, v0.2s
ret
Reviewed Link : http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20141208/248531.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224119
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Fri, 12 Dec 2014 12:41:22 +0000 (12:41 +0000)]
[MachineScheduler] Fix for PR21807: minor code difference building with/without -g.
This patch fixes the issue reported as PR21807. There was a minor difference
in the generated code depending on the -g flag.
The cause was that with -g the machine scheduler used a different
scheduling strategy. This decision was based on the number of instructions
in a schedule region and included debug instructions in that count.
This patch fixes the issue in MISched and provides a test.
Patch by Russell Gallop!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224118
91177308-0d34-0410-b5e6-
96231b3b80d8
Charlie Turner [Fri, 12 Dec 2014 11:59:18 +0000 (11:59 +0000)]
Emit Tag_ABI_FP_16bit_format build attribute.
The __fp16 type is unconditionally exposed. Since -mfp16-format is not yet
supported, there is not a user switch to change this behaviour. This build
attribute should capture the default behaviour of the compiler, which is to
expose the IEEE 754 version of __fp16.
When -mfp16-format is emitted, that will be the way to control the value of
this build attribute.
Change-Id: I8a46641ff0fd2ef8ad0af5f482a6d1af2ac3f6b0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224115
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 12 Dec 2014 11:07:51 +0000 (11:07 +0000)]
Silence gcc 4.9.1 warning 'xyz' is used uninitialized in this function.
In release builds this is actually possible as without asserts there is
no testing of the actual read bytes and the variables could be partially
uninitialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224114
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 12 Dec 2014 07:52:19 +0000 (07:52 +0000)]
Pass output stream to AsLexInput instead of the whole tool_output_file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224109
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 12 Dec 2014 07:52:16 +0000 (07:52 +0000)]
Use unique_ptr to remove an explicit delete. Change return type to pass the unique_ptr to caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224108
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 12 Dec 2014 07:52:14 +0000 (07:52 +0000)]
Use make_unique instead of reset() and 'new'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224107
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 12 Dec 2014 07:52:11 +0000 (07:52 +0000)]
Use range-based for loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224106
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 12 Dec 2014 07:52:09 +0000 (07:52 +0000)]
Remove unnecessary calls to unique_ptr::get.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224105
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 12 Dec 2014 07:52:06 +0000 (07:52 +0000)]
Remove an unnecessary reference variable that pointed to a unique_ptr variable. Just use the unique_ptr variable directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224104
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 12 Dec 2014 07:52:00 +0000 (07:52 +0000)]
Use unique_ptr operator= instead of constructor to make it explicit that there's no conversion occurring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224103
91177308-0d34-0410-b5e6-
96231b3b80d8
Ekaterina Romanova [Fri, 12 Dec 2014 05:11:47 +0000 (05:11 +0000)]
A fix for PR21176.
DW_OP_const <const> doesn't describe a constant value, but a value at a constant address.
The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value.
Added DW_OP_stack_value to the stack.
Marked incorrect-variable-debugloc1.ll to xfail for PowerPC64, while the the failure (PR21881)
is being investigated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224098
91177308-0d34-0410-b5e6-
96231b3b80d8
Steven Wu [Fri, 12 Dec 2014 04:34:07 +0000 (04:34 +0000)]
Fix another infinite loop in InstCombine
Summary:
InstCombine infinite-loops for the testcase added
It is because InstCombine is generating instructions that can be
optimized by itself. Fix by not optimizing frem if the optimized
type is the same as original type.
rdar://problem/
19150820
Reviewers: majnemer
Differential Revision: http://reviews.llvm.org/D6634
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224097
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 12 Dec 2014 02:30:37 +0000 (02:30 +0000)]
R600: Fix min/max matching problems with unordered compares
The returned operand needs to be permuted for the unordered
compares. Also fix incorrectly producing fmin_legacy / fmax_legacy
for f64, which don't exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224094
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 12 Dec 2014 02:30:33 +0000 (02:30 +0000)]
R600/SI: fmin/fmax_legacy are not associative
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224093
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 12 Dec 2014 02:30:29 +0000 (02:30 +0000)]
R600/SI: Don't promote f32 select to i32
This is nice for the instruction patterns, but it complicates
min / max matching. The select doesn't have the correct type and would
require looking through the bitcasts for the real float operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224092
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 12 Dec 2014 02:25:18 +0000 (02:25 +0000)]
Update the modules build to match r223802.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224091
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 12 Dec 2014 02:11:31 +0000 (02:11 +0000)]
Bitcode: Add missing "Remove in 4.0" comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224090
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 12 Dec 2014 01:27:01 +0000 (01:27 +0000)]
Document that PassManager::add() may delete the pass right away.
Also remove redundant documentation:
- doxygen will copy documentation to overriden methods.
- Use \copydoc on PIMPL classes instead of replicating the text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224089
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 12 Dec 2014 01:11:48 +0000 (01:11 +0000)]
Tom Stellard is now the code owner for libclc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224088
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 12 Dec 2014 00:49:03 +0000 (00:49 +0000)]
Comment and minor code cleanup for GCStrategy (NFC)
Updating comments to reflect the current state of the world after my recent changes to ownership structure and generally better describe what a GCStrategy is and how it works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224086
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 12 Dec 2014 00:00:24 +0000 (00:00 +0000)]
Add target hook for whether it is profitable to reduce load widths
Add an option to disable optimization to shrink truncated larger type
loads to smaller type loads. On SI this prevents using scalar load
instructions in some cases, since there are no scalar extloads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224084
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 11 Dec 2014 23:38:43 +0000 (23:38 +0000)]
remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224080
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 11 Dec 2014 23:37:34 +0000 (23:37 +0000)]
R600/SI: Handle physical registers in getOpRegClass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224079
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 11 Dec 2014 23:37:32 +0000 (23:37 +0000)]
R600/SI: Don't verify constant bus usage of flag ops
This was checking if pseudo-operands like the source
modifiers were using the constant bus, which happens to work
because the values these all can be happen to be valid inline
immediates.
This fixes a later commit which starts checking the register class
of the operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224078
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 23:34:30 +0000 (23:34 +0000)]
Bitcode: Use unsigned char to record MDStrings
`MDString`s can have arbitrary characters in them. Prevent an assertion
that fired in `BitcodeWriter` because of sign extension by copying the
characters into the record as `unsigned char`s.
Based on a patch by Keno Fischer; fixes PR21882.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224077
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 11 Dec 2014 23:30:36 +0000 (23:30 +0000)]
return without temporary; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224076
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 11 Dec 2014 23:18:03 +0000 (23:18 +0000)]
Enable MachineVerifier in debug mode for X86, ARM, AArch64, Mips.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224075
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Thu, 11 Dec 2014 23:07:52 +0000 (23:07 +0000)]
[X86] Add a temporary testcase for PR21876/r223996.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224074
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 23:02:24 +0000 (23:02 +0000)]
Bitcode: Add METADATA_NODE and METADATA_VALUE
This reflects the typelessness of `Metadata` in the bitcode format,
removing types from all metadata operands.
`METADATA_VALUE` represents a `ValueAsMetadata`, and always has two
fields: the type and the value.
`METADATA_NODE` represents an `MDNode`, and unlike `METADATA_OLD_NODE`,
doesn't store types. It stores operands at their ID+1 so that `0` can
reference `nullptr` operands.
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224073
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 11 Dec 2014 22:51:06 +0000 (22:51 +0000)]
[PowerPC] Better lowering for add/or of a FrameIndex
If we have an add (or an or that is really an add), where one operand is a
FrameIndex and the other operand is a small constant, we can combine the
lowering of the FrameIndex (which is lowered as an add of the FI and a zero
offset) with the constant operand.
Amusingly, this is an old potential improvement entry from
lib/Target/PowerPC/README.txt which had never been resolved. In short, we used
to lower:
%X = alloca { i32, i32 }
%Y = getelementptr {i32,i32}* %X, i32 0, i32 1
ret i32* %Y
as:
addi 3, 1, -8
ori 3, 3, 4
blr
and now we produce:
addi 3, 1, -4
blr
which is much more sensible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224071
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 22:30:48 +0000 (22:30 +0000)]
Bitcode: Add `OLD_` prefix to metadata node records
I'm about to change these, so move the old ones out of the way.
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224070
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 11 Dec 2014 22:27:14 +0000 (22:27 +0000)]
Try to include operand counts for mismatches in tablegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224068
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 11 Dec 2014 22:15:43 +0000 (22:15 +0000)]
R600/SI: Use unordered equal instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224067
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 11 Dec 2014 22:15:39 +0000 (22:15 +0000)]
R600/SI: Make more unordered comparisons legal
This saves a second compare and an and / or by using
the unordered comparison instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224066
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 11 Dec 2014 22:15:35 +0000 (22:15 +0000)]
R600/SI: Use unordered not equal instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224065
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 11 Dec 2014 21:53:03 +0000 (21:53 +0000)]
[ASan] Change fake stack and local variables handling.
This commit changes the way we get fake stack from ASan runtime
(to find use-after-return errors) and the way we represent local
variables:
- __asan_stack_malloc function now returns pointer to newly allocated
fake stack frame, or NULL if frame cannot be allocated. It doesn't
take pointer to real stack as an input argument, it is calculated
inside the runtime.
- __asan_stack_free function doesn't take pointer to real stack as
an input argument. Now this function is never called if fake stack
frame wasn't allocated.
- __asan_init version is bumped to reflect changes in the ABI.
- new flag "-asan-stack-dynamic-alloca" allows to store all the
function local variables in a dynamic alloca, instead of the static
one. It reduces the stack space usage in use-after-return mode
(dynamic alloca will not be called if the local variables are stored
in a fake stack), and improves the debug info quality for local
variables (they will not be described relatively to %rbp/%rsp, which
are assumed to be clobbered by function calls). This flag is turned
off by default for now, but I plan to turn it on after more
testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224062
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 21:51:37 +0000 (21:51 +0000)]
CodeGen: Stop using LeakDetector for MachineInstr
Since `MachineInstr` is required to have a trivial destructor, it cannot
remove itself from `LeakDetection`. Remove the calls.
As it happens, this requirement is because `MachineFunction` allocates
all `MachineInstr`s in a custom allocator; when the `MachineFunction` is
destroyed they're dropped of the edge. There's no benefit to detecting
leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224061
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 21:39:39 +0000 (21:39 +0000)]
IR: Store MDNodes in a separate LeakDetector container
This gives us better leak detection messages, like `Value` has.
This also has the side effect of papering over a problem where
`MachineInstr`s are added as garbage to the leak detector and then
deleted without being removed. If `MDNode::getTemporary()` allocates an
`MDNodeFwdDecl` in the same spot, the leak detector asserts. By
separating `MDNode`s into their own container we lose that assertion.
Since `MachineInstr` is required to have a trivial destructor, its usage
of `LeakDetector` at all is pretty suspect. I'll be sending a patch
soon to strip that out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224060
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 11 Dec 2014 21:26:47 +0000 (21:26 +0000)]
[CodeGen] Add print and verify pass after each MachineFunctionPass by default
Previously print+verify passes were added in a very unsystematic way, which is
annoying when debugging as you miss intermediate steps and allows bugs to stay
unnotice when no verification is performed.
To make this change practical I added the possibility to explicitely disable
verification. I used this option on all places where no verification was
performed previously (because alot of places actually don't pass the
MachineVerifier).
In the long term these problems should be fixed properly and verification
enabled after each pass. I'll enable some more verification in subsequent
commits.
This is the 2nd attempt at this after realizing that PassManager::add() may
actually delete the pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224059
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 21:23:43 +0000 (21:23 +0000)]
LeakDetector: Simplify code and fix comments, NFC
Rather than requiring overloads in the wrapper and the impl, just
overload the impl and use templates in the wrapper. This makes it less
error prone to add more overloads (`void *` defeats any chance the
compiler has at noticing bugs, so the easier the better).
At the same time, correct the comment that was lying about not changing
functionality for `Value`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224058
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 11 Dec 2014 20:51:54 +0000 (20:51 +0000)]
AsmParser: Don't crash on an ill-formed MDNodeVector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224056
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Thu, 11 Dec 2014 20:44:59 +0000 (20:44 +0000)]
[InstCombine][X86] Improved folding of calls to Intrinsic::x86_sse4a_insertqi.
This patch teaches the instruction combiner how to fold a call to 'insertqi' if
the 'length field' (3rd operand) is set to zero, and if the sum between
field 'length' and 'bit index' (4th operand) is bigger than 64.
From the AMD64 Architecture Programmer's Manual:
1. If the sum of the bit index + length field is greater than 64, then the
results are undefined;
2. A value of zero in the field length is defined as a length of 64.
This patch improves the existing combining logic for intrinsic 'insertqi'
adding extra checks to address both point 1. and point 2.
Differential Revision: http://reviews.llvm.org/D6583
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224054
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 11 Dec 2014 20:44:09 +0000 (20:44 +0000)]
AsmParser: Don't crash on an ill-formed MDNodeVector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224053
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 11 Dec 2014 20:12:55 +0000 (20:12 +0000)]
Remove a convoluted way of calling close by moving the call to the only caller.
As a bonus we can actually check the return value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224046
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 11 Dec 2014 20:03:57 +0000 (20:03 +0000)]
This reverts commit r224043 and r224042.
check-llvm was failing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224045
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Thu, 11 Dec 2014 19:46:38 +0000 (19:46 +0000)]
Silence static analyzer warnings in LLVMSupport.
The static analyzer catches a few potential bugs in LLVMSupport. Add
in asserts to silence the warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224044
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 11 Dec 2014 19:42:09 +0000 (19:42 +0000)]
Enable machineverifier in debug mode for X86, ARM, AArch64, Mips
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224043
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 11 Dec 2014 19:42:05 +0000 (19:42 +0000)]
[CodeGen] Add print and verify pass after each MachineFunctionPass by default
Previously print+verify passes were added in a very unsystematic way, which is
annoying when debugging as you miss intermediate steps and allows bugs to stay
unnotice when no verification is performed.
To make this change practical I added the possibility to explicitely disable
verification. I used this option on all places where no verification was
performed previously (because alot of places actually don't pass the
MachineVerifier).
In the long term these problems should be fixed properly and verification
enabled after each pass. I'll enable some more verification in subsequent
commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224042
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 11 Dec 2014 19:41:51 +0000 (19:41 +0000)]
[CodeGen] Let MachineVerifierPass own its banner string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224041
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 11 Dec 2014 19:01:28 +0000 (19:01 +0000)]
[Hexagon] Renaming classes in preparation for replacement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224036
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 11 Dec 2014 18:49:37 +0000 (18:49 +0000)]
ARM: convert isTargetIOS checks to isTargetDarwin.
The distinction is mostly useful in the front-end. By the time we get here,
there are very few situations where we actually want different behaviour for
Darwin and IOS (in fact Darwin mostly just exists in a few tests). So this
should reduce any surprising weirdness for anyone using it.
No functional change on anything anyone actually cares about.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224035
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 11 Dec 2014 18:37:52 +0000 (18:37 +0000)]
[PowerPC] Implement BuildSDIVPow2, lower i64 pow2 sdiv using sradi
PPCISelDAGToDAG contained existing code to lower i32 sdiv by a power-of-2 using
srawi/addze, but did not implement the i64 case. DAGCombine now contains a
callback specifically designed for this purpose (BuildSDIVPow2), and part of
the logic has been moved to an implementation of that callback. Doing this
lowering using BuildSDIVPow2 likely does not matter, compared to handling
everything in PPCISelDAGToDAG, for the positive divisor case, but the negative
divisor case, which generates an additional negation, can potentially benefit
from additional folding from DAGCombine. Now, both the i32 and the i64 cases
have been implemented.
Fixes PR20732.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224033
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 11 Dec 2014 17:17:26 +0000 (17:17 +0000)]
Remove dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224029
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron McInally [Thu, 11 Dec 2014 17:13:05 +0000 (17:13 +0000)]
[AVX512] Add support for 512b variable bit shift intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224028
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 11 Dec 2014 17:08:21 +0000 (17:08 +0000)]
[Hexagon] Ading i64 <- i32, i32 sextw pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224027
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 11 Dec 2014 16:43:06 +0000 (16:43 +0000)]
[Hexagon] Adding encoding information for sign extend word instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224026
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 11 Dec 2014 16:34:00 +0000 (16:34 +0000)]
Only seek once before writing the member offsets.
This cuts down the number on system calls done by a static llvm-ar producing
lib/libclangSema.a from 9164 to 442.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224025
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 11 Dec 2014 15:16:14 +0000 (15:16 +0000)]
llvm-ar: close input files early.
We already have them mapped into memory, so we can just close the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224020
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 11 Dec 2014 15:02:24 +0000 (15:02 +0000)]
AVX-512: Added all forms of COMPRESS instruction
+ intrinsics + tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224019
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Thu, 11 Dec 2014 13:56:23 +0000 (13:56 +0000)]
[mips][microMIPS] Implement CodeGen support for LI16 instruction.
Differential Revision: http://reviews.llvm.org/D5840
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224017
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 11 Dec 2014 12:56:17 +0000 (12:56 +0000)]
InstSimplify: Remove usesless %a parameter from tests
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224016
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 11 Dec 2014 12:41:10 +0000 (12:41 +0000)]
The inliner needs to fix up debug information for llvm.dbg.declare, not only for llvm.dbg.value.
Patch by Amjad Aboud
Differential Revision: http://reviews.llvm.org/D6525
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224015
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 11 Dec 2014 11:30:20 +0000 (11:30 +0000)]
Add newline missing in r224010.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224011
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 11 Dec 2014 11:26:16 +0000 (11:26 +0000)]
[X86] When converting movs to pushes, don't assume MOVmi operand is an actual immediate
This should fix PR21878.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224010
91177308-0d34-0410-b5e6-
96231b3b80d8
Patrik Hagglund [Thu, 11 Dec 2014 10:40:17 +0000 (10:40 +0000)]
Bugfix in InlineSpiller::traceSiblingValue().
Properly determine whether or not a phi was added by splitting.
Check against the current VNInfo of OrigLI instead of against the
OrigVNI argument.
Patch provided by Jonas Paulsson. Reviewed by Quentin Colombet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224009
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 11 Dec 2014 10:21:12 +0000 (10:21 +0000)]
AVX-512: Fixed a bug in lowering setcc for MVT::i1 type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224008
91177308-0d34-0410-b5e6-
96231b3b80d8
Kumar Sukhani [Thu, 11 Dec 2014 08:33:36 +0000 (08:33 +0000)]
test commit (spelling correction)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224007
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Eckstein [Thu, 11 Dec 2014 08:02:30 +0000 (08:02 +0000)]
Refactor creation of overflow result tuples in InstCombineCalls.
Extract the creation of overflow result tuples in a separate function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224006
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 11 Dec 2014 07:04:54 +0000 (07:04 +0000)]
Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224005
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 11 Dec 2014 07:04:52 +0000 (07:04 +0000)]
Just use the Module unique_ptr object directly in many places instead of separate pointer that's kept in sync with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224004
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 11 Dec 2014 07:04:46 +0000 (07:04 +0000)]
Use unique_ptr to remove an explicit delete. Change return type to pass the unique_ptr to caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224003
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 11 Dec 2014 06:32:29 +0000 (06:32 +0000)]
IR: Canonicalize metadata formatting, NFC
Canonicalize formatting of metadata to make it easier to upgrade via
scripts -- in particular, one line per metadata definition makes it more
`sed`-able.
This is preparation for changing the assembly syntax for metadata [1].
[1]: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20141208/248449.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224002
91177308-0d34-0410-b5e6-
96231b3b80d8
Ekaterina Romanova [Thu, 11 Dec 2014 06:22:35 +0000 (06:22 +0000)]
Reverting commit 223981, because the test that I added (incorrect-variable-debugloc1.ll) failed for llvm-ppc64.
The test is failing for llvm-ppc64 because for this platform the location list is not being generated at all (most likely because of the bug in PPC code optimization or generation). I will file a bug agains PPC compiler, but meanwhile, until PPC bug is fixed, I will have to revert my change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224000
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 11 Dec 2014 05:25:33 +0000 (05:25 +0000)]
Make MultiClass::DefPrototypes own their Records to fix memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223998
91177308-0d34-0410-b5e6-
96231b3b80d8