Commit Graph

33853 Commits

Author SHA1 Message Date
Chris Lattner a8e4b4bc7b when we see a unaligned load from an insufficiently aligned global or
alloca, increase the alignment of the load, turning it into an aligned load.

This allows us to compile:

#include <xmmintrin.h>
__m128i foo(__m128i x){
 static const unsigned int c_0[4] = { 0, 0, 0, 0 };
	  __m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
  x  = _mm_unpacklo_epi8(x,  v_Zero);
  return x;
}

into:

_foo:
	punpcklbw	_c_0.5944, %xmm0
	ret
	.data
	.lcomm	_c_0.5944,16,4		# c_0.5944

instead of:

_foo:
	movdqu	_c_0.5944, %xmm1
	punpcklbw	%xmm1, %xmm0
	ret
	.data
	.lcomm	_c_0.5944,16,2		# c_0.5944

llvm-svn: 40971
2007-08-09 19:05:49 +00:00
Evan Cheng a05ec4dc52 GR16_ sub-register class should be GR8_, not GR8. That is, it should only be 8-bit registers in 32-bit mode. Ditto for GR32_.
llvm-svn: 40970
2007-08-09 18:05:17 +00:00
Dale Johannesen c339e45274 Update per review comments.
llvm-svn: 40965
2007-08-09 17:27:48 +00:00
Owen Anderson 9b1cc8cac0 Make NonLocal and None const in the right way. :-)
llvm-svn: 40961
2007-08-09 04:42:44 +00:00
Devang Patel 42e3e5bec1 Traverse loop blocks' terminators to find split candidates.
llvm-svn: 40960
2007-08-09 01:39:01 +00:00
Dale Johannesen ba1a98a4e0 long double 9 of N. This finishes up the X86-32 bits
(constants are still not handled).  Adds ConvertActions
to control fp-to-fp conversions (these are currently
defaulted for all other targets, so no changes there).

llvm-svn: 40958
2007-08-09 01:04:01 +00:00
Dale Johannesen f5124b36e4 Fix arguments for some Altivec instructions. From SWB.
llvm-svn: 40957
2007-08-09 00:49:19 +00:00
Scott Michel 9d09c5ccda If a target really needs to custom lower constants, it should be allowed
to do so.

llvm-svn: 40955
2007-08-08 23:23:31 +00:00
Owen Anderson 2b21c3c7a8 Add more comments to memdep.
llvm-svn: 40953
2007-08-08 22:26:03 +00:00
Devang Patel 0183c797c4 Add cost analysis.
llvm-svn: 40952
2007-08-08 22:25:28 +00:00
Owen Anderson fa788358d5 Make memdep fit in 80 cols.
llvm-svn: 40950
2007-08-08 22:01:54 +00:00
Owen Anderson 927f62a3a1 Add one more comment.
llvm-svn: 40949
2007-08-08 21:54:33 +00:00
Owen Anderson 064bad44d1 Cleanup and comment-ize the memdep header.
llvm-svn: 40948
2007-08-08 21:53:20 +00:00
Devang Patel 0e34ee25ab Preserve dom info while processing one iteration loop.
llvm-svn: 40947
2007-08-08 21:39:47 +00:00
Owen Anderson b84d3b1c92 Change the None and NonLocal markers in memdep to be const.
llvm-svn: 40946
2007-08-08 21:39:39 +00:00
Reid Spencer fd46badca5 Separate program name from error message with a :
llvm-svn: 40945
2007-08-08 21:19:01 +00:00
Devang Patel 8abc5c82b7 Clear split info.
llvm-svn: 40944
2007-08-08 21:18:27 +00:00
Reid Spencer f054db3242 Terminate an error message with a newline.
llvm-svn: 40943
2007-08-08 21:17:59 +00:00
Devang Patel 593bf9ceb3 Handle multiple split conditions.
llvm-svn: 40941
2007-08-08 21:02:17 +00:00
Reid Spencer 8574ac95f0 Make it clear that getSTDIN returns null when stdin is empty.
llvm-svn: 40940
2007-08-08 20:02:20 +00:00
Reid Spencer 155533cf73 Make getSTDIN return null if the standard input is empty, as the header file
documentation implies and as its uses depend.

llvm-svn: 40939
2007-08-08 20:01:58 +00:00
Reid Spencer 8609c06956 Allow the filename "-" to be a place holder for stdin. This allows directing
stdin through llvm-ld and llvm-link.

llvm-svn: 40938
2007-08-08 19:52:29 +00:00
Owen Anderson 680862880d Global values also don't undead-ify pointers in our dead alloca's set.
llvm-svn: 40936
2007-08-08 19:12:31 +00:00
Owen Anderson ddf4aee543 Make handleEndBlock significantly faster with one trivial improvement,
and one hack to avoid hitting a bad case when the alias analysis is imprecise.

llvm-svn: 40935
2007-08-08 18:38:28 +00:00
Owen Anderson 50df9685b0 Small improvement: if a function doesn't access memory, we don't need to scan
it for potentially undeading pointers.

