Commit Graph

92539 Commits

Author SHA1 Message Date
James Molloy
a84a83bbcd Extend RemapInstruction and friends to take an optional new parameter, a ValueMaterializer.
Extend LinkModules to pass a ValueMaterializer to RemapInstruction and friends to lazily create Functions for lazily linked globals. This is a big win when linking small modules with large (mostly unused) library modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182776 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 15:17:05 +00:00
Evgeniy Stepanov
9903f75bf6 [msan] Fix argument shadow alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182771 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 13:07:43 +00:00
Renato Golin
988005ab49 Typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182766 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 11:28:37 +00:00
Richard Sandiford
d50bcb2162 [SystemZ] Register compare-and-branch support
This patch adds support for the CRJ and CGRJ instructions.  Support for
the immediate forms will be a separate patch.

The architecture has a large number of comparison instructions.  I think
it's generally better to concentrate on using the "best" comparison
instruction first and foremost, then only use something like CRJ if
CR really was the natual choice of comparison instruction.  The patch
therefore opportunistically converts separate CR and BRC instructions
into a single CRJ while emitting instructions in ISelLowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182764 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 10:41:11 +00:00
Renato Golin
fe4716f7cf Linking ReleaseProcess doc with the world
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182763 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 10:32:55 +00:00
Richard Sandiford
06c3c9a9e1 [SystemZ] Tweak SystemZInstrInfo::isBranch() interface
This is needed for the upcoming compare-and-branch patch.  No functional
change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182762 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 10:13:54 +00:00
Alexey Samsonov
c1a0806ff5 Revert r182715 and r182758
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182761 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 10:08:08 +00:00
Renato Golin
e5ee3cfbc1 Adding ReleaseProcess doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182759 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 09:48:52 +00:00
Alexey Samsonov
1f41986a95 Fixup for r182715: provide correct arg to --gtest-filter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182758 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 09:40:42 +00:00
Michael Kuperstein
9f5de6dadc Make BasicAliasAnalysis recognize the fact a noalias argument cannot alias another argument, even if the other argument is not itself marked noalias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182755 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 08:17:48 +00:00
Rafael Espindola
af10fe63c6 Make it explicit that GlobalAlias are ok in llvm.used.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182747 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-27 22:47:09 +00:00
Rafael Espindola
078bdc6cbb Make helper functions static.
And remove header and cpp file that are empty after that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182746 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-27 22:34:59 +00:00
Preston Gurd
b704d23062 Convert sqrt functions into sqrt instructions when -ffast-math is in effect.
When -ffast-math is in effect (on Linux, at least), clang defines
__FINITE_MATH_ONLY__ > 0 when including <math.h>. This causes the
preprocessor to include <bits/math-finite.h>, which renames the sqrt functions.
For instance, "sqrt" is renamed as "__sqrt_finite". 

This patch adds the 3 new names in such a way that they will be treated
as equivalent to their respective original names.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182739 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-27 15:44:35 +00:00
Rafael Espindola
f594e41ae9 Add a cpu to try to bring back the atom bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182734 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-27 13:22:52 +00:00
Hal Finkel
119da2eb20 PPC: Add a isConsecutiveLS utility function
isConsecutiveLS is a slightly more general form of
SelectionDAG::isConsecutiveLoad. Aside from also handling stores, it also does
not assume equality of the chain operands is necessary. In the case of the PPC
backend, this chain condition is checked in a more general way by the
surrounding code.

Mostly, this part of the refactoring in preparation for supporting optimized
unaligned stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182723 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-27 02:06:39 +00:00
NAKAMURA Takumi
d1c99b2aae llvm-objdump.cpp: Appease MSC16 x64. utostr(n++) causes internal compiler error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182722 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-27 00:02:48 +00:00
Hal Finkel
1907cad7c8 Prefer to duplicate PPC Altivec loads when expanding unaligned loads
When expanding unaligned Altivec loads, we use the decremented offset trick to
prevent page faults. Unfortunately, if we have a sequence of consecutive
unaligned loads, this leads to suboptimal code generation because the 'extra'
load from the first unaligned load can be combined with the base load from the
second (but only if the decremented offset trick is not used for the first).
Search up and down the chain, through loads and token factors, looking for
consecutive loads, and if one is found, don't use the offset reduction trick.
These duplicate loads are later combined to yield the desired sequence (in the
future, we might want a more-powerful chain search, but that will require some
changes to allow the combiner routines to access the AA object).

