Commit Graph

8432 Commits

Author SHA1 Message Date
Chris Lattner
48b59ec817 reapply r85085 with a bugfix to avoid infinite looping.
All of the 'demorgan' related xforms need to use 
dyn_castNotVal, not m_Not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 15:40:07 +00:00
Dan Gohman
a8225083ba Make LSR's OptimizeShadowIV ignore induction variables with negative
strides for now, because it doesn't handle them correctly. This fixes a
miscompile of SingleSource/Benchmarks/Misc-C++/ray.

This problem was usually hidden because indvars transforms such induction
variables into negations of canonical induction variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 15:32:57 +00:00
Evan Cheng
a5dc45e3c8 - Revert some changes from 85044, 85045, and 85047 that broke x86_64 tests and
bootstrapping. It's not safe to leave identity subreg_to_reg and insert_subreg
  around.
- Relax register scavenging to allow use of partially "not-live" registers. It's
  common for targets to operate on registers where the top bits are undef. e.g.
  s0 =
  d0 = insert_subreg d0<undef>, s0, 1
  ...
     = d0
  When the insert_subreg is eliminated by the coalescer, the scavenger used to
  complain. The previous fix was to keep to insert_subreg around. But that's
  brittle and it's overly conservative when we want to use the scavenger to 
  allocate registers. It's actually legal and desirable for other instructions
  to use the "undef" part of d0. e.g.
  s0 =
  d0 = insert_subreg d0<undef>, s0, 1
  ...
  s1 =
     = s1
     = d0
  We probably need add a "partial-undef" marker on machine operand so the
  machine verifier would not complain.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 04:56:07 +00:00