llvm-svn: 40933
2007-08-08 17:58:56 +00:00
Owen Anderson 52aaabf74d Add some comments, remove a dead argument, and simplify some control flow.
No functionality change.

llvm-svn: 40932
2007-08-08 17:50:09 +00:00
Chris Lattner d1fd0db2ae eliminate redundant conditions from the signless types conversion.
llvm-svn: 40927
2007-08-08 16:19:57 +00:00
Chris Lattner 7574ef3ac4 Handle functions with no name better.
llvm-svn: 40926
2007-08-08 16:07:23 +00:00
Evan Cheng d771b793fe Adding kill info to val#.
llvm-svn: 40925
2007-08-08 07:03:29 +00:00
Chris Lattner 785f9986bd significantly speed up constant folding of calls (and thus all clients that use
ConstantFoldInstruction on calls) by avoiding Value::getName().  getName() constructs
and returns an std::string, which does heap allocation stuff.  This slightly speeds up
instcombine.

llvm-svn: 40924
2007-08-08 06:55:43 +00:00
Chris Lattner 415750e132 Speed up updateDFSNumbers with two observations:
1. domtree is a tree, not a graph.  There is no need to avoid revisiting nodes with a set.
2. the worklist can contain the child iterator pointers so we don't get N^2 rescanning of children.

This speeds up updateDFSNumbers significantly, making it basically free.  On the testcase in PR1432,
this speeds up loopsimplify by another 3x, dropping it from the 12th most expensive pass to the to
the 30th. :)  It used to be #1.

llvm-svn: 40923
2007-08-08 06:24:20 +00:00
Owen Anderson b17ab03081 A few more small cleanups.
llvm-svn: 40922
2007-08-08 06:06:02 +00:00
Evan Cheng 103947125c Clean up and bug fix.
llvm-svn: 40921
2007-08-08 05:56:18 +00:00
Chris Lattner c63d4c2e4e reimplement dfs number computation to be significantly faster. This speeds up
natural loop canonicalization (which does many cfg xforms) by 4.3x, for 
example.  This also fixes a bug in postdom dfnumber computation.

llvm-svn: 40920
2007-08-08 05:51:24 +00:00
Owen Anderson 0aecf0ebef First round of cleanups from Chris' feedback.
llvm-svn: 40919
2007-08-08 04:52:29 +00:00
Evan Cheng a8c2f38617 - Each val# can have multiple kills.
- Fix some minor bugs related to special markers on val# def. ~0U means
  undefined, ~1U means dead val#.

llvm-svn: 40916
2007-08-08 03:00:28 +00:00
Devang Patel 68de1ae816 Embrace patch review feedback.
llvm-svn: 40915
2007-08-08 01:51:27 +00:00
Evan Cheng c236617ea0 Remove a dead assertion.
llvm-svn: 40914
2007-08-08 01:00:21 +00:00
Evan Cheng 0d0fee269a - LiveInterval value#'s now have 3 components: def instruction #,
kill instruction #, and source register number (iff the value# is defined by a
copy).
- Now def instruction # is set for every value#, not just for copy defined ones.
- Update some outdated code related inactive live ranges.
- Kill info not yet set. That's next patch.

llvm-svn: 40913
2007-08-07 23:49:57 +00:00
Devang Patel c7e53bdcfd Fix new compare instruction's signness. Caught by Chris during review.
llvm-svn: 40912
2007-08-07 23:17:52 +00:00
Devang Patel 549c0d5175 Fix comment.
llvm-svn: 40911
2007-08-07 23:16:03 +00:00
Owen Anderson 0cc1a76283 Don't insert nearly as many redundant phi nodes.
llvm-svn: 40909
2007-08-07 23:12:31 +00:00
Dale Johannesen 4e7ff3593c Fix spelling of mtvscr and mfvscr.
llvm-svn: 40908
2007-08-07 23:08:00 +00:00
Dale Johannesen a47f7d7cfd Long double patch 8 of N: make it partially work in
SSE mode (all but conversions <-> other FP types, I think):
>>Do not mark all-80-bit operations as "Requires[FPStack]"
(which really means "not SSE").
>>Refactor load-and-extend to facilitate this.
>>Update comments.
>>Handle long double in SSE when computing FP_REG_KILL.

llvm-svn: 40906
2007-08-07 20:29:26 +00:00
Reid Spencer 8feb9d67e8 Who thought up this crazy formatting scheme?
llvm-svn: 40905
2007-08-07 17:57:36 +00:00
Reid Spencer 4391aa042c Okay, over/back tags don't next.
llvm-svn: 40904
2007-08-07 17:48:56 +00:00
Devang Patel 19211b6528 Use eraseFromParent().
llvm-svn: 40903
2007-08-07 17:45:35 +00:00
Reid Spencer 5f5bb46e95 Try an indent level for better formatting.
Add the -version option.

llvm-svn: 40902
2007-08-07 17:43:48 +00:00
Reid Spencer d64584f64b Add the code generation options.
llvm-svn: 40900
2007-08-07 17:12:43 +00:00
David Greene c600d65e2b Make this code more efficient
llvm-svn: 40899
2007-08-07 16:57:55 +00:00