This should complete the initial implementation of the optimized unaligned
Altivec load expansion. There is some refactoring that should be done, but
that will happen when the unaligned store expansion is added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182719 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-26 18:08:30 +00:00
Kai Nacke
ea991637e4 Add LDC compiler to list of external OS projects using LLVM 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182718 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-26 17:37:43 +00:00
Andrew Trick
9edb37feb5 Fix PR16143: Insert DEBUG_VALUE before terminator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182717 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-26 08:58:50 +00:00
Galina Kistanova
f0c74bda2e Fixed bug when tests in executable partially used absolute paths.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182715 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-26 03:58:41 +00:00
Chris Lattner
03abfc7114 Disable the StringMapEntry copy constructor, to make sure we
reject things like: "for (auto Entry : SomeStringMap)".  Previously
this would copy the value but not the tail allocated string data
(the key).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182713 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 22:28:22 +00:00
Cameron Zwarich
41b646c127 Add support for DWARF line number table entries for values in the instruction
stream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182712 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 21:56:53 +00:00
Eric Christopher
60057270d9 Add some comments to the stringify function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182710 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 05:13:17 +00:00
Hal Finkel
5a0e60425f PPC: Combine duplicate (offset) lvsl Altivec intrinsics
The lvsl permutation control instruction is a function only of the alignment of
the pointer operand (relative to the 16-byte natural alignment of Altivec
vectors). As a result, multiple lvsl intrinsics where the operands differ by a
multiple of 16 can be combined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182708 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 04:05:05 +00:00
Andrew Trick
81349a7435 Track IR ordering of SelectionDAG nodes 4/4.
Unit test cases for -pre-RA-sched=source.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182706 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 03:26:51 +00:00
Andrew Trick
dd0fb018a7 Track IR ordering of SelectionDAG nodes 3/4.
Remove the old IR ordering mechanism and switch to new one.  Fix unit
test failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182704 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 03:08:10 +00:00
Andrew Trick
ac6d9bec67 Track IR ordering of SelectionDAG nodes 2/4.
Change SelectionDAG::getXXXNode() interfaces as well as call sites of
these functions to pass in SDLoc instead of DebugLoc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182703 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 02:42:55 +00:00
Andrew Trick
ea5db0c315 Track IR ordering of SelectionDAG nodes 1/4.
Use a field in the SelectionDAGNode object to track its IR ordering.
This adds fields and utility classes without changing existing
interfaces or functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182701 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 02:20:36 +00:00
Andrew Trick
ba3500e4d2 Fix RecyclingAllocator::PrintStats to print the underlying allocator's stats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182700 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-25 01:47:42 +00:00
Eric Christopher
725e3d324b Add to testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182693 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 23:20:16 +00:00
Eric Christopher
f7306f224e ArrayRef-ize MD5 and clean up a few variable names.
Add a stringize method to make dumping a bit easier, and add a testcase
exercising a few different paths.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182692 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 23:08:17 +00:00
Hal Finkel
80d10ded8c PPC: Initial support for permutation-based unaligned Altivec loads
Altivec only directly supports aligned loads, but the loads have a strange
property: If given an unaligned address, they truncate the address to the next
lower aligned address, and load from there.  This property, along with an extra
load and some special-purpose permutation-control instructions that generate
the appropriate permutations from the original unaligned address, allow
efficient lowering of aligned loads. This code uses the trick explained in the
Apple Velocity Engine optimization overview document to prevent the needed
extra load from possibly causing a page fault if the original address happens
to be aligned.