Evan Cheng
85def16079 Revert 85085. It causes infinite looping during llvm-gcc build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85090 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 03:51:32 +00:00
Edward O'Callaghan
7e43439e81 Fix gmake check for AuroraUX triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 02:37:56 +00:00
Chris Lattner
863928fc39 Implement PR3266 & PR5276, folding:
not (or (icmp, icmp)) -> and(icmp, icmp)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 01:06:31 +00:00
Chris Lattner
f2b4854e3f convert or.ll to filecheck and merge or2 into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 23:47:55 +00:00
Chris Lattner
1d871c5e54 fix PR5295 where the .ll parser didn't reject a function after a global
or global after a function with conflicting names.  Update some testcases
that were accidentally depending on this behavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 23:22:50 +00:00
Evan Cheng
21a45557c6 Add a couple of ARM cross-rc coalescing tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 08:01:41 +00:00
Evan Cheng
cc7a5b91de Update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 07:53:48 +00:00
Mikhail Glushenkov
14cb2a2327 Add a test for OptionPreprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 01:43:50 +00:00
Dan Gohman
5639cb6b9e Update these tests to match what Loop::print now prints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 23:52:07 +00:00
Dan Gohman
2b110caabf Make these tests more interesting by using
-verify-dom-info and -verify-loop-info, which enable additional
(expensive) consistency checks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 23:23:04 +00:00
Daniel Dunbar
3bc1b19930 Teach macho-dump to dump UUIDs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-24 20:32:36 +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
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
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
b6c215b63f Update tests for 84931.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 05:58:34 +00:00
Bill Wendling
81dc7861a4 This is passing on Darwin PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 01:37:01 +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
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
Duncan Sands
9772acdb47 Check that accessing a struct field that occurs before the start
of the struct (!) works correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 12:53:25 +00:00
Duncan Sands
65a168cff3 Test handling of record fields with negative offsets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84851 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 10:02:10 +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
Chris Lattner
0841564bc4 testcase for PR4678 & rdar://7309675
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 04:47:09 +00:00
Evan Cheng
8000c6c535 Don't generate sbfx / ubfx with negative lsb field. Patch by David Conrad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:40:00 +00:00
Chris Lattner
7f23958aa4 fix PR5262.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:17:26 +00:00
Anton Korobeynikov
f32df4ce3e Use special DAG-to-DAG preprocessing to allow mem-mem instructions to be selected.
Yay for ASCII graphics!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:16:00 +00:00
Dan Gohman
6d31268a7d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 00:03:58 +00:00
Chris Lattner
857eb5793e revert r84754, it isn't the right approach. Edwin, please propose
patches for fixes like this instead of committing them directly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:41:58 +00:00
Dale Johannesen
7d977a3e80 Adjust testcases for msasm -> alignstack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:29:12 +00:00
Bill Wendling
0fffe21b65 XFAIL this test for PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 21:09:48 +00:00
Jim Grosbach
65b7f3af76 Improve handling of immediates by splitting 32-bit immediates into two 16-bit
immediate operands when they will fit into the using instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 20:44:34 +00:00
Anton Korobeynikov
a91f4c561e Add DAG printing for RMW stuff debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 19:18:28 +00:00
Anton Korobeynikov
83fceb9481 RMW preprocessing stuff was incorrect. Grab the stuff from x86 backend and disable some tests until it will be clever enough to handle them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 19:17:55 +00:00
Victor Hernandez
68afa54033 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 19:11:40 +00:00
Torok Edwin
0739bd0ab2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 10:49:00 +00:00
Evan Cheng
2095659a85 Match more patterns to movt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 08:15:52 +00:00
Dan Gohman
c1ae8c9b8f Revert r84658 and r84691. They were causing llvm-gcc bootstrap to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 01:44:44 +00:00
Bill Wendling
ce1379f72c This is passing on Darwin PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:51:40 +00:00
Anton Korobeynikov
a3da7c3ca8 Add reg-imm tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 00:11:44 +00:00
Anton Korobeynikov
2bcf60a9cc Fix invalid for vector types fneg(bitconvert(x)) => bitconvert(x ^ sign)
transform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 21:37:45 +00:00
Chris Lattner
d0d3cbb362 add a real testcase for PR4313
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 21:04:26 +00:00
Chris Lattner
82a39b3e14 add a test similar to that needed for PR4313, but that doesn't
fail without the patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 21:00:47 +00:00
Chris Lattner
b5b1e7738b the date on this testcase is wrong, it is unreduced, and it passes without the fix for PR4313.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:57:58 +00:00
Chris Lattner
f7d3570d8e merge and filecheckize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:39:43 +00:00
Chris Lattner
7f2076023a merge two tests and convert to filecheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:33:46 +00:00
Chris Lattner
88a8624f8e alternate fix for PR5258 which avoids worklist problems, with reduced testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 20:27:49 +00:00
David Goodwin
480c529e02 Checkpoint more aggressive anti-dependency breaking for post-ra scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84658 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 19:54:44 +00:00
Dan Gohman
1a49295eae 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 16:22:37 +00:00
Torok Edwin
f993327e71 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 15:42:00 +00:00
Torok Edwin
2b6183d254 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 15:15:09 +00:00
Dan Gohman
07adb85cb7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 04:50:37 +00:00
Evan Cheng
0222a8cfb8 If the physical register being spilled does not have an interval, spill its sub-registers instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20 01:31:09 +00:00
Jim Grosbach
6009751244 Enable allocation of R3 in Thumb1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 22:57:03 +00:00
Chris Lattner
7bf4bc5a1d convert to filecheck syntax and make a lot more aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:27:56 +00:00
Anton Korobeynikov
766fc1db16 Revert r84295, this unbreaks llvm-gcc bootstrap on x86-64/linux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:21:09 +00:00
Chris Lattner
baa989ed6e rename test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 18:18:07 +00:00
Dan Gohman
841a147531 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 16:04:50 +00:00
Torok Edwin
6602922878 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 11:00:58 +00:00
Chris Lattner
13435d9383 eliminate md_on_instruction.ll, md_on_instruction2.ll is a superset of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 05:34:14 +00:00
Daniel Dunbar
068c56e0d7 Teach lit that the .c files in 'test/CodeGen/CellSPU/useful-harnesses' aren't tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 03:53:55 +00:00
Nate Begeman
a09008bf6d Add support for matching shuffle patterns with palignr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-19 02:17:23 +00:00
Evan Cheng
d36076e4a3 Turn on post-alloc scheduling for x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 19:57:27 +00:00
Chris Lattner
1c79be9dcd remove a now-pointless regtest
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 05:20:17 +00:00
Chris Lattner
76596c86c4 remove testcase for dead pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 05:03:41 +00:00
Chris Lattner
ec63ad6c1f fix test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 05:03:00 +00:00
Chris Lattner
e62b2633e8 tighten up test3, add test3a for the converse
transform, which isn't happening yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 04:55:26 +00:00
Chris Lattner
6e85d91144 tighten test2, add a test that it doesn't get transformed in the invalid edge case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 04:50:18 +00:00
Nick Lewycky
15d3c05adf Merge tests into modref.ll. Also add a test for r84174 at Chris' behest!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 04:41:36 +00:00
Nick Lewycky
c1a38f59b5 Add a couple new testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-18 00:42:07 +00:00
Chris Lattner
a22922d19a replace a useless test with a useful one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 23:59:51 +00:00
Nick Lewycky
3fc35c594c Fix test/Bindings/Ocaml/vmcore.ml. When IRBuilder::CreateMalloc was removed,
LLVMBuildMalloc was reimplemented but with the bug that it didn't insert the
resulting instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 23:52:26 +00:00
Chris Lattner
59c4eba416 Teach vm core to more aggressively fold 'trunc' constantexprs,
allowing it to simplify the crazy constantexprs in the testcases
down to something sensible.  This allows -std-compile-opts to
completely "devirtualize" the pointers to member functions in
the testcase from PR5176.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 21:53:27 +00:00
Chris Lattner
5e5c4d3d5a remove # uses from FileCheck lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 21:51:19 +00:00
Chris Lattner
c812f79fb8 rename test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 21:31:19 +00:00
Mikhail Glushenkov
2cea7bdef9 Disallow multiple instances of PluginPriority.
Several instances of PluginPriority in a single file most probably signifies a
programming error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:08:30 +00:00
Chris Lattner
6128df5255 Simplify some code (first hunk) and fix PR5208 (second hunk) by
updating the callgraph when introducing a call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 05:39:39 +00:00
Daniel Dunbar
9c7ca4a745 Reclaim a lost month.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 03:28:20 +00:00
Dan Gohman
3bdd8de280 Enhance CodePlacementOpt's unconditional intra-loop branch elimination logic
to be more general and understand more varieties of loops.

