Commit Graph

108624 Commits

Author SHA1 Message Date
Tilmann Scheller
0ef79aa701 [InstCombine] Reformat if statements to comply with LLVM Coding Standards.
Patch by Sonam Kumari!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219198 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 10:19:34 +00:00
Daniel Sanders
75046b4891 [mips] Return {f128} correctly for N32/N64.
Summary:
According to the ABI documentation, f128 and {f128} should both be returned
in $f0 and $f2. However, this doesn't match GCC's behaviour which is to
return f128 in $f0 and $f2, but {f128} in $f0 and $f1.

Reviewers: vmedic

Reviewed By: vmedic

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219196 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 09:29:59 +00:00
Craig Topper
95717dbb11 [X86] Fix a bug where the disassembler was ignoring the VEX.W bit in 32-bit mode for certain instructions it shouldn't.
Unfortunately, this isn't easy to fix since there's no simple way to figure out from the disassembler tables whether the W-bit is being used to select a 64-bit GPR or if its a required part of the opcode. The fix implemented here just looks for "64" in the instruction name and ignores the W-bit in 32-bit mode if its present.

Fixes PR21169.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219194 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 07:29:50 +00:00
Craig Topper
ada4703cba Formatting fixes. Most putting 'else' on the same line as the preceding curly brace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219193 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 07:29:48 +00:00
Craig Topper
038a3b8d65 Fix filename in header and use C++ version of the C header files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219192 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 07:29:46 +00:00
David Majnemer
2869d4800c GlobalDCE: Don't drop any COMDAT members
If we require a single member of a comdat, require all of the other
members as well.

This fixes PR20981.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219191 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 07:07:19 +00:00
David Majnemer
ba2113f934 Attempt to calm down buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219190 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 05:56:45 +00:00
David Majnemer
220c5ca8f4 Support: Don't call close again if we get EINTR
Most Unix-like operating systems guarantee that the file descriptor is
closed after a call to close(2), even if close comes back with EINTR.
For these systems, calling close _again_ will either do nothing or close
some other file descriptor open(2)'d by another thread. (Linux)

However, some operating systems do not have this behavior.  They require
at least another call to close(2) before guaranteeing that the
descriptor is closed. (HP-UX)

And some operating systems have an unpredictable blend of the two
behaviors! (xnu)

Avoid this disaster by blocking all signals before we call close(2).
This ensures that a signal will not be delivered to the thread and
close(2) will not give us back EINTR.  We restore the signal mask once
the operation is done.

N.B. This isn't a problem on Windows, it doesn't have a notion of EINTR
because signals always get delivered to dedicated signal handling
threads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219189 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 05:48:40 +00:00
Rafael Espindola
61c4e41480 gold plugin: Handle gold selecting a linkonce GV when a weak is present.
The plugin API doesn't have the notion of linkonce, only weak. It is up to the
plugin to figure out if a symbol used only for the symbol table can be dropped.
In particular, it has to avoid dropping a linkonce_odr selected by gold if there
is also a weak_odr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 04:06:13 +00:00
Juergen Ributzka
301d3d04f0 [FastISel][AArch64] Teach the address computation code to also fold sign-/zero-extends.
The code already folds sign-/zero-extends, but only if they are arguments to
mul and shift instructions. This extends the code to also fold them when they
are direct inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219187 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 03:40:06 +00:00
Juergen Ributzka
3692081566 [FastISel][AArch64] Teach the address computation to also fold sub instructions.
Tiny enhancement to the address computation code to also fold sub instructions
if the rhs is constant and can be folded into the offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219186 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 03:40:03 +00:00
Juergen Ributzka
ca07e256f6 [FastISel][AArch64] Fix "Fold sign-/zero-extends into the load instruction."
This commit fixes an issue with sign-/zero-extending loads that was discovered
by Richard Barton.