As noted in the FIXMEs, there are several additional optimizations that can be
performed to reduce the cost of these loads even more. These will be
implemented in future commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182691 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 23:00:14 +00:00
Michael J. Spencer
3b77151a61 [Support] Remove Count{Leading,Trailing}Zeros_{32,64}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182690 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 22:58:37 +00:00
Jim Grosbach
4e505a47c7 Tidy up. Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182689 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 22:53:06 +00:00
Quentin Colombet
de7cbbfcce Follow up of the introduction of MCSymbolizer.
- Ressurect old MCDisassemble API to soften transition.
- Extend MCTargetDesc to set target specific symbolizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182688 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 22:51:52 +00:00
Michael Gottesman
fce7b6b5d9 clang formatted APFloat.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182686 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 22:40:37 +00:00
Michael Gottesman
612ca08e66 clang-formatted APInt.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182685 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 22:38:49 +00:00
Benjamin Kramer
927d8dcb47 MathExtras: Return the result of find(First|Last)Set in the input type.
Otherwise ZB_Max returns a wrong result when sizeof(T) > sizeof(size_t).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182684 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 22:25:20 +00:00
Michael J. Spencer
c6af2432c8 Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182680 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 22:23:49 +00:00
Michael J. Spencer
54c7482388 [Support][MathExtras] Fix literal type issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182679 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 22:19:05 +00:00
Michael J. Spencer
c93cdefa30 Add missing header for atexit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182672 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 20:54:11 +00:00
Michael J. Spencer
a0cfb8f21b [Support][MathExtras] Add missing include and disable _BitScan{Forward,Reverse}64 on non x64 MSVC systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182671 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 20:51:59 +00:00
Michael Gottesman
7932798384 [objc-arc] KnownSafe does not imply that it is safe to perform code motion across CFG edges since even if it is safe to remove RR pairs, we may still be able to move a retain/release into a loop.
rdar://13949644

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 20:44:05 +00:00
Michael Gottesman
35e88e57ea [objc-arc] Make sure that multiple owners is propogated correctly through the pass via the usage of a global data structure.
rdar://13750319

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182669 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 20:44:02 +00:00
Michael J. Spencer
36fe3f2b56 [Support] Add type generic bit utilities to MathExtras.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182667 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 20:29:47 +00:00
Benjamin Kramer
959ecb2eec LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases.
Fixes PR16139.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182656 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 18:05:35 +00:00
Diego Novillo
fe808927ac Do not reserve space for the ColdEdges and NormalEdges vectors.
Discussion and rationale at
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130520/175698.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182653 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 17:00:22 +00:00
Richard Sandiford
bfe3212dd8 [SystemZ] Improve AsmParser handling of invalid instructions
Previously, an invalid instruction like:

	foo     %r1, %r0

would generate the rather odd error message:

....: error: unknown token in expression
	foo     %r1, %r0
		^

We now get the more informative:

....: error: invalid instruction
	foo     %r1, %r0
	^

The same would happen if an address were used where a register was expected.
We now get "invalid operand for instruction" instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182644 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 14:26:46 +00:00
Richard Sandiford
f386961da3 [SystemZ] Improve AsmParser register parsing
The idea is to make sure that:

(1) "register expected" is restricted to cases where ParseRegister()
    is called and the token obviously isn't a register.

(2) "invalid register" is restricted to cases where a register-like "%..."
    sequence is found, but the "..." makes no sense.

(3) the generic "invalid operand for instruction" is used in cases where
    the wrong register type is used (GPR instead of FPR, etc.).

(4) the new "invalid register pair" is used if the register has the right type,
    but is not a valid register pair.

Testing of (1)-(3) is now restricted to regs-bad.s.  It uses a representative
instruction for each register class to make sure that only registers from
that class are accepted.

(4) is tested by both regs-bad.s (which checks all invalid register pairs)
and insn-bad.s (which tests one invalid pair for each instruction that
requires a pair).

While there, I changed "Number" to "Num" for consistency with the
operand class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182643 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 14:14:38 +00:00
Joey Gouly
7ab9fb02f8 Run clang-format over the scalarizePHI function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182640 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 12:33:28 +00:00