Teach CodePlacementOpt to reorganize the basic blocks of a loop so that
they are contiguous. This also includes a fair amount of logic for preserving
fall-through edges while doing so. This fixes a BranchFolding-ism where blocks
which can't be made to use a fall-through edge and don't conveniently fit
anywhere nearby get tossed out to the end of the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 00:32:43 +00:00
Victor Hernandez
13ad5aaaff Autoupgrade malloc insts to malloc calls.
Update testcases that rely on malloc insts being present.

Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 00:00:19 +00:00
Victor Hernandez
8db42d2b1c HeapAllocSRoA also needs to check if malloc array size can be computed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84288 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 23:12:25 +00:00
Mon P Wang
362b8f2786 Update tests to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 22:09:05 +00:00
Mon P Wang
70bf40d02e Add test case for r84279
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84280 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 22:07:19 +00:00
Dan Gohman
b00f236b03 Move zext and sext casts fed by loads into the same block as the
load, to help SelectionDAG fold them into the loads, unless
conditions are unfavorable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 20:59:35 +00:00
Devang Patel
a43d46f523 Parse PHI instruction with attached metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 18:45:49 +00:00
Devang Patel
149aa7cce3 If there is not any llvm instruction associated with each lexical scope encoded in debug info then create such scope on demand for variable info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 18:18:03 +00:00
Victor Hernandez
3a73bb38ba Invert isSafeToGetMallocArraySize check because we return NULL when we don't know the size.
Thanks to Duncan Sands for noticing this bug.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84260 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 18:07:17 +00:00
Daniel Dunbar
db196e82a4 Force triple in tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 16:30:02 +00:00
Duncan Sands
0f2bd97434 Check that GVN performs this transform even if the calls
themselves are not marked readonly, but only the called
functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 12:18:23 +00:00
Evan Cheng
d3dd50fec0 Enable post-alloc scheduling for all ARM variants except for Thumb1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 06:11:08 +00:00
Daniel Dunbar
75773ff00d MC: Tweak variable assignment diagnostics, and make reassignment of non-absolute
variables and symbols invalid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:57:39 +00:00
Daniel Dunbar
fffff915d5 MC: When parsing a variable reference, substitute absolute variables immediately
since they are allowed to be redefined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 01:34:54 +00:00
Sandeep Patel
452b54a8ae Branches must be the last instruction in a Thumb2 IT block. Approved by Evan Cheng.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 22:25:32 +00:00
Sanjiv Gupta
753ec15d5f Re-apply 84180 with the fixed test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 19:26:25 +00:00
Jakob Stoklund Olesen
6ad8c84d70 Move Blackfin intrinsics into the Target/Blackfin directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 18:50:52 +00:00
Dan Gohman
cd2ae14ce3 Make CodePlacementOpt align loops, rather than loop headers. The
header is just the entry block to the loop, and it needn't be at
the top of the loop in the code layout.

