Commit Graph

44309 Commits

Author SHA1 Message Date
Eli Friedman 3c28524632 Fix an extremely subtle bug with pointer comparisons: they have to be
unsigned because it's possible (at least in theory) to have
have both positive and negative pointers pointing to the same object.

llvm-svn: 51681
2008-05-29 15:09:15 +00:00
Duncan Sands 9e064a2180 Add a newline at the end of this file.
llvm-svn: 51680
2008-05-29 14:38:23 +00:00
Eli Friedman 133e8040ca Rearrange EmitLValueForField a bit to work properly for _Bool bitfields
in unions (we don't want to do the union-specific bitcast for 
bit-fields).

llvm-svn: 51678
2008-05-29 11:33:25 +00:00
Eli Friedman 045bf4ff82 Add codegen support for a few more kinds of initializer constant
expressions.

llvm-svn: 51677
2008-05-29 11:22:45 +00:00
Eli Friedman 174d9c26f1 Add CodeGen support for alignment on globals, both for unusual natural
alignment and alignment attributes.

llvm-svn: 51676
2008-05-29 11:10:27 +00:00
Eli Friedman b65ff27f53 A couple minor fixes to make debug info usable for arbitrary code: don't
emit incomplete types, because they crash llc, and always use the 
logical location as the current location so we don't crash doing invalid 
queries on CurLoc.

llvm-svn: 51675
2008-05-29 11:08:17 +00:00
Eli Friedman d72a9624a1 Tentative declarations are supposed to have common linkage, not weak.
This change makes clang generate the same thing as llvm-gcc.

llvm-svn: 51674
2008-05-29 11:03:17 +00:00
Eli Friedman 5a6d0ede91 Always use packed structs. This isn't really very nice, but there's
nothing fundamentally wrong with it. Emitting unpacked structs where 
possible is more work for almost no practical benefit.  We'll probably 
want to fix it at some point anyway, but it's low priority.

The issue with long double in particular is that LLVM thinks an X86 long
double is 10 bytes, while clang considers it for all purposes to be
either 12 or 16 bytes, depending on the platform, even in a packed
struct.

llvm-svn: 51673
2008-05-29 10:58:49 +00:00
Eli Friedman bb936ce207 Implementation of stdarg.h.
llvm-svn: 51672
2008-05-29 10:40:55 +00:00
Owen Anderson fd24ce0a99 Re-enable the newly simplified ADCE. This fixes a regression on
Dhrystone introduced by its removal.

llvm-svn: 51669
2008-05-29 08:48:21 +00:00
Owen Anderson 7686b555e2 Replace the old ADCE implementation with a new one that more simply solves
the one case that ADCE catches that normal DCE doesn't: non-induction variable
loop computations.

This implementation handles this problem without using postdominators.

llvm-svn: 51668
2008-05-29 08:45:13 +00:00
Evan Cheng 5e28227dbd Implement vector shift up / down and insert zero with ps{rl}lq / ps{rl}ldq.
llvm-svn: 51667
2008-05-29 08:22:04 +00:00
Owen Anderson f4aece5976 Remove debugging code.
llvm-svn: 51666
2008-05-29 08:15:48 +00:00
Evan Cheng 6892c5507f Add nounwind.
llvm-svn: 51665
2008-05-29 07:09:24 +00:00
Bill Wendling 0252be178d XOR?RI instructions aren't as cheap as moves.
llvm-svn: 51664
2008-05-29 03:46:36 +00:00
Gabor Greif 3a9fba5a72 convert more operand loops to iterator formulation
llvm-svn: 51663
2008-05-29 01:59:18 +00:00
Bill Wendling 7a1a8eb6e2 Implement "AsCheapAsAMove" for some obviously cheap instructions: xor and the
like.

llvm-svn: 51662
2008-05-29 01:02:09 +00:00
Gabor Greif f712664ec3 convert another operand loop to iterator formulation
llvm-svn: 51661
2008-05-29 00:51:08 +00:00
Bill Wendling 3f6bb2713e Add a flag to indicate that an instruction is as cheap (or cheaper) than a move
instruction to execute. This can be used for transformations (like two-address
conversion) to remat an instruction instead of generating a "move"
instruction. The idea is to decrease the live ranges and register pressure and
all that jazz.

llvm-svn: 51660
2008-05-28 22:54:52 +00:00
Bill Wendling 5a83b097ed Check the "isSafeToMove" predicate, which has a series of tests to make sure
that it's safe to remat an instruction.

llvm-svn: 51659
2008-05-28 22:52:47 +00:00
Owen Anderson 779b4180dc Remap VNInfo data as well when doing renumbering.
llvm-svn: 51658
2008-05-28 22:40:08 +00:00
Owen Anderson 4f8e1ad32a Factor the numbering computation into a separate method, and add the slightest attempt at some renumbering logic, which is currently unused.
llvm-svn: 51652
2008-05-28 20:54:50 +00:00
Chris Lattner ae2c57fbbe Fix rewrite rope to keep the leaf list up-to-date as it erases leaves
from the rope.  rdar://5952468

