Commit Graph

33176 Commits

Author SHA1 Message Date
Evan Cheng
d98e30f618 Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 07:49:57 +00:00
Evan Cheng
d66f0015ad Do not delete identity insert_subreg even if dest is virtual. Let later passes delete them. This avoids register scavenger complain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 07:48:51 +00:00
Nick Lewycky
f5a86f45e7 Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:57:41 +00:00
Nick Lewycky
6726b6d75a Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:33:48 +00:00
Chris Lattner
a1e1446056 this is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:17:51 +00:00
Chris Lattner
93798daa3e Teach FoldBitCast to be able to handle bitcasts from (e.g.) i128 -> <4 x float>.
This allows us to simplify this:
union vec2d {
    double e[2];
    double v __attribute__((vector_size(16)));
};
typedef union vec2d vec2d;

static vec2d a={{1,2}}, b={{3,4}};
    
vec2d foo () {
    return (vec2d){ .v = a.v + b.v * (vec2d){{5,5}}.v };
}

down to:

define %0 @foo() nounwind ssp {
entry:
  %mrv5 = insertvalue %0 undef, double 1.600000e+01, 0 ; <%0> [#uses=1]
  %mrv6 = insertvalue %0 %mrv5, double 2.200000e+01, 1 ; <%0> [#uses=1]
  ret %0 %mrv6
}

instead of:

define %0 @foo() nounwind ssp {
entry:
  %mrv5 = insertvalue %0 undef, double extractelement (<2 x double> fadd (<2 x double> fmul (<2 x double> bitcast (<1 x i128> <i128 85174437667405312423031577302488055808> to <2 x double>), <2 x double> <double 3.000000e+00, double 4.000000e+00>), <2 x double> <double 1.000000e+00, double 2.000000e+00>), i32 0), 0 ; <%0> [#uses=1]
  %mrv6 = insertvalue %0 %mrv5, double extractelement (<2 x double> fadd (<2 x double> fmul (<2 x double> bitcast (<1 x i128> <i128 85174437667405312423031577302488055808> to <2 x double>), <2 x double> <double 3.000000e+00, double 4.000000e+00>), <2 x double> <double 1.000000e+00, double 2.000000e+00>), i32 1), 1 ; <%0> [#uses=1]
  ret %0 %mrv6
}



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:15:37 +00:00
Chris Lattner
6333c3959b move FoldBitCast earlier in the file, and use it instead of
ConstantExpr::getBitCast in various places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:08:26 +00:00
Chris Lattner
ea9d57bc9a refactor FoldBitCast to reduce nesting and to always return a constantexpr
instead of returning null on failure.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:02:57 +00:00
Nick Lewycky
4a134afaef Remove ICmpInst::isSignedPredicate which was a reimplementation
CmpInst::isSigned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 05:20:17 +00:00
Nick Lewycky
44df023d5f Sink isTrueWhenEqual from ICmpInst to CmpInst. Add a matching isFalseWhenEqual
which is equal to !isTrueWhenEqual for ints but not for floats.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 03:50:03 +00:00
Jim Grosbach
07d4964d1f When the scavenger is looking for a good candidate location to restore from a
spill, it should avoid doing so inside the live range of a virtual register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 00:45:07 +00:00
Dan Gohman
5fa75b0fa4 MapValue doesn't needs its LLVMContext argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 23:37:16 +00:00
Dan Gohman
32663b719b Rename isLoopExit to isLoopExiting, for consistency with the wording
used elsewhere - an exit block is a block outside the loop branched to
from within the loop. An exiting block is a block inside the loop that
branches out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 23:34:26 +00:00
Dan Gohman
e6e37b94e8 Rewrite LoopRotation's SSA updating code using SSAUpdater.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 23:19:52 +00:00
Dan Gohman
dc4a745ffe Make DominanceFrontierBase::print's output prettier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 20:01:11 +00:00
Sanjiv Gupta
ecb28f2b49 Revert back 85006 for now as it breaks PIC16 tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 18:19:41 +00:00
Sanjiv Gupta
209e6c69d9 Adding support for placing global objects in shared data memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 18:02:44 +00:00
Chris Lattner
c7b1382e35 various cleanups suggested by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 05:27:19 +00:00
Chris Lattner
c5af649758 fix PR5287, a serious regression from my previous patches. Thanks to
Duncan for the nice tiny testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 05:22:15 +00:00
Victor Hernandez
66284e063a Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 04:23:03 +00:00
Evan Cheng
5a850beb2e 80 col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 02:07:42 +00:00
Anton Korobeynikov
efcd89a5f6 Add some asserts to catch copyRegToReg() fails early
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 00:27:00 +00:00
Jim Grosbach
2f1abe2dae Restrict Thumb1 register allocation to low registers, even for instructions that
can access the hi regs. Our prologue and epilogue code doesn't know how to
properly handle save/restore of the hi regs, so things go badly when we alloc
them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 00:19:24 +00:00
Evan Cheng
c9dfeb1be8 Identity copies should not contribute to spill weight.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 23:09:19 +00:00
Jim Grosbach
7388037dd1 FIXME no longer applies. R12 and R3 are available for allocation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 23:07:42 +00:00
Jeffrey Yasskin
23e5fcfec4 Fix http://llvm.org/PR4822: allow module deletion after a function has been
compiled.

When functions are compiled, they accumulate references in the JITResolver's
stub maps. This patch removes those references when the functions are
destroyed.  It's illegal to destroy a Function when any thread may still try to
call its machine code.

This patch also updates r83987 to use ValueMap instead of explicit CallbackVHs
and fixes a couple "do stuff inside assert()" bugs from r84522.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 22:37:43 +00:00
Victor Hernandez
7b929dad59 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 21:09:37 +00:00
Dan Gohman
7abbd04e90 APInt-ify the gep scaling code, so that it correctly handles the case where
the scale overflows pointer-sized arithmetic. This fixes PR5281.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84954 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 17:57:43 +00:00
Dan Gohman
934af9cfe0 Make LoopDeletion check the maximum backedge taken count, rather than the
exact backedge taken count, when checking for infinite loops. This allows
it to delete loops with multiple exit conditions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 17:10:01 +00:00
Chris Lattner
9ff9b34dd1 some stuff is done, we still have constantexpr simplification to do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84943 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 07:00:55 +00:00
Chris Lattner
17f0cd3cc1 teach libanalysis to simplify vector loads with bitcast sources. This
implements something out of Target/README.txt producing:

_foo:                                                       ## @foo
	movl	4(%esp), %eax
	movapd	LCPI1_0, %xmm0
	movapd	%xmm0, (%eax)
	ret	$4

instead of:

_foo:                                                       ## @foo
	movl	4(%esp), %eax
	movapd	_b, %xmm0
	mulpd	LCPI1_0, %xmm0
	addpd	_a, %xmm0
	movapd	%xmm0, (%eax)
	ret	$4



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 06:57:37 +00:00
Chris Lattner
739208a790 enhance FoldReinterpretLoadFromConstPtr to handle loads of up to 32
bytes (i256).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 06:50:36 +00:00
Chris Lattner
fe8c7c807c teach libanalysis to fold int and fp loads from almost arbitrary
non-type-safe constant initializers.  This sort of thing happens
quite a bit for 4-byte loads out of string constants, unions, 
bitfields, and an interesting endianness check from sqlite, which
is something like this:

const int sqlite3one = 1;
# define SQLITE_BIGENDIAN    (*(char *)(&sqlite3one)==0)
# define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
# define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)

all of these macros now constant fold away.

This implements PR3152 and is based on a patch started by Eli, but heavily
modified and extended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 06:23:49 +00:00
Evan Cheng
c869d063d4 X86 needs critical path anti-dependency breaking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 05:57:35 +00:00
Dale Johannesen
a223aed126 Commit fixes for half precision I noted in review, so
they don't get lost; I don't think the originator has
write access.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 04:02:51 +00:00
Victor Hernandez
336ea06493 Minor code cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84919 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 00:59:10 +00:00
Bill Wendling
dfd85c142f Neuter stack protectors by only checking character arrays. This is what GCC
does.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84916 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 00:01:05 +00:00
David Goodwin
4c3715c2e5 Allow the target to select the level of anti-dependence breaking that should be performed by the post-RA scheduler. The default is none.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 23:19:17 +00:00
Ted Kremenek
8201ebd40b Use 'waitpid' instead of 'wait'. Basing Program::Wait() on 'wait()' prevents it being correct within a multithreaded context.
This address: PR 5277 (Program::Wait is unsafe to call from multiple threads).

Note: If waitpid() turns out to be non-portable, we can add more autoconf magic, or look into
another solution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 22:16:17 +00:00
Benjamin Kramer
a0b0562a35 Random include cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 21:49:41 +00:00
Jeffrey Yasskin
c367e0c0fc Fix OProfileJITEventListener after r84054 renamed CompileUnit to Scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 20:57:35 +00:00
Bill Wendling
48dc29ef91 Tidying up some code and comments. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 20:48:59 +00:00
Devang Patel
9d89df1690 Hide MetadataContext implementation details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 19:36:54 +00:00
Devang Patel
f61b2371c8 Fix getMDs() interface such that it does not expose implementation details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 18:55:16 +00:00
Devang Patel
b5681b2293 Using TrackingVH instead of WeakVH or WeakMetadataVH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 18:25:28 +00:00
Devang Patel
d41fc65c56 Sort handler names to ensure deterministic behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 17:40:37 +00:00
Bob Wilson
bac6ed4ba4 Revert 84843. Evan, this was breaking some of the if-conversion tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 16:52:21 +00:00
Nicolas Geoffray
71e0b7c560 Verify that the function and exception table have been allocated
before freeing them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 14:35:57 +00:00
Benjamin Kramer
1395d1df09 Shift art to the right to keep GCC from complaining about multi-line comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 09:28:49 +00:00
Evan Cheng
87689d3b70 Move if-conversion before post-regalloc scheduling so the predicated instruction get scheduled properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84843 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 06:48:32 +00:00