Remove the code that suppressed loop alignment for outer loops,
so that outer loops are aligned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 00:36:22 +00:00
Evan Cheng
a2f8047134 When LiveVariables is adding implicit-def to model "partial dead", add the earlyclobber marker if the superreg def has it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 23:39:27 +00:00
Nick Lewycky
ca55ee03b0 Make use of the result of the loads even though that means adding -instcombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 19:02:13 +00:00
Chris Lattner
8db2cd1fc7 make instcombine's instruction sinking more aggressive in the
presence of PHI nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 15:21:58 +00:00
Evan Cheng
681a33e26d Another BasicAA fix. If a value does not alias a GEP's base pointer, then it
cannot alias the GEP. GEP pointer alias rule states this clearly:
A pointer value formed from a getelementptr instruction is associated with the
addresses associated with the first operand of the getelementptr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 06:41:49 +00:00
Evan Cheng
2c4f28255b Replace test with a simpler hand crafted one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 01:45:10 +00:00
Dale Johannesen
52a5362733 Use llvmgxx for C++ test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84066 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 00:34:56 +00:00
Dan Gohman
79d4646f4b Fix this test to account for a movl $0 being emitted as an xor now,
and convert it to FileCheck.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 00:28:48 +00:00
Dale Johannesen
0ccfc4c058 Testcases for msasm bit (llvm-gcc 84062).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 00:10:54 +00:00
Evan Cheng
50a5914e12 Teach basic AA about PHI nodes. If all operands of a phi NoAlias another value than it's safe to declare the PHI NoAlias the value. Ditto for MustAlias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 22:02:20 +00:00
Devang Patel
b408b15fa4 Optimizer may remove debug info. This test checks debug info for include headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 20:56:38 +00:00
Bob Wilson
765cc0b9d5 Revise ARM inline assembly memory operands to require the memory address to
be in a register.  The previous use of ARM address mode 2 was completely
arbitrary and inappropriate for Thumb.  Radar 7137468.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 20:50:28 +00:00
Dale Johannesen
4360298d2b Add an "msasm" flag to inline asm as suggested in PR 5125.
A little ugliness is accepted to keep the binary file format
compatible.  No functional change yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 20:46:56 +00:00
Devang Patel
9578c7aad6 These tests now pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 20:45:18 +00:00
Sandeep Patel
47eedaa8fa Add ARMv6T2 SBFX/UBFX instructions. Approved by Anton Korobeynikov.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 18:59:48 +00:00
Chris Lattner
11f15dbb28 change simplifycfg to not duplicate 'unwind' instructions. Hopefully
this will increase the likelihood of common code getting sunk towards
the unwind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83996 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 18:13:05 +00:00
Chris Lattner
bf07da0e27 convert to filecheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 18:10:05 +00:00
Chris Lattner
f137f2f4c5 rename test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 18:08:21 +00:00
Chris Lattner
2d175064ab don't use dead loads as tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 17:39:29 +00:00
Devang Patel
39a38ae529 Disable this test for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 16:32:09 +00:00
Nick Lewycky
5c9be67cff Teach BasicAA a little something about the atomic intrinsics: they can only
modify through the pointer they're given.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 07:48:38 +00:00
Nick Lewycky
cc271861da Add new "memory use marker" intrinsics. These indicate lifetimes and invariant
sections of memory objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 07:03:23 +00:00
Chris Lattner
4a8e17da32 remove notcast, it is now dead!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 04:27:02 +00:00
Chris Lattner
2a03c04424 remove two old and nearly useless tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 04:25:24 +00:00
Devang Patel
e12ee4b738 XFAIL these tests for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83933 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 01:51:29 +00:00
Victor Hernandez
5c78736f85 Memory dependence analysis was incorrectly stopping to scan for stores to a pointer at bitcast uses of a malloc call.
It should continue scanning until the malloc call, and this patch fixes that.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 01:42:53 +00:00
Chris Lattner
f1787b055c allow this testcase to pass with recent changes. The test hasn't been
producing any stores at all for a long time, but ".store." was in some
IR instruction names until recently.  This removal caused the test to
start failing.  Just make it reject any stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 20:42:35 +00:00
Dan Gohman
0032681424 Don't forget to mark RAX as live-out of the function when arranging for
it to hold the address of an sret return value, for x86-64 ABI purposes.