llvm-svn: 51651
2008-05-28 18:45:56 +00:00
Evan Cheng 68079268f5 Fix PR2289: vr defined by multiple implicit_def as result of coalescing.
llvm-svn: 51648
2008-05-28 17:40:10 +00:00
Evan Cheng 427412e7c8 Teach local register allocator to deal with landing pad MBB's.
llvm-svn: 51647
2008-05-28 17:22:32 +00:00
Chris Lattner 34873d2134 give location info to another paren expr.
llvm-svn: 51646
2008-05-28 16:38:23 +00:00
Chris Lattner c5c27f7bfe add an assertion
llvm-svn: 51645
2008-05-28 16:35:02 +00:00
Nate Begeman e993b80ef5 Update some comments noticed in a recent checkin
llvm-svn: 51644
2008-05-28 16:31:36 +00:00
Chris Lattner e438c56174 Update text to point people at the right version of the tutorial for
their release.

llvm-svn: 51638
2008-05-28 06:16:08 +00:00
Chris Lattner ecdefb5df7 Implement PR2370: memmove(x,x,size) -> noop.
llvm-svn: 51636
2008-05-28 05:30:41 +00:00
Chris Lattner f8910ab6db Add chain inputs for loads.
llvm-svn: 51635
2008-05-28 04:25:57 +00:00
Chris Lattner 633cd5949b Fix CodeGen/Generic/2005-10-21-longlonggtu.ll on ia64.
llvm-svn: 51634
2008-05-28 04:14:30 +00:00
Chris Lattner 724895625b loads should get chains. THis helps but does not solve CodeGen/Generic/2003-05-27-phifcmpd.ll
on ia64.

llvm-svn: 51633
2008-05-28 04:06:52 +00:00
Chris Lattner d2c3e86cc3 Fix 2006-04-28-Sign-extend-bool.ll for ia64.
llvm-svn: 51632
2008-05-28 04:00:06 +00:00
Chris Lattner c2fb8d7e2b reindent.
llvm-svn: 51631
2008-05-28 03:59:32 +00:00
Dan Gohman 68bddb8966 Fix the encoding for two more "rm" instructions that were using MRMSrcReg.
llvm-svn: 51630
2008-05-28 01:50:19 +00:00
Mon P Wang 5e3faf2343 Fixed X86 encoding error CVTPS2PD and CVTPD2PS when the source operand
is a memory location

llvm-svn: 51626
2008-05-28 00:42:27 +00:00
Nate Begeman f1e18c7c44 Don't attempt to create VZEXT_LOAD out of an extload. This an issue where the
code generator would do something like this:

f64 = load f32 <anyext>, f32mem
v2f64 = insertelt undef, %0, 0
v2f64 = insertelt %1, 0.0, 1

into 

v2f64 = vzext_load f32mem

which on x86 is movsd, when you really wanted a cvtss2sd/movsd pair.

llvm-svn: 51624
2008-05-28 00:24:25 +00:00
Nick Kledzik 1c4627c282 use space insted of tabs
llvm-svn: 51623
2008-05-28 00:06:14 +00:00
Chris Lattner a120a521a5 Fix a couple crashes on invalid input.
llvm-svn: 51622
2008-05-27 23:32:43 +00:00
Ted Kremenek ffdbeefc54 When the build command is xcodebuild, set the magical environment variable LDPLUSPLUS to g++ to ensure that C++ object files are linked with g++ instead of gcc.
llvm-svn: 51621
2008-05-27 23:18:07 +00:00
Ted Kremenek f9671ecbfd Correctly check to see if we are analyzing C++ files (skip).
llvm-svn: 51620
2008-05-27 23:17:16 +00:00
Devang Patel 1c56ace4df Check first member alignment and uses packed struct if required.
llvm-svn: 51619
2008-05-27 22:45:40 +00:00
Devang Patel d608074e09 Fix test case
llvm-svn: 51618
2008-05-27 22:44:22 +00:00
Nick Kledzik ce956e0613 fix infinite recursion if a global's initializer references the global
llvm-svn: 51617
2008-05-27 22:07:08 +00:00
Gabor Greif 29e0ad2ff1 Make Use::init() private, it breaks invariants, clients should assign or use set().
llvm-svn: 51615
2008-05-27 21:29:38 +00:00
Dan Gohman a61379eeea Use Function::getEntryBlock instead of Function::begin, for clarity.
llvm-svn: 51613
2008-05-27 20:55:29 +00:00
Dan Gohman 3ec5520286 Print debug output when any edge becomes executable, including
the first visited edge.

llvm-svn: 51612
2008-05-27 20:47:30 +00:00
Devang Patel 8b16aeb879 Add instcombine after global optimizations.
llvm-svn: 51611
2008-05-27 20:42:44 +00:00
Dan Gohman 4ec1b4e3f9 Fix a word-o and add an explicit keyword.
llvm-svn: 51610
2008-05-27 20:41:18 +00:00