Commit Graph

8323 Commits

Author SHA1 Message Date
Dan Gohman 4ef112be62 APInt-ify the gep scaling code, so that it correctly handles the case where
the scale overflows pointer-sized arithmetic. This fixes PR5281.

llvm-svn: 84954
2009-10-23 17:57:43 +00:00
Dan Gohman 41d00ac45b 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.

llvm-svn: 84952
2009-10-23 17:10:01 +00:00
Chris Lattner ccf1e84779 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

llvm-svn: 84942
2009-10-23 06:57:37 +00:00
Chris Lattner 59f94c01dd enhance FoldReinterpretLoadFromConstPtr to handle loads of up to 32
bytes (i256).

llvm-svn: 84941
2009-10-23 06:50:36 +00:00
Chris Lattner ed00b80bf8 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.

llvm-svn: 84936
2009-10-23 06:23:49 +00:00
Evan Cheng 36f4bd0b62 Update tests for 84931.
llvm-svn: 84932
2009-10-23 05:58:34 +00:00
Bill Wendling dbe4424c37 This is passing on Darwin PPC.
llvm-svn: 84921
2009-10-23 01:37:01 +00:00
David Goodwin 02ad4cb32e Allow the target to select the level of anti-dependence breaking that should be performed by the post-RA scheduler. The default is none.
llvm-svn: 84911
2009-10-22 23:19:17 +00:00
Bob Wilson 9d763cc3f8 Revert 84843. Evan, this was breaking some of the if-conversion tests.
llvm-svn: 84868
2009-10-22 16:52:21 +00:00
Duncan Sands 2a536740a4 Check that accessing a struct field that occurs before the start
of the struct (!) works correctly.

llvm-svn: 84853
2009-10-22 12:53:25 +00:00
Duncan Sands ec0a98f033 Test handling of record fields with negative offsets.
llvm-svn: 84851
2009-10-22 10:02:10 +00:00
Evan Cheng 3615b9bef3 Move if-conversion before post-regalloc scheduling so the predicated instruction get scheduled properly.
llvm-svn: 84843
2009-10-22 06:48:32 +00:00
Chris Lattner 3e630653ad testcase for PR4678 & rdar://7309675
llvm-svn: 84830
2009-10-22 04:47:09 +00:00
Evan Cheng 0f55e9ce2e Don't generate sbfx / ubfx with negative lsb field. Patch by David Conrad.
llvm-svn: 84813
2009-10-22 00:40:00 +00:00
Chris Lattner c7a962d3b3 fix PR5262.
llvm-svn: 84810
2009-10-22 00:17:26 +00:00
Anton Korobeynikov f1ad2c618a Use special DAG-to-DAG preprocessing to allow mem-mem instructions to be selected.
Yay for ASCII graphics!

llvm-svn: 84808
2009-10-22 00:16:00 +00:00
Dan Gohman ff97acd8f1 Revert the main portion of r31856. It was causing BranchFolding
to break up CFG diamonds by banishing one of the blocks to the end of
the function, which is bad for code density and branch size.

This does pessimize MultiSource/Benchmarks/Ptrdist/yacr2, the
benchmark cited as the reason for the change, however I've examined
the code and it looks more like a case of gaming a particular
branch than of being generally applicable.

llvm-svn: 84803
2009-10-22 00:03:58 +00:00
Chris Lattner 966526cbfb revert r84754, it isn't the right approach. Edwin, please propose
patches for fixes like this instead of committing them directly.

llvm-svn: 84799
2009-10-21 23:41:58 +00:00
Dale Johannesen f64ea095c1 Adjust testcases for msasm -> alignstack.
llvm-svn: 84796
2009-10-21 23:29:12 +00:00
Bill Wendling 08f9e23fac XFAIL this test for PPC.
llvm-svn: 84782
2009-10-21 21:09:48 +00:00
Jim Grosbach a93ca3c637 Improve handling of immediates by splitting 32-bit immediates into two 16-bit
immediate operands when they will fit into the using instruction.

