1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

456 Commits

Author SHA1 Message Date
Nick Lewycky
0539f44b9f Add CreateLifetimeStart and CreateLifetimeEnd to the IRBuilder, with plans to
use these soon.

llvm-svn: 131812
2011-05-21 23:14:36 +00:00
Duncan Sands
b68c17bcb8 Teach getCastOpcode about element-by-element vector casts. For example, "trunc"
can be used to turn a <4 x i64> into a <4 x i32> but getCastOpcode would assert
if you passed these types to it.  Note that this strictly extends the previous
functionality: if getCastOpcode previously accepted two vector types (i.e. didn't
assert) then it still will and returns the same opcode (BitCast).  That's because
before it would only accept vectors with the same bitwidth, and the new code only
touches vectors with the same length.  However if two vectors have both the same
bitwidth and the same length then their element types have the same bitwidth, so
the new logic will return BitCast as before.

llvm-svn: 131530
2011-05-18 07:13:41 +00:00
Oscar Fuentes
51417218c2 Handle gcc-compatible compilers (such as clang) the same way we handle
gcc.

Fixes PR9886.

llvm-svn: 131181
2011-05-11 13:53:08 +00:00
Lenny Maiorani
1b1a9860d1 Remove bounded StringRef::compare() since nothing but Clang SA was using it and it is just as easy to use StringRef::substr() preceding StringRef::compare() to achieve the same thing.
llvm-svn: 130430
2011-04-28 20:20:12 +00:00
Jay Foad
32fce4d563 PR9214: Convert Metadata API to use ArrayRef.
llvm-svn: 129932
2011-04-21 19:59:31 +00:00
Lenny Maiorani
dfae65d305 Implements StringRef::compare with bounds. It is behaves similarly to strncmp(). Unit tests also included.
llvm-svn: 129582
2011-04-15 17:56:50 +00:00
Jay Foad
0d5ca4cf44 Don't include Operator.h from InstrTypes.h.
llvm-svn: 129271
2011-04-11 09:35:34 +00:00
Duncan Sands
e2ed6e1116 While testing dragonegg I noticed that isCastable and getCastOpcode
had gotten out of sync: isCastable didn't think it was possible to
cast the x86_mmx type to anything, while it did think it possible
to cast an i64 to x86_mmx.

llvm-svn: 128705
2011-04-01 03:34:54 +00:00
Duncan Sands
7903974f99 Strip trailing whitespace.
llvm-svn: 128622
2011-03-31 09:58:51 +00:00
Benjamin Kramer
e6e5b11a65 Avoid turning a floating point division with a constant power of two into a denormal multiplication.
Some platforms may treat denormals as zero, on other platforms multiplication
with a subnormal is slower than dividing by a normal.

llvm-svn: 128555
2011-03-30 17:02:54 +00:00
Benjamin Kramer
7888d0935d Add APFloat::getExactInverse.
The idea is, that if an ieee 754 float is divided by a power of two, we can
turn the division into a cheaper multiplication. This function sees if we can
get an exact multiplicative inverse for a divisor and returns it if possible.

This is the hard part of PR9587.

I tested many inputs against llvm-gcc's frotend implementation of this
optimization and didn't find any difference. However, floating point is the
land of weird edge cases, so any review would be appreciated.

