Commit Graph

45274 Commits

Author SHA1 Message Date
Evan Cheng bd5616271b Unbreak build.
llvm-svn: 66874
2009-03-13 07:41:30 +00:00
Chris Lattner 8db9bc7ee4 split buffer management and diagnostic printing out of the tblgen
lexer into its own TGSourceMgr class.

llvm-svn: 66873
2009-03-13 07:05:43 +00:00
Owen Anderson d37ddf5b5b Convert VirtRegMap to a MachineFunctionPass.
llvm-svn: 66870
2009-03-13 05:55:11 +00:00
Chris Lattner 99cc133710 generalize the previous code to use the full generality of LEA
for i32/i64 expressions (we could also do i16 on cpus where
i16 lea is fast, but I didn't add this).  On the example, we now
generate:

_test:
	movl	4(%esp), %eax
	cmpl	$42, (%eax)
	setl	%al
	movzbl	%al, %eax
	leal	4(%eax,%eax,8), %eax
	ret

instead of:

_test:
	movl	4(%esp), %eax
	cmpl	$41, (%eax)
	movl	$4, %ecx
	movl	$13, %eax
	cmovg	%ecx, %eax
	ret

llvm-svn: 66869
2009-03-13 05:53:31 +00:00
Chris Lattner 4be6df5d86 optimize the case of cond ? 42 : 41 and friends. This compiles the
example to:

_test:
	movl	4(%esp), %eax
	cmpl	$41, (%eax)
	setg	%al
	movzbl	%al, %eax
	orl	$4294967294, %eax
	ret

instead of:

        movl    4(%esp), %eax
        cmpl    $41, (%eax)
	movl	$4294967294, %ecx
	movl	$4294967295, %eax
	cmova	%ecx, %eax
	ret

which is smaller in code size and faster. rdar://6668608

llvm-svn: 66868
2009-03-13 05:22:11 +00:00
Bill Wendling fa54bc2052 Oops...I committed too much.
llvm-svn: 66867
2009-03-13 04:39:26 +00:00
Bill Wendling b02eadf660 Temporarily XFAIL this test.
llvm-svn: 66866
2009-03-13 04:37:11 +00:00
Dan Gohman a1d92423cf Enhance address-mode folding of ISD::ADD to handle cases where the
operands can't both be fully folded at the same time. For example,
in the included testcase, a global variable is being added with
an add of two values. The global variable wants RIP-relative
addressing, so it can't share the address with another base
register, but it's still possible to fold the initial add.

llvm-svn: 66865
2009-03-13 02:25:09 +00:00
Dale Johannesen cecfa6e08d Fix one more place where debug info affected
codegen (speculative execution).

llvm-svn: 66859
2009-03-13 01:05:24 +00:00
Chris Lattner b858c0eba0 just initialize the first element, we don't need to set the rest to zeros.
llvm-svn: 66850
2009-03-13 00:24:01 +00:00
Chris Lattner 0bf186906b Eliminate a 9640 byte static mutable initialized data item by moving it
to the stack.  This shrinks all llvm tools by 9k, and improves reentrancy.

llvm-svn: 66847
2009-03-13 00:03:51 +00:00
Chris Lattner 9170209603 static functions don't need an anonymous namespace.
llvm-svn: 66845
2009-03-12 23:59:55 +00:00
Dan Gohman a19c662a83 Fix a typo in a comment.
llvm-svn: 66843
2009-03-12 23:55:10 +00:00
Dale Johannesen ed6f5a8253 Previous debug info fix to this code wasn't quite
right; did the wrong thing when there are exactly 11
non-debug instructions, followed by debug info.
Remove a FIXME since it's apparently been fixed along the way.

llvm-svn: 66840
2009-03-12 23:18:09 +00:00
Gabor Greif af76c34b4b cosmetic change, in preparation of future change
llvm-svn: 66839
2009-03-12 23:13:03 +00:00
Evan Cheng 50a839e61f Add this test back.
llvm-svn: 66838
2009-03-12 23:01:35 +00:00
Daniel Dunbar db948ffaf0 raw_ostream: unbuffered streams weren't being immediately flushed on
single character writes.

llvm-svn: 66827
2009-03-12 22:02:44 +00:00
Duncan Sands 1f853d6a2a Revert commit 66140 since it caused several failures
in the Ada testcase.  Reverting this only covers up
the real problem, which is a nasty conceptual difficulty
in the phi elimination pass: when eliminating phi nodes
in landing pads, the register copies need to come before
the invoke, not at the end of the basic block which is
too late...  See PR3784.

llvm-svn: 66826
2009-03-12 21:13:42 +00:00
Scott Michel b1a830abf0 Darwin 10.4.x: "-rpath" is unnecessary when linking shared libraries.
llvm-svn: 66825
2009-03-12 21:03:53 +00:00
Dale Johannesen 7f99d22f2f There already was a class to force deterministic
sorting of ConstantInt's; unreinvent wheel.

llvm-svn: 66824
2009-03-12 21:01:11 +00:00
Bob Wilson e4467e46a5 Fix an inconsistent use of LLVMGCCDIR. In all other cases, this directory
refers to the "prefix" directory, i.e., one level above "bin".  LLVMGCCPATH
is used as the directory containing the llvm-gcc executable, so add a "/bin"
suffix to get from LLVMGCCDIR to LLVMGCCPATH.

llvm-svn: 66823
2009-03-12 19:47:24 +00:00
Gabor Greif c91aa9b857 Rearrange operands of the BranchInst, to be able to
access each with a fixed negative index from op_end().

This has two important implications:
- getUser() will work faster, because there are less iterations
  for the waymarking algorithm to perform. This is important
  when running various analyses that want to determine callers
  of basic blocks.
- getSuccessor() now runs faster, because the indirection via OperandList
  is not necessary: Uses corresponding to the successors are at fixed
  offset to "this".

The price we pay is the slightly more complicated logic in the operator
User::delete, as it has to pick up the information whether it has to free
the memory of an original unconditional BranchInst or a BranchInst that
was originally conditional, but has been shortened to unconditional.
I was not able to come up with a nicer solution to this problem. (And
rest assured, I tried *a lot*).

Similar reorderings will follow for InvokeInst and CallInst. After that
some optimizations to pred_iterator and CallSite will fall out naturally.

llvm-svn: 66815
2009-03-12 18:34:49 +00:00
Evan Cheng 2a332aa866 Re-apply 66024 with fixes: 1. Fixed indirect call to immediate address assembly. 2. Fixed JIT encoding by making the address pc-relative.
llvm-svn: 66803
2009-03-12 18:15:39 +00:00
Dale Johannesen 578d8bfc3c Another missing check for debug intrinsics.
llvm-svn: 66800
2009-03-12 17:42:45 +00:00
Chris Lattner b0a553b925 Fully initialize all ivars, fixing PR3790, patch by Edwin Torok!
llvm-svn: 66798
2009-03-12 17:22:48 +00:00
Evan Cheng 56f9f80bb1 Typo.
llvm-svn: 66797
2009-03-12 17:07:39 +00:00
Evan Cheng f16a991262 Fix test after Chris' select changes.
llvm-svn: 66795
2009-03-12 16:10:08 +00:00
Duncan Sands 0dd607cd13 Adjust this test for recent sroa improvements.
llvm-svn: 66791
2009-03-12 11:56:12 +00:00
Gabor Greif 02ab9ab66d add some text to explain sentinels
llvm-svn: 66790
2009-03-12 10:30:31 +00:00
Gabor Greif 4ef9bc053a minor tweaks
llvm-svn: 66788
2009-03-12 09:47:03 +00:00
Owen Anderson 36a9937883 Reorganize some #include's.
llvm-svn: 66780
2009-03-12 06:58:19 +00:00
Chris Lattner 4147f08e44 Move 3 "(add (select cc, 0, c), x) -> (select cc, x, (add, x, c))"
related transformations out of target-specific dag combine into the
ARM backend.  These were added by Evan in r37685 with no testcases
and only seems to help ARM (e.g. test/CodeGen/ARM/select_xform.ll).

Add some simple X86-specific (for now) DAG combines that turn things
like cond ? 8 : 0  -> (zext(cond) << 3).  This happens frequently
with the recently added cp constant select optimization, but is a
very general xform.  For example, we now compile the second example
in const-select.ll to:

_test:
        movsd   LCPI2_0, %xmm0
        ucomisd 8(%esp), %xmm0
        seta    %al
        movzbl  %al, %eax
        movl    4(%esp), %ecx
        movsbl  (%ecx,%eax,4), %eax
        ret

instead of:

_test:
        movl    4(%esp), %eax
        leal    4(%eax), %ecx
        movsd   LCPI2_0, %xmm0
        ucomisd 8(%esp), %xmm0
        cmovbe  %eax, %ecx
        movsbl  (%ecx), %eax
        ret

This passes multisource and dejagnu.

llvm-svn: 66779
2009-03-12 06:52:53 +00:00
Chris Lattner a492d29c23 improve comment.
llvm-svn: 66778
2009-03-12 06:46:02 +00:00
Evan Cheng 4465954638 Enable Chris' value propagation change. It make available known sign, zero, one bits information for values that are live out of basic blocks. The goal is to eliminate unnecessary sext, zext, truncate of values that are live-in to blocks. This does not handle PHI nodes yet.
llvm-svn: 66777
2009-03-12 06:29:49 +00:00
Evan Cheng ef0b7cc2d5 On x86, if the only use of a i64 load is a i64 store, generate a pair of double load and store instead.
llvm-svn: 66776
2009-03-12 05:59:15 +00:00
Chris Lattner 7b87e542dc add no-unwind, remove duplicate run line.
llvm-svn: 66775
2009-03-12 05:56:37 +00:00
Chris Lattner 1d5cf4bcdd add nounwinds
llvm-svn: 66773
2009-03-12 05:35:33 +00:00
Bill Wendling 207495d8ea Revert r66765 and r66766. These were causing build failures on Darwin.
llvm-svn: 66770
2009-03-12 04:10:09 +00:00
Nick Lewycky c46949c278 Regenerate.
llvm-svn: 66766
2009-03-12 03:34:33 +00:00
Nick Lewycky ca433d8a84 Set ARCH to x86 on mixed 32/64-bit Linux systems.
Remove the explicit if OS = Darwin test around the setting of -m32/-m64.

llvm-svn: 66765
2009-03-12 03:34:19 +00:00
Sanjiv Gupta 8bb50e2344 Forgot to check-in this as part of 7761.
llvm-svn: 66763
2009-03-12 03:20:07 +00:00
Sanjiv Gupta f883419b2f Banksel optimization is now based on the section names of symbols, since the symbols in one section will always be put into one bank.
llvm-svn: 66761
2009-03-12 02:10:45 +00:00
Dale Johannesen 9cdb9bb3e5 Allow for switch values bigger than 64 bits.
llvm-svn: 66751
2009-03-12 01:20:06 +00:00
Daniel Dunbar aa75c9d8d8 Add StringMap::lookup.
llvm-svn: 66750
2009-03-12 01:16:06 +00:00
Dale Johannesen 5a41b2def5 Fix some nondeterministic behavior when forwarding
from a switch table.  Multiple table entries that
branch to the same place were being sorted by the
pointer value of the ConstantInt*; changed to sort
by the actual value of the ConstantInt.

llvm-svn: 66749
2009-03-12 01:00:26 +00:00
Evan Cheng 690b635aa6 Also pass -gcc-tool-args when building a shared object.
llvm-svn: 66746
2009-03-12 00:53:34 +00:00
Dan Gohman 5637df37cd Revert r66024. The JIT encoding for CALLpcrel32 is wrong -- see PR3773, and the
assembly text output uses an indirect call ("call *") instead of a direct call.

llvm-svn: 66735
2009-03-11 23:01:47 +00:00
Gabor Greif d9065c4e29 update
llvm-svn: 66733
2009-03-11 22:52:25 +00:00
Rafael Espindola 294943c99b optimize i8 and i16 tls values.
llvm-svn: 66725
2009-03-11 22:40:04 +00:00
Owen Anderson aabe06d92a Reorganization: Move the Spiller out of VirtRegMap.cpp into its own files. No (intended) functionality change.
llvm-svn: 66720
2009-03-11 22:31:21 +00:00