llvm-svn: 84778
2009-10-21 20:44:34 +00:00
Anton Korobeynikov 9e92857b38 Add DAG printing for RMW stuff debugging
llvm-svn: 84776
2009-10-21 19:18:28 +00:00
Anton Korobeynikov ccfa3e31f7 RMW preprocessing stuff was incorrect. Grab the stuff from x86 backend and disable some tests until it will be clever enough to handle them.
llvm-svn: 84775
2009-10-21 19:17:55 +00:00
Victor Hernandez be9e179104 Make changes to rev 84292 as requested by Chris Lattner.
Most changes are cleanup, but there is 1 correctness fix:
I fixed InstCombine so that the icmp is removed only if the malloc call is removed (which requires explicit removal because the Worklist won't DCE any calls since they can have side-effects).

llvm-svn: 84772
2009-10-21 19:11:40 +00:00
Torok Edwin 1539a352a6 Fix PR5262: when folding select into PHI, make sure all operands are available
in the PHI's Basic Block. This uses a conservative approach, because we don't
have dominator info in instcombine.

llvm-svn: 84754
2009-10-21 10:49:00 +00:00
Evan Cheng 786b15fe12 Match more patterns to movt.
llvm-svn: 84751
2009-10-21 08:15:52 +00:00
Dan Gohman 682a2d154a Revert r84658 and r84691. They were causing llvm-gcc bootstrap to fail.
llvm-svn: 84727
2009-10-21 01:44:44 +00:00
Bill Wendling 42e86ab6c4 This is passing on Darwin PPC.
llvm-svn: 84723
2009-10-21 00:51:40 +00:00
Anton Korobeynikov 7cea91e171 Add reg-imm tests
llvm-svn: 84705
2009-10-21 00:11:44 +00:00
Anton Korobeynikov a6faf60831 Fix invalid for vector types fneg(bitconvert(x)) => bitconvert(x ^ sign)
transform.

llvm-svn: 84683
2009-10-20 21:37:45 +00:00
Chris Lattner 0f15e03c5a add a real testcase for PR4313
llvm-svn: 84676
2009-10-20 21:04:26 +00:00
Chris Lattner 582d056b14 add a test similar to that needed for PR4313, but that doesn't
fail without the patch.

llvm-svn: 84675
2009-10-20 21:00:47 +00:00
Chris Lattner 8468c8e857 the date on this testcase is wrong, it is unreduced, and it passes without the fix for PR4313.
llvm-svn: 84674
2009-10-20 20:57:58 +00:00
Chris Lattner c702b6ab37 merge and filecheckize
llvm-svn: 84672
2009-10-20 20:39:43 +00:00
Chris Lattner 591d4da790 merge two tests and convert to filecheck.
llvm-svn: 84671
2009-10-20 20:33:46 +00:00
Chris Lattner 7f903681ac alternate fix for PR5258 which avoids worklist problems, with reduced testcase.
llvm-svn: 84667
2009-10-20 20:27:49 +00:00
David Goodwin baf6dd26ea Checkpoint more aggressive anti-dependency breaking for post-ra scheduler.
llvm-svn: 84658
2009-10-20 19:54:44 +00:00
Dan Gohman 4a43e3068d Make TranslateX86CC return COND_INVALID instead of aborting when it
encounters an OEQ or UNE comparison, and update its callers to check
for this return status and recover. This fixes a problem resulting from
the LowerOperation hooks being called from LegalizeVectorOps, because
LegalizeVectorOps only lowers vectors, so OEQ and UNE comparisons may
still be at large. This fixes PR5092.

llvm-svn: 84640
2009-10-20 16:22:37 +00:00
Torok Edwin cf10ec951d Fix PR5258, jump-threading creating invalid PHIs.
When an incoming value for a PHI is updated, we must also updated all other
incoming values for the same BB to match, otherwise we create invalid PHIs.

llvm-svn: 84638
2009-10-20 15:42:00 +00:00
Torok Edwin 729d92bd74 Fix PR4313: IPSCCP was not setting the lattice value for the invoke instruction
when the invoke had multiple return values: it set the lattice value only on the
extractvalue.
This caused the invoke's lattice value to remain the default (undefined), and
later propagated to extractvalue's operand, which incorrectly introduces
undefined behavior.

llvm-svn: 84637
2009-10-20 15:15:09 +00:00
Dan Gohman c0964a571b Re-apply r84295, with fixes to how the loop "top" and "bottom" blocks are
tracked. Instead of trying to manually keep track of these locations
while doing complex modifications, just recompute them when they're needed.
This fixes a bug in which the TopMBB and BotMBB were not correctly updated,
leading to invalid transformations.

llvm-svn: 84598
2009-10-20 04:50:37 +00:00
Evan Cheng fa4bcaec7c If the physical register being spilled does not have an interval, spill its sub-registers instead.
llvm-svn: 84586
2009-10-20 01:31:09 +00:00
Jim Grosbach f5f263f1b4 Enable allocation of R3 in Thumb1
llvm-svn: 84563
2009-10-19 22:57:03 +00:00
Chris Lattner 0ed889521b convert to filecheck syntax and make a lot more aggressive.
llvm-svn: 84517
2009-10-19 18:27:56 +00:00
Anton Korobeynikov 8383c3d7f3 Revert r84295, this unbreaks llvm-gcc bootstrap on x86-64/linux
llvm-svn: 84516
2009-10-19 18:21:09 +00:00
Chris Lattner 7ea0c35ba0 rename test
llvm-svn: 84515
2009-10-19 18:18:07 +00:00
Dan Gohman 8f986672a1 Fix SplitBlockPredecessors' LoopInfo updating code to handle the case
where a loop's header is being split and it has predecessors which are not
contained by the most-nested loop which contains the loop.
This fixes PR5235.

llvm-svn: 84505
2009-10-19 16:04:50 +00:00
Torok Edwin 033f01c922 Fix PR5247, "lock addq" pattern (and other atomics), it DOES modify EFLAGS.
LLC was scheduling compares before the adds causing wrong branches to be taken
in programs, resulting in misoptimized code wherever atomic adds where used.

llvm-svn: 84485
2009-10-19 11:00:58 +00:00
Chris Lattner 022ecf01b3 eliminate md_on_instruction.ll, md_on_instruction2.ll is a superset of it.
llvm-svn: 84464
2009-10-19 05:34:14 +00:00
Daniel Dunbar 1df7ea05c3 Teach lit that the .c files in 'test/CodeGen/CellSPU/useful-harnesses' aren't tests.
llvm-svn: 84460
2009-10-19 03:53:55 +00:00