Also, fix the test that was originally intended to test this to actually
test it, using FileCheck.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 16:36:12 +00:00
Benjamin Kramer
90869455b5 Eliminate some redundant llvm-as calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 09:31:55 +00:00
Edward O'Callaghan
d75d267367 Missing CHECK: lines makes test exit abnormally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83835 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 09:01:26 +00:00
Edward O'Callaghan
2a4bea5262 FileCheck not CheckFile, oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 08:51:28 +00:00
Edward O'Callaghan
5464547c02 Convert InstCombine/call.ll to CheckFile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83833 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 08:46:47 +00:00
Edward O'Callaghan
7aeb9b5e4c Convert the rest of the InstCombine tests from notcast to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 07:18:14 +00:00
Nick Lewycky
a457ba09f7 Remove this part of the test, it never actually tested anything anyways. This
unbreaks make check after evocallaghan's changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 06:32:42 +00:00
Edward O'Callaghan
60ea2c5a18 Fix syntax error missed in converting zext.ll test. Convert 2003-11-13-ConstExprCastCall.ll to FileCheck from notcast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 06:23:56 +00:00
Edward O'Callaghan
853075e762 Convert InstCombine tests from notcast to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 06:14:06 +00:00
Anton Korobeynikov
436604d505 Add missed mem-mem move patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 23:03:53 +00:00
Anton Korobeynikov
afac8abfc0 Add MSP430 mem-mem insts support. Patch by Brian Lucas with some my refinements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 23:03:28 +00:00
Anton Korobeynikov
aca471f3a5 Add bunch of MSP430 'feature' tests. Patch by Brian Lucas with some my refinements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 23:02:38 +00:00
Chris Lattner
0a11939fe8 reduce vec_shuffle2 and merge into vec_shuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 22:54:48 +00:00
Chris Lattner
98d59dfbb6 filecheckize vec_shuffle.ll and merge shuffle.ll into it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 22:52:15 +00:00
Chris Lattner
588c490aad filecheckize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 22:45:17 +00:00
Chris Lattner
a01752920e rename test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 22:44:16 +00:00
Chris Lattner
ee07e715ff remove old testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 22:42:06 +00:00
Chris Lattner
90d4f3a077 merge test into shift.ll, this also eliminates awful grepping on -stats output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 22:39:58 +00:00
Chris Lattner
490ff6310a convert to filecheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 22:36:59 +00:00
Chris Lattner
d088314998 teach instcombine to simplify xor's harder, catching the
new testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 22:22:13 +00:00
Chris Lattner
833f0cc57f convert xor2 to filecheck, merge in a random regtest
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 21:42:08 +00:00
Chris Lattner
d2c58366d8 generalize a transformation even more: we don't care whether the
input the the mul is a zext from bool, just that it is all zeros
other than the low bit.  This fixes some phase ordering issues
that would cause us to miss some xforms in mul.ll when the worklist
is visited differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 21:29:45 +00:00
Chris Lattner
0036e3a469 simplify a transformation by making it more general.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-11 21:22:21 +00:00