llvm-svn: 128545
2011-03-30 15:42:27 +00:00
Jay Foad
53632b7c03 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Jay Foad
dc5a008237 (Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128535
2011-03-30 11:19:20 +00:00
Benjamin Kramer
a85996c235 Add an argument to APInt's magic udiv calculation to specify the number of bits that are known zero in the divided number.
This will come in handy soon.

llvm-svn: 127828
2011-03-17 20:39:06 +00:00
Oscar Fuentes
15a668f50b Fixes warnings emitted by Visual Studio 2010 compiler.
Patch by Erik Olofsson!

llvm-svn: 126796
2011-03-01 23:11:57 +00:00
Duncan Sands
702e8b136e Simplify RecursivelyDeleteDeadPHINode. The only functionality change
should be that if the phi is used by a side-effect free instruction with
no uses then the phi and the instruction now get zapped (checked by the
unittest).

llvm-svn: 126124
2011-02-21 16:27:36 +00:00
Cameron Zwarich
b7e676db6c The signed version of our "magic number" computation for the integer approximation
of a constant had a minor typo introduced when copying it from the book, which
caused it to favor negative approximations over positive approximations in many
cases. Positive approximations require fewer operations beyond the multiplication.

In the case of division by 3, we still generate code that is a single instruction
larger than GCC's code.

llvm-svn: 126097
2011-02-21 00:22:02 +00:00
Oscar Fuentes
22247bd624 Put targets on folders, if the IDE supports the feature.
Requires CMake 2.8.3 or newer.

llvm-svn: 126092
2011-02-20 22:06:10 +00:00
Nick Lewycky
ecae3aec02 Make RecursivelyDeleteDeadPHINode delete a phi node that has no users and add a
test for that. With this change, test/CodeGen/X86/codegen-dce.ll no longer finds
any instructions to DCE, so delete the test.

Also renamed J and JP to I and IP in RecursivelyDeleteDeadPHINode.

llvm-svn: 126088
2011-02-20 18:05:56 +00:00
Nick Lewycky
4d7bb906df Teach RecursivelyDeleteDeadPHINodes to handle multiple self-references. Patch
by Andrew Clinton!

llvm-svn: 126077
2011-02-20 08:38:20 +00:00
Zhanyong Wan
c1bc219fc1 Adds llvm::sys::path::is_separator() to test whether a char is a path separator
on the host OS.  Reviewed by dgregor.

llvm-svn: 125406
2011-02-11 21:24:40 +00:00
Daniel Dunbar
f9647c1760 build: Add MAKEFILE_UNITTEST_NO_INCLUDE_COMMON build variable, to be leveraged
by Clang.

llvm-svn: 124871
2011-02-04 17:12:18 +00:00
Duncan Sands
ac9fa024f8 Part of this test is invariant inside the inner loop - move it outside
the loop.

llvm-svn: 124784
2011-02-03 08:14:04 +00:00
Duncan Sands
cfc61f7efb Remove NoVendor and NoOS, added in commit 123990, from Triple. While it
may be useful to understand "none", this is not the place for it.  Tweak
the fix to Normalize while there: the fix added in 123990 works correctly,
but I like this way better.  Finally, now that Triple understands some
non-trivial environment values, teach the unittests about them.

llvm-svn: 124720
2011-02-02 10:08:38 +00:00
Chris Lattner
7bdd5c3eb7 Don't infinitely recurse! Patch by Marius Wachtler!
llvm-svn: 124366
2011-01-27 07:35:27 +00:00
Renato Golin
cf89d692dc Clang was not parsing target triples involving EABI and was generating wrong IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure.
llvm-svn: 123990
2011-01-21 18:25:47 +00:00
Michael J. Spencer
ef831d650f Unittests/Support/Path: Tweak test.
llvm-svn: 123546
2011-01-15 18:52:49 +00:00
Rafael Espindola
3b43f22391 Allow unnamed_addr on declarations.
llvm-svn: 123529
2011-01-15 08:15:00 +00:00
Oscar Fuentes
8d5e1d912b Disable RTTI when building unit tests. This avoids errors at link time.
llvm-svn: 123377
2011-01-13 15:31:45 +00:00
Rafael Espindola
f6cae95276 Reject uses of unnamed_addr in declarations.
llvm-svn: 123358
2011-01-13 01:30:30 +00:00
Rafael Espindola
9f526bcf4d First step in fixing PR8927:
Add a unnamed_addr bit to global variables and functions. This will be used
to indicate that the address is not significant and therefore the constant
or function can be merged with others.

If an optimization pass can show that an address is not used, it can set this.

Examples of things that can have this set by the FE are globals created to
hold string literals and C++ constructors.

Adding unnamed_addr to a non-const global should have no effect unless
an optimization can transform that global into a constant.

Aliases are not allowed to have unnamed_addr since I couldn't figure
out any use for it.

llvm-svn: 123063
2011-01-08 16:42:36 +00:00
Jay Foad
225d525e88 Remove the "ugly" method BranchInst::setUnconditionalDest().
llvm-svn: 123026
2011-01-07 20:26:51 +00:00
Michael J. Spencer
223074e281 UnitTests/Path: Add magical tests. This will also test identify_magic.
llvm-svn: 122948
2011-01-06 05:58:02 +00:00
Michael J. Spencer
2b6edb1efa UnitTests/Path: More ASSERT_NO_ERROR cleanup.
llvm-svn: 122947
2011-01-06 05:57:54 +00:00
Michael J. Spencer
965b6c0d1e UnitTests/Path: Fix typo, add error number, and enable the directory cleanup code.
llvm-svn: 122885
2011-01-05 16:39:46 +00:00
Michael J. Spencer
0506a5377e UnitTests/PathV2: Setup a test fixture to make tracking created file system
entities easier.

llvm-svn: 122880
2011-01-05 16:39:05 +00:00
Michael J. Spencer
e369cc8053 Support/PathV2: Implement directory iteration on POSIX.
llvm-svn: 122879
2011-01-05 16:38:57 +00:00
Michael J. Spencer
b5b192853b UnitTests/Path: Produce useful diagnostics on error.
llvm-svn: 122812
2011-01-04 17:00:18 +00:00
Chris Lattner
2f774c1246 fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.
llvm-svn: 122613
2010-12-29 01:33:36 +00:00
Jeffrey Yasskin
a199652a3e Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.

llvm-svn: 122458
2010-12-23 00:58:24 +00:00
Jakob Stoklund Olesen
26b4e8ec0a Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.
This implementation already exists as ConnectedVNInfoEqClasses in
LiveInterval.cpp, and it seems to be generally useful to have a light-weight way
of forming equivalence classes of small integers.

IntEqClasses doesn't allow enumeration of the elements in a class.

llvm-svn: 122293
2010-12-21 00:04:46 +00:00
Jakob Stoklund Olesen
64c013d79d Add more checks to IntervalMapOverlaps::advance() to ensure that advanceTo sees
monotonic keys.

llvm-svn: 122093
2010-12-17 22:07:54 +00:00
Jakob Stoklund Olesen
f17722908c It is allowed to call IntervalMap::const_iterator::advanceTo() with a key that
moves the iterator to end(), and it is valid to call it on end().

That means it is valid to call advanceTo() with any monotonic key sequence.

llvm-svn: 122092
2010-12-17 22:07:51 +00:00
Jakob Stoklund Olesen
aec6ae67a1 Fix crash when IntervalMapOverlaps::advanceTo moves past the last overlap.
llvm-svn: 122081
2010-12-17 19:18:38 +00:00
Jakob Stoklund Olesen
c63484e962 Complete tests for IntervalMapOverlaps.
llvm-svn: 122019
2010-12-17 01:31:49 +00:00
Jakob Stoklund Olesen
9681be67c5 Add basic test exposing many bugs.
llvm-svn: 121995
2010-12-16 19:46:09 +00:00
Michael J. Spencer
7979bb402f Support/PathV2: Change most functions in the path namespace to return their work
via their return value instead of an out parameter.

llvm-svn: 121149
2010-12-07 17:04:04 +00:00
Frits van Bommel
78efe72880 CMake: Fix warning in gtest header used by unit tests.
llvm-svn: 121127
2010-12-07 10:22:07 +00:00
Jay Foad
79e18ed269 PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

llvm-svn: 121120
2010-12-07 08:25:19 +00:00
NAKAMURA Takumi
e9ad42c89e unittests/CMakeLists.txt: Tweak unittests' layout to be identical to GNU build.
llvm-svn: 121117
2010-12-07 07:41:23 +00:00