We use now the correct load instructions for sign-extending loads to 64bit. Also
updated and added more unit tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219185 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 03:39:59 +00:00
Rafael Espindola
4f17a54bfa gold plugin: create internal replacement with original linkage first.
The call to copyAttributesFrom will copy the visibility, which might assert
if it were to produce something invalid like "internal hidden". We avoid it
by first creating the replacement with the original linkage and then setting
it to internal affter the call to copyAttributesFrom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219184 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 03:19:55 +00:00
Rafael Espindola
3ddd4fa0dd gold plugin: Remap function arguments when creating a replacement function.
When creating an internal function replacement for use in an alias we were
not remapping the argument uses in the instructions to point to the new
arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219177 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 00:47:38 +00:00
Gerolf Hoflehner
5307076e20 [InstCombine] re-commit r218721 icmp-select-icmp optimization
Takes care of the assert that caused build fails.
Rather than asserting the code checks now that the definition
and use are in the same block, and does not attempt
to optimize when that is not the case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219175 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 00:16:12 +00:00
NAKAMURA Takumi
844eeb3741 ARMInstPrinter.cpp: Suppress a warning for -Asserts. [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219172 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 23:48:04 +00:00
NAKAMURA Takumi
e6fb7265d7 llvm/test/lit.cfg: Suppress dwarf stuff for targeting x86_64-mingw32 while investigating since r219108.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219171 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 23:29:06 +00:00
David Majnemer
3ba3a4ccfd Support: Add a utility to remap std{in,out,err} to /dev/null if closed
It's possible to start a program with one (or all) of the standard file
descriptors closed.  Subsequent open system calls will give the program
a low-numbered file descriptor.

This is problematic because we may believe we are writing to standard
out instead of a file.

Introduce Process::FixupStandardFileDescriptors, a helper function to
remap standard file descriptors to /dev/null if they were closed before
the program started.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219170 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 23:16:18 +00:00
Joerg Sonnenberger
5b8cd15092 Recognize aarch64_be as valid architecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219168 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 23:05:04 +00:00
David Blaikie
becb20825e range-for some loops in DAE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219167 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 22:59:29 +00:00
Duncan P. N. Exon Smith
9aba1898be LoopUnroll: Change code order of changes to new basic blocks
Add new basic blocks to `LoopInfo` earlier.  No functionality change
intended (simplifies upcoming bugfix patch).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219150 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 22:05:02 +00:00
Duncan P. N. Exon Smith
703bd8d0e2 Sink comment, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219149 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 22:04:59 +00:00
Hal Finkel
807111a8f4 [DAGCombine] Remove SIGN_EXTEND-related inf-loop
The patch's author points out that, despite the function's documentation,
getSetCCResultType is only used to get the SETCC result type (with one
here-removed problematic exception). In one case, getSetCCResultType was being
used to get the predicate type to use for a SELECT node, and then
SIGN_EXTENDing (or truncating) to get the input predicate to match that type.
Unfortunately, this was happening inside visitSIGN_EXTEND, and creating new
SIGN_EXTEND nodes was causing an infinite loop. In addition, this behavior was
wrong if a target was not using ZeroOrNegativeOneBooleanContent. Lastly, the
extension/truncation seems unnecessary here: SELECT is defined as:

  Select(COND, TRUEVAL, FALSEVAL). If the type of the boolean COND is not i1
  then the high bits must conform to getBooleanContents.

So here we remove this use of getSetCCResultType and update
getSetCCResultType's documentation to reflect its actual uses.

Patch by deadal nix!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219141 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 20:19:47 +00:00
Sanjay Patel
b67100314b Fast-math fold: x / (y * sqrt(z)) -> x * (rsqrt(z) / y)
The motivation is to recognize code such as this from /llvm/projects/test-suite/SingleSource/Benchmarks/BenchmarkGame/n-body.c:

float distance = sqrt(dx * dx + dy * dy + dz * dz);
float mag = dt / (distance * distance * distance);

Without this patch, we don't match the sqrt as a reciprocal sqrt, so for PPC the new testcase in this patch produces:

   addis 3, 2, .LCPI4_2@toc@ha
   lfs 4, .LCPI4_2@toc@l(3)
   addis 3, 2, .LCPI4_1@toc@ha
   lfs 0, .LCPI4_1@toc@l(3)
   fcmpu 0, 1, 4
   beq 0, .LBB4_2
# BB#1:
   frsqrtes 4, 1
   addis 3, 2, .LCPI4_0@toc@ha
   lfs 5, .LCPI4_0@toc@l(3)
   fnmsubs 13, 1, 5, 1
   fmuls 6, 4, 4
   fmadds 1, 13, 6, 5
   fmuls 1, 4, 1
   fres 4, 1                <--- reciprocal of reciprocal square root
   fnmsubs 1, 1, 4, 0
   fmadds 4, 4, 1, 4
.LBB4_2:
   fmuls 1, 4, 2
   fres 2, 1
   fnmsubs 0, 1, 2, 0
   fmadds 0, 2, 0, 2
   fmuls 1, 3, 0
   blr

After the patch, this simplifies to:

frsqrtes 0, 1
addis 3, 2, .LCPI4_1@toc@ha
fres 5, 2
lfs 4, .LCPI4_1@toc@l(3)
addis 3, 2, .LCPI4_0@toc@ha
lfs 7, .LCPI4_0@toc@l(3)
fnmsubs 13, 1, 4, 1
fmuls 6, 0, 0
fnmsubs 2, 2, 5, 7
fmadds 1, 13, 6, 4
fmadds 2, 5, 2, 5
fmuls 0, 0, 1
fmuls 0, 0, 2
fmuls 1, 3, 0
blr

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219139 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 19:31:18 +00:00
Hal Finkel
b9ce60ff09 [BasicAA] Revert "Revert r218714 - Make better use of zext and sign information."
This reverts r218944, which reverted r218714, plus a bug fix.

Description of the bug in r218714 (by Nick)

The original patch forgot to check if the Scale in VariableGEPIndex flipped the
sign of the variable. The BasicAA pass iterates over the instructions in the
order they appear in the function, and so BasicAliasAnalysis::aliasGEP is
called with the variable it first comes across as parameter GEP1. Adding a
%reorder label puts the definition of %a after %b so aliasGEP is called with %b
as the first parameter and %a as the second. aliasGEP later calculates that %a
== %b + 1 - %idxprom where %idxprom >= 0 (if %a was passed as the first
parameter it would calculate %b == %a - 1 + %idxprom where %idxprom >= 0) -
ignoring that %idxprom is scaled by -1 here lead the patch to incorrectly
conclude that %a > %b.

Revised patch by Nick White, thanks! Thanks to Lang to isolating the bug.
Slightly modified by me to add an early exit from the loop and avoid
unnecessary, but expensive, function calls.

Original commit message:

Two related things:

 1. Fixes a bug when calculating the offset in GetLinearExpression. The code
    previously used zext to extend the offset, so negative offsets were converted
    to large positive ones.

 2. Enhance aliasGEP to deduce that, if the difference between two GEP
    allocations is positive and all the variables that govern the offset are also
    positive (i.e. the offset is strictly after the higher base pointer), then
    locations that fit in the gap between the two base pointers are NoAlias.

Patch by Nick White!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219135 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 18:37:59 +00:00
Matt Arsenault
27069a921a Update documentation with link to Sea Islands documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219134 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 18:31:09 +00:00
Duncan P. N. Exon Smith
7609712017 BFI: Improve assertion message, since it's actually firing
This assertion is firing because -loop-unroll is failing to preserve
-loop-info (see PR20987).  Improve it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219130 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 17:42:00 +00:00
Tim Northover
ca6c95df36 ARM: silence unused variable warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219128 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 17:26:36 +00:00
Tim Northover
969587d62d ARM: remove dead InstPrinting code
This instruction form is handled by different AsmOperands now, so the code is
completely dead (and wrong anyway).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219127 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 17:10:13 +00:00
Hans Wennborg
7fcd5f8c89 MachObjectWriter: optimize the string table for common suffices
This is a follow-up to r207670 (ELF) and r218636 (COFF).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219126 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 17:05:19 +00:00
Timur Iskhodzhanov
3e3908e2c7 Fix dumping codeview line tables when there are multiple debug sections
Codeview line tables for functions in different sections refer to a common
STRING_TABLE_SUBSECTION for filenames.
This happens when building with -Gy or with inline functions with MSVC.

Original patch by Jeff Muizelaar!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219125 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 16:59:44 +00:00
Benjamin Kramer
8ea5b7120f DbgValueHistoryCalculator: Store modified registers in a BitVector instead of std::set.
And iterate over the smaller map instead of the larger set first.  Reduces the time spent in
calculateDbgValueHistory by 30-40%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219123 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 15:31:04 +00:00
Hal Finkel
6a075f530a [CFL-AA] Update for handling of globals and more tests
We used to return PartialAlias if *either* variable being queried interacted
with arguments or globals. AFAICT, we can change this to only returning
MayAlias iff *both* variables being queried interacted with arguments or
globals.

Also, adding some basic functionality tests: some basic IPA tests, checking
that we give conservative responses with arguments/globals thrown in the mix,
and ensuring that we trace values through stores and loads.

Note that saying that 'x' interacted with arguments or globals means that the
Attributes of the StratifiedSet that 'x' belongs to has any bits set.

Patch by George Burgess IV, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219122 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 14:42:56 +00:00
Yaron Keren
636eb393e0 Make the MD5 result name consistent between functions, header and source.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219121 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 13:48:07 +00:00
Rafael Espindola
852c0d6372 Note that a gold bug has been fixed.
We should be able to stop working around it at some point in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219115 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 12:33:27 +00:00
Benjamin Kramer
043994e266 X86: Drop the isConvertibleTo3Addr bit from shufps/shufpd now that we don't convert them anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219112 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 09:56:40 +00:00
Eric Christopher
862c93c856 For biendian targets like ARM and AArch64, it is useful to have the
output of the llvm-dwarfdump and llvm-objdump report the endianness
used when the object files were generated.

Patch by Charlie Turner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219110 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 07:06:03 +00:00
Eric Christopher
8e59427e3a Add support for ARM and AArch64 big endian objects to
RelocVisitor.

Patch by Charlie Turner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219109 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 07:02:58 +00:00
Eric Christopher
7d0a297dbd Refactor RelocVisitor to take an object. This removes some
string comparisons and makes it a bit easier to check individual
targets.

Patch by Charlie Turner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219108 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 06:55:55 +00:00
Eric Christopher
b23e9d77e8 Add some tests for RelocVisitor.
Patch by Charlie Turner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219107 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 06:52:52 +00:00
Eric Christopher
e6f32be8df Add subtarget caches to aarch64, arm, ppc, and x86.
These will make it easier to test further changes to the
code generation and optimization pipelines as those are
moved to subtargets initialized with target feature and
target cpu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219106 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 06:45:36 +00:00
Yaron Keren
a37095eae6 Resolve ambiguity between llvm::make_unique and std::make_unique.
Intorduced in r219098.
 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219105 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 06:39:57 +00:00
David Blaikie
d53f7f4b22 DebugInfo: Sink constructImportedEntityDIE down into DwarfUnit from DwarfDebug.
It was just calling a bunch of DwarfUnit functions anyway, as can be
seen by the simplification of removing "TheCU" from all the function
calls in the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219103 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 05:37:24 +00:00
Frederic Riss
f2eddd6694 [dwarfdump] Print the name for referenced specification of abstract_origin DIEs.
Reviewers: dblaikie, samsonov, echristo, aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219099 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 03:36:31 +00:00
Frederic Riss
3736cc5be8 Factor the Unit section parsing into the DWARFUnitSection class.
Summary: No functional change.

Reviewers: dblaikie, samsonov

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219098 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 03:36:18 +00:00
Chandler Carruth
ef68758aa8 [PM] Remove an unused and rather expensive mapping from an analysis
group's interface to all of the implementations of that analysis group.
The groups themselves can and do manage this anyways, the pass registry
needn't involve itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219097 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 00:30:59 +00:00
Chandler Carruth
891fb0b4e5 [PM] Remove the (deeply misguided) 'unregister' functionality from the
pass registry.

This style of registry is somewhat questionable, but it being
non-monotonic is crazy. No one is (or should be) unloading DSOs with
passes and unregistering them here. I've checked with a few folks and
I don't know of anyone using this functionality or any important use
case where it is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219096 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 00:13:25 +00:00
Chandler Carruth
24a19341bb [cleanup] Switch to using range-based for loops in two very obvious
places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219095 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 00:06:48 +00:00
Chandler Carruth
b3d7f9c18d [cleanup] Fix up trailing whitespace and formatting in the pass regitsry
code prior to hacking on it more significantly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219094 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-05 23:59:03 +00:00
Owen Anderson
eb2be34094 Give the Reassociate pass a bit more flexibility and autonomy when optimizing expressions.
Particularly, it addresses cases where Reassociate breaks Subtracts but then fails to optimize combinations like I1 + -I2 where I1 and I2 have the same rank and are identical.

Patch by Dmitri Shtilman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219092 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-05 23:41